I’m trying to control the on-off state of the Bluetooth Bee I’m using. I’ve tied it to the state of the solar panel by getting the charge state - basically, if the panel is charging it’s daylight so turn the Bluetooth Bee ‘on’ and configure to be inquirable - which means that if the charge state is anything other than “charging” turn the Bluetooth Bee “off” - so far so good, except for turning the little beast back on.
Because this has to be in the loop I need to base the call to the bluetooth configuration on the current state of the bluetooth bee - and that’s where “+BTSTA:xx” comes in. It’s supposed to return the current state of the Bee as a two digit pair.
\r\n+BTSTA:xx\r\n xx status: 0, Initializing 1, Ready 2, Inquiring 3, Connecting 4, Connected
Meaning that if you get back: 11, the BT Bee is “ready” and 14 means it’s connected.
I’m trying to write code that looks at the state of the BT bee and if it’s not connected and / or not ready then initialize it. This is on the theory that even inside the loop the state of the external device will allow conditional logic to work - (insert laughter here)
So, why does “+BTSTA:xx” only ever return 13 to me when the LEDs on the BT Bee clearly indicate that it’s not connecting - that it’s ready (inquirable) and not paired (connected)?