Gumstix RFCOMM
Before I start the main post, I finally have a decent pic of one of the sensor boards I created. There are a couple more chips on the bottom as well, not shown.
Now, onto the post proper. I recently had to set up a Gumstix device (in this case an old Connex 400xm-bt with an Audiostix2 expansion) to grab readings from a sensor. The sensor used a serial connection over Bluetooth’s rfcomm. I wrote my application to open and read from /dev/rfcomm0 and tested it on the PC, everything worked fine (almost) first time. The only setup that had to be done was
rfcomm bind 0 <device address> 1
though the trailing 1 is optional for the most part. I cross-compiled the code and moved it onto the Connex, whereupon I got a load of errors. The channel being in use/busy, and permission denied opening the serial device were the more common ones that popped up. It is certainly an odd experience getting permission denied when you’re root… Anyway, after googling on the matter I discovered something that should really have been obvious: rfcomm0 is reserved for creating a serial connection to the Connex for the purpose of a remote shell. I quickly switched over to rfcomm1 and everything was happy.
There you go, a simple but very annoying problem with a quick but not initially obvious fix. Hope this saves someone half an hour of their life.