A lot of work has gone in to making sure I know what concept/parameters I’m working with before jumping into the hardware. I should have started before now, but I also know if I would have started even a few days ago I would have been going about things all wrong. Luckily a lot of that stuff is out of the way so I can jump into production with the time I have left.
I’m using the PodBreakout board with the Arduino to control the audio. This means I’ll be sending data via serial (won’t need all 30 pins, just 3 or 4) with the Apple Accessory Protocol. This hasn’t really been done yet as far as I can tell, but there’s enough info about both that I think I can piece it together. The Xbee will also be speaking to the Arduino with serial TX/RX so I’m using ladyada’s afsoftserial (instead of Arduino’s softserial) to give me an extra serial port.
First I’m working on getting the iPod to work, then the xbee, then smash them together. Elegantly.
After 7 hours of work over 2 days I find out that the pins on the iPod Breakout board aren’t really how they’re labeled. Not only that, but there’s about 6 different ways they may be labeled. Seriously frustrating…
How the pins are labeled:
2 4 6 8 10 12 14 16 18 20 22 24 26 28 30 1 3 5 7 9 11 13 15 17 19 21 23 25 27 29
Information on the Dock Connector and all the options I have to deal with.
I don’t have a lot of time to piddle around, so my plan is to try switching the pins and working on this part of the project for a couple hours, and if nothing comes of that drop it and get to work on the XBees. I may end up having to use Daisy MP3 players that won’t have the functionality I want but at least get some sound working. Todd Holobeck has used the Daisy before with Arduino, unlike anybody with the new PodBreakout boards I’m trying to use, so they’re a good back-up. The problem is they’re $115 a piece. My other option is something like the Anykits modules, but they don’t have much recording time at all (60 secs). Lots cheaper thought ($16). A third solution Corey Menscher and I just came up with is using three USB FM transmitters connected to a computer that changes the tracks based on the incoming RSSI readings and the 3 separate bags always being tuned to those FM frequencies.
Okay, the pin switching didn’t help… yet. I’m in convo with Rosie Daniel about her project last year with using the old iPod Remote, waiting to talk to Rob and Tom, and I may be missing something entirely about sending info over TX/RX, so I’m taking a break from this and going on to XBee. First up, setting up the XBees.
Yesterday I got fed up with trying to get the XBees set up and working with Tom’s RSSI Processing app and spent another 4 hours today doing the same. I finally got down to the very basics, set up the XBees using the mini USB-to-Serial FTDI chip, and found out that of the 6 XBee Pros that I have only one is currently working and both of the regular XBees are working fine (although none with Digi’s X-CTU utility application. I’m seeing Rob Faludi (all hail the master of XBees) tomorrow, hopefully we can figure out what’s going on there.
After stripping down to two working XBees I was able to get the Processing app to work.
After that was working I set up the third to an Arduino and got it working with the code from Daniel Liss. This code uses 3 digital outs to light LEDs based on the same RSSI packet that Processing is reading.
Now I have three working with the Processing app. This means at the very least I can respond to two (and probably 3) XBee’s RSSI with the computer and with digital/PWM out from the Arduino’s, but so far no luck on being able to play music on the wireless nodes.
I’ve received word back from Mike Down at Kineteka Systems (creators of the PodBreakout board) and he insures me the pinouts match with the labeling on pinouts.ru. I ran a test he suggested to make sure the iPod isn’t fried (”take a vom and measure between pin 1 and pin 18 on an ipod color that is turned on you will read about 3.3v. The ipods serial communication pins are TTL meaning, if you hooked your PC serial port as is to your ipod you may have damaged the ipod”) and it came back just fine. I’m meeting with TIgoe tomorrow, hopefully we can figure this thing out.
My meeting with Rob went quickly and really well - he took a couple of the new XBee Pros that I got in the mail last week and took them off to his office to test out, and come to find out all of the new XBees come with upgraded firmware set to a default baud rate of 115200 instead of the old 9600. I would have never known, but apparently people have been complaining for a while for Digi to do this, and this is the first batch.
Right before meeting with Rob about my non-working XBee Pros I was able to talk to Jeff (the adjunct professor for Sensor Workshop) and he gave a quick glance at the iPod Breakout board. He got me in the right direction with making sure I had a common serial ground and was using a step down resistor for the RX line from Arduino (the pin labels are not reversed as I considered). I’m still having some issues with the code or perhaps the exact resistance neeeded (when the play button is pushed it’s on a time delay and the volume goes up/down for some reason), but it works!!! It’s always a great feeling to have hours and hours of work pay off.
A huge day! iPod communication over Arduino using PodBreakout v1.2 = success. XBee Pros working = success. I’ve also started to put together a structured string for parsing in Arduino. Right now using an eight number sequence I can use cases or if statements more effectively to know how to play the appropriate audio. My next step is to take out the button on the Arduino/iPod combo and then add in an XBee using AF SoftSerial (ladyada’s version of Arduino’s software serial).
later that night…
Instead of letting a good thing pass I stayed on it with the iPod. I have the button out of the system, a few extra commands (like next and prev album) working on functioned timers, and got AF SoftSerial to work with no problems at all. I’m still trying to decide the best way to deal with all of the data that will be coming in, but I should have no problems connecting the XBees into this system tomorrow.
I’m managing to strip out all of the extraneous parts of the Arduino/XBee wiring and gotten it all the way down to just the RX/TX pins! No resistor between accessory pin and ground, not even grounding the serial. I’m not even reading from the iPod, so if I wanted to I could go all the way down to just the TX pin from Arduino to the RX pin of the breakout board. I have no idea how this is suddenly working (perhaps it’s because I’m sending out using AF SoftSerial and not the Arduino’s RX/TX pins. No matter though, it’s now the very most minimal set-up.
I’ve written a couple functions for fading in and out that use looped volume up/down commands with time delays. This will come in really handy when changing between tracks/albums.
When working with albums; I found I can use the previous album command multiple times to go back to the first album in the iPod library. This way I don’t have to worry about the iPod going out of synch with the Arduino (trying to store a variable of the current album number/name). The functions will go to the first album available by using a loop of previous album commands and then use the next album command to set the iPod as needed.
Using battery with 2 AA’s and step up to 5V into Arduino, then 3.3V out to XBee.
Able to get the set working together. Still timing issues.
I’ve decided I’m going to put in a “start bitching/stop bitching” switch. I’ve been trying to find a good way to have the headphones work in to the piece, it’s really been difficult - I finally found retractable earbud headphones at J&R, but they don’t work all that well. I then went to ACE Hardware and picked up some grommets, but they’re really small and not even the 1/8” headphone jack can fit through. Luckily, I was talking to Steve Litt last night and when I talked about the user experience, and having to wear headphones, he understood that to mean there was a headphone jack on the outside of the bag you can plug your own headphones into. Great thinking! Now the plan is to just take make an extension cord from the iPod in the project box to the side of the bag and have the female end on the outside. Done and done.
Here was another rubber grommet I was looking at from McMaster Carr before talking to Steve Litt.