Some follow-ups from my previous post about the Garmin Forerunner 205:
Based on some suggestions from Jonathan Wight and Daniel Jalkut, I was able to start having a conversation with my Forerunner over USB. Although IOKit will automatically swap bytes where necessary for all of its arguments (of course), it obviously doesn’t do that for any raw data - like Garmin protocol packets. (Seems obvious in hindsight - not sure why I thought otherwise!). So swapping some bytes here and there fixed the problem and I immediately starting getting responses back. I’ve only tried the two simplest requests - a start session request, and a product data request. I’m going to start over with a fresh project and write a small class so I can better handle Garmin’s more complex application protocols.
I also borrowed a windows laptop and installed Garmin’s TrainingCenter software just so I could take a look at some of the runs and rides that I’ve taken this week. It’s VERY cool to see your exact path on a map. Again, what a cool toy! However, I can’t say enough how shatty windows software is. From the installer through the main app, the experience is pretty poor. It’s unbelievable. But, I guess on a usability scale, it’s not that bad…. for Windows software. Since quitting my job several months ago, I haven’t had to use a Windows machine at all - and going back was painful. I don’t know what Garmin’s Mac version of TrainingCenter will look like, but with all the new, small, accurate, inexpensive GPS devices coming onto the market, I think this is an area that’s ripe for a good software solution.
In the meantime, I did quite a bit more research about Garmin products, USB, and IOKit. Here are links to some of what I found:
- Apple posted an excellent Q&A regarding USB development here. This mentions USB Prober, one of the Developer Tools Apple ships with Tiger. It also mentions the logging versions of Apple’s USB drivers. The logging version of the drivers aren’t a replacement for a true bus analyzer, but I plan to install them and see what kind of data I get.
- USB mailing list posting with xcellent general info about Apple’s USB implementation, with some Garmin specifics here. In particular, it answers a few of my earlier questions around how big a buffer I should attempt to read and whether ReadPipe or ReadPipeAsync will stall until the buffer is full when the Garmin sends data that is smaller than my buffer.
- Rumor has it that MotionBased.com plans to release a Mac agent for their service this week. I don’t know specifically what devices it will support, but they’ve said in the past that they plan to support all new USB devices going forward. Cool.
Update: MotionBased.com’s beta Mac client is available here. Make sure to note that data uploaded using this client goes to their test server and will be deleted at some point - so don’t put data here that you don’t have backed up elsewhere!
Keep at it! The USB Mailing list is great. The Apple guys are really responsive and smart about what to do next in most instances. The only drawback is they’ll remind you without hesitation that you need a bus analyzer
The Logging USB extension is cool, but beware that when you first try the USB Prober in logging mode, you may experience a bug which causes the system to panic. So don’t do it without saving all of your code.
Can you post about how you got the async callback to be called? Was it just that the buffer was too big?
Hey Greg-
As soon as the packet was valid (i.e. as soon as I switched multi-byte fields using HostToUSBxxx() methods), I immediately got a response.
-Blake
Data from the MotionBased Web Agent (Mac Agent) no longer goes to test server. Your data will NOT be deleted, and will always be available at MotionBased.
That’s great to hear, Mike!