Make Controller, mchelper 2.0 and /serial/ Issues

02 Oct 2007

I've been attempting to hook up a serial GPS device to my Make Controller and read in data using OSC commands from mchelper prior to interfacing it with AS3 (as an aside, it's really nice to be able to do this with the new version of mchelper). While I've been able to write to the serial port successfully using both /serial/char and /serial/block, reading from it always yields some sort of disaster. Initially I thought that perhaps the level shifter was not functioning properly. However, checking it out with a multimeter I found it to be otherwise. Then, I verified that the level shifter was indeed reversing TX/RX as it does, and it was indeed. I then connected the GPS device directly to my computer using a RS232/USB converter and was successfully able to read the serial data, so that eliminated the actual GPS receiver as the problem. Checking on those things seemed to eliminate what I figured were circuit or hardware problems, which left only the Make Controller and mchelper as the issue.

So here are a couple use cases where I run into issues:

Attempting to set the baud rate using /serial/baud 4800 is apparently successful, until I type in /serial/baud to return the value and it is inexplicably set to 4828!? Any other number that I pick at random results in it being set correctly. I have no idea what to make of this behavior.

As an additional problem, when I type in /serial/readable I receive a value of 1048760. If I then enter /serial/block to attempt to read that data, mchelper crashes [Exception: EXCBADACCESS (0x0001) Codes: KERNPROTECTIONFAILURE (0x0002) at 0x00000000)]. If I then try /serial/block 128 (or any other int), then I get a /serial/error Bad Data response.

Note: I posted the above to the MakingThings forum last night, and Liam promptly responded that this is indeed a problem with mchelper 2.0 and its implementation of OSC blobs that are returned by /serial/block. As for the incorrect baud rate issue, he's not quite sure, but hopefully that will be resolved soon as well. I'll be posting some how-to articles on bidirectional serial communication and using GPS devices with the Make Controller, OSC and AS3 once those bugs get straightened out.