We're using the Adafruit Bluefruit LE Friend in command mode on a Raspberry PI.
On the Linux OS, the standard cp210x kernel driver is used, and we're using Pi4J serial module to communicate with the Adafruit Bluefruit LE Friend
Our software consists of a run loop (executed roughly every 350ms) where we constantly execute one or more of the following commands
- check for bluetooth connections on the device (AT+GAPGETCONN)
set advertisement data (AT+GAPSETADVDATA)
read / write characteristics (AT+GATTCHAR=1 or AT+GATTCHAR=1,)
stop advertisement (AT+GAPSTOPADV)
When we have the issue, after shutting down our software, we verify this using minicom and indeed see that no commands can be sent to the device. (only 1 of the 2 RX/TX leds blink).
This happens sometimes after 2 days, and sometimes after 3 minutes. The only remedy is to reboot the raspberry pi or remove / re-insert the Adafruit Bluefruit LE Friend
Any idea what might be causing this and where to start looking for a solution ? I don't see any "garbage" being sent over the wire, and before it happens most AT commands result in an OK. (there are some occasions where AT+GAPSTOPADV responds with an ERROR, most likely because it had already stopped advertising