UUID or timeStamp

I ran into a small chunk of free time, and I would like to do a significant but hopefully minor refactor job for my app, Baby Pool.  Unfortunately the change involves syncing, and when I originally designed the app I did not have the syncing perfected.  The adding of guesses to pools involves spagetti logic, which needs to be completely rewritten.

One other change I would like to make involves the removal of guess sync category, “PENDING” unless there are no more guesses left.  This is a significant customer request, and I know it was over-thinking the security and control aspect of these guesses. Admittedly so, it’s a lazy feature implementation, but hey! We all make mistakes!  This will simplify the UI a bit, but be a small refactoring of the business logic…

So I have two options at refactoring the first problem of the guess sync mechanism.

1) Stick with the creation date, and determinate uniqueness off that date and an additional field like the pool key. I will have to query for a guess of the same creation date, and update it if it exists or add it if its not there.  I believe I attempted to do this the first time around, but instead of updating if it exists, I skip it.

2) Go with a more “industry standard” approach of inserting UUIDs for objects in all my tables.  Then I would have to track a syncdate that is off the UTFC. And pass around objects from the last successful syncdate. Those objects would all follow the same scheme of the creationDate, but it’s guaranteed unique, and it’s more geared for Core Data and mysql queries: If UUID exists, update, if not, add it.

Either way, I definitely need to track the syncdate using UTC time, I believe originally I set it to the local time.  If I add a sync date on the first sync that the server passes down as a UTC time, I will always query off that last sync time and send back all changes. I would much rather be tracking for duplicates off a UUID.  So I’ll go ahead and make that change as well.

First thing to do take out the PENDING if the account has enough guesses remaining. From now on, whenever a person makes a guess, it goes straight to Added state unless the guesses remaining hits 0.  I will need to keep a balance of guesses, and when there is a negative amount of guesses, I’ll only add the guesses as pending if the user needs to purchase additional guesses.  The whole in app purchase strategy may have been a mistake, it’s good that I tried it out, but at this point, it’s probably ok to just remove it completely!

On IOS, creating a UUID is pretty straight forward:

Posted in Uncategorized | Leave a comment

Prototype #3 nearing completion

I figured out this stumper of a problem where TLC 5940 was conflicting with my Software Serial output…

Whenever TLC.init(); was called, the software serial would go bonkers and just go to HIGH, and things would work sort of sporadically as far as the TLC lights went.

The problem was that I mistakenly used the TLC’s DUMMY_PIN as a software serial RX port knowing that I would not be using serial RX on the atmega I was testing on.  However, a little known fact is that the RX pin goes to HIGH when it is idle….hmmm.  Also, despite its name, DUMMY_PIN is not necessarily useless on the TLC.  That pin happens to be used for something, and when HIGH, the whole thing goes to shitzville.  So, rejiggering my pins around solved this latest blocker I’ve been stumped on for a few days.

Now I have things are running swimmingly, see video:

I just need to hook back up the RF24 to this prototype, which was miswired in my schematic (I say upverter.com is at fault for this one! QA your footprints, people!) , so I will have to rewire on a separate breadboard for this proto before I get the next one printed.

 

 

Posted in Uncategorized | Leave a comment

Troubles in Bike Light Paradise

I am beating my head up trying to once again get a simple stupid push button switch to signal the atmega 328P over a pin.  The button that I am currently testing is hooked up to PIN1,  so it’s possible there is an interrupt or something using PIN 1 for the TLC…

I hooked up the Software Serial and discovered that when the TLC.init() is called on the TLC5940, it stops the software serial sending on pin 13.  I hear the TLC uses pin 13 also for serial clock, and I thought this is something that could be shared via SPI.

Oh well, in any case, I’ll move the Software Serial to pin 5, which is a reserved test pin, and should be good.

I’ll also have to try a different input….the only other ones are Left – PIN0, Mode – PIN1, Right – PIN2, Cancel – PIN4

I’ll have to test button presses on cancel only because it’s not on the ATMEGA TX/RX pins which have caused me headaches in the past. ( but that may have been originally due to shorted pins on my old arduino ).

The buttons I had to remove because I wired them backwards….so many mistakes, I have to keep reminding myself that I am still definitely learning.

Posted in Uncategorized | Leave a comment

Maker Faire 2013!!

IMG_2738

Maker robot says “hello!”

Maker faire 2013 was pretty cool! Like last year, I left only wishing I had more time to spend there.

Saw a cool late art maker machine:

IMG_2733

This thing was badass

I smell some competition for Zombie Runner coffee:

IMG_2734

The late robot makes tasty coffee

Saw this puppy making drinks from an iPad menu. It pours drinks down to the .1 ounce precision…Very cool demo:

IMG_2735

Arduino-powered mixed drink maker.

The 3D printer space was crowded as ever. Lots of new printers entering the market makes me very excited for 3D printing:

IMG_2737

One of the many cool and more affordable 3D printers

Very kid friendly this year! Can’t wait to bring my daughter in about 8 years! ;)

IMG_2729

Kids stuff was a big theme at this year’s faire

I wish I saw this in action, but it was cool just to look at:

IMG_2727

Human sized mouse trap…

IMG_2728

After a full Saturday at the faire I was done in:

IMG_2741

EXTERMINATE!!!!

Posted in Arduino | Leave a comment

Prototype #2

Here’s video of the second prototype I started at the Upverter Hardware Hackathon:

Already working on the 3rd Prototype, which will involve possibly printing a plastic prototype to hold it in place.

Attaching this correctly to the bike will be the next big challenge.

I have a good idea on an easy pinch on pinch off type of configuration.

Posted in Arduino | Leave a comment

Lazy loading, not for the feint of heart

ARC, I long for you…

I’ve been running into problems finding lazy loading done wrong. When one is diligent and not “lazy” with lazy loading, it’s great, but when I see deallocs filling with the following, I get a bit concerned.

This code should throw up red flags. It seems obvious, but if one wants to use synthesized initializers in your dealloc, make SURE you are not lazy loading the dang thing.

Otherwise, just as you are tearing down the class, you are initializing these ivars in something like:

Other places lazy initialization will hurt are when checking the value of a synthesized accessor to see if the class should go away. You should check the ivar directly or check if it exists instead of using the accessor with the lazy loading.

Posted in iOS Development | Leave a comment

Bike light prototype takes leap forward at Hackathon

What an amazing Saturday I had at the Upverter/Y-Combinator Hardware hackathon. I was not expecting the amount of enthusiasm and interest in hardware. The level of talent I came across was pretty remarkable.

I went in hoping to spend some good time improving the design of my bike light, and I walked away with much, much more.

Some takeaways:

1) Networking is easy – all you have to do is show up.

There are so many of these events going on any given month. Seriously, just attending, I met more people and people just wander around chatting about projects and are more than willing to collaborate on things. Being present is half the battle in networking.

2) Having a working prototype was worth more than words. It’s much easier to explain an idea by showing it off, and by stating some goals around an existing prototype. People gravitate towards things they understand and can physically see.

3) Hackathons are a great place to swarm on an idea. If I need help getting something done, it’s helpful to multitask with more people. As a major added bonus, it’s basically free help.

Accomplishments:

1) An awesome front Bike Light hooked up to a TLC LED multiplexor. The power, and capabilities of the TLC 5890 is much greater than the 8-Bit Shifter I was using. Video coming….I promise this time!

2) Figured out how to use the audio soft modem breakout board. We successfully were able to transmit data to the softmodem from a computer’s audio out. There were a few tweaks to the board to get it to work. We had to set a couple jumpers in addition to switching the “in” and “out” ports on the breakout board.

3) A partially completed schematic on Upverter.

More on this coming soon. I understand I’ll be able to

Posted in Uncategorized | Leave a comment

Mount NFS in Mountain Lion

Just a quick script to mount my raspberrypi drive on my macbook:

Find the mount:

Now mount it:

Posted in Scripting | Leave a comment

New Arduino ISP shield

Just got a new Arduino ISP programmer shield in the mail from Jeff Murchison’s site:

http://jeffmurchison.com/blog/arduinoisp-deluxe-shield-updated/

The little thing is exactly what I need to get programming my atmega’s a bit faster than having to extract the chips from the arduino socket every time I want to upload a sketch. As an added bonus they are great for programming a wide variety of chips, and I have a bunch of bunch of Atmega 328p, 328, 168a-pu, and 168 chips hanging around, so this little ISP is GOLD!

I ran into a bit of a problem programming the 168a-pu…I was getting the following error when trying to burn a bootloader or progra the chip:

avrdude: Expected signature for ATMEGA128 is 1E 94 06
Double check chip, or use -F to override this check.

After some google searches, the solution for me was to edit the 168p signiture in avrdude.conf with the following lines:

I selected the “Arduino decimielia or duelemilanove with ATMEGA 168″ board from Tools -> Board. That allowed me to bootload the 168a-pu chip no problem.

Then I can choose “Upload using programmer” under the File menu for any sketch. Previously, I would have to bootload the chip each time I wanted to upload a sketch for this particular chip, because for some reason the sketch was overwriting the bootloader.

Anyway, it’s nice to have such an easy to use ISP programmer that I am only beginning to see all the benefits of using.

Posted in Arduino | Leave a comment

Turn Signal light prototype complete!

Just before the new year, I finished connecting up the front and back light with a working prototype, which I’ll have to upload a video of soon.

So, I finished the first major part of this bike light project, get a remote turn signal prototype working on a soldered, form fitting layout. From here, I could take a couple of different paths. One path is:

1) Call it a day and move on to a different project.

2) Make a prototype that will work on my bike.

3) Design a prototype that will work as a hacker space type of product.

Here’s just a brief thought process on moving forward:

Option 1) I am thinking I could take some time off and maybe do a few smaller projects in a couple different directions, which should be a whole lot easier considering all I have learned doing this turn signal project.

Projects that currently have a bit of interest include:

- Make my own atmel ISP programmer.

- Create a desk light from a project in Make Magazine.

- Create a decorative led/fan paper wind paper plant.

Option 2) If I just want to get it working on my bike, I could probably get something working pretty quickly, but it would
be quite hacky and may not hold up in normal wear and tear. Have the remote and back light be pretty much as is, with 9V battery, and do a 3D printout to get to a functional prototype that may or may not actually stay working on my bike. I think to really do this option with any success, I would have to layout the circuit and get it manufactured.

Option 3) Just off the top of my head, here are a few things I would need to do to move on to 3):
- Optimize the lights for the fewest/cheapest/and to a more efficient layout. Test the optimized version before drawing up a schematic to get printed. Add additional functionality for a front light. If possible add functionality for a plug in capable module setup for both front and back lights. Also, rechargeable batteries would be necessary. Finally, having some motion activation would be nice to have.

All this said, I think I am going to move forward on laying out what I have done so far. A good and newer looking circuit layout web-only product is https://upverter.com….I have started laying out things ther There is of course tons of industry-standard or using software such as Eagle CAD.

Posted in Arduino | Leave a comment