What causes bluetooth send trampling of one command over another?

The AI2 Bluetooth Client has a Receive Bytes block, which would receive a list of bytes values (0-255), which could be converted to text strings of 1s and 0s to show their bits.

But you already know it's the sixth bit of a byte that changes.

Is there a constancy to where in memory that byte is?
Or does its address change according to some pattern, like an array whose element size can be deduced from where it drops its residue?

But what kind of data element would reside in only one bit of a bytes?
That's really low level coding.

The last time I used those settings was pre-Internet, where I would keep lists of phone numbers to dial into to access bulletin board systems, each having their own preferred settings for the serial communication stream (a modem). The effect of setting the modem wrong was to see garbage letters on the screen.

I don't see much discussion of those bits these days, because software libraries handle this at low levels, and the Internet protocol stack hides all this. I have seen no reference to any of this in AI2 docs for the BlueTooth or Serial components.

What's worse, there is no pattern that I can see to when that 6th bit flips to 1 or to 0. It's not like a cosmic ray hit your RAM and burned out a bit, forcing a permanent 0 or 1.

I'm stumped.

If you can afford it, try some new hardware, or switch to BLE, which sounds similar but I am told is quite different.

Dear @gte, I've given only a very quick look to this thread, since I'm out for vacation, but I would suggest you a couple of things.
First of all, what Arduino bard are you using ? I see that your BT line is on Serial1: does this mean that you use a board with several Serial Lines, like the Mega ?
When I use the Mega board, the typical baudrate toward the HC05 that I use is 115200, without problems. For sure I've never changed Start/Stop/Parity bits as they worked fine as default. I see that you receive characters and with them you compose a string, then you work on strings: is this really necessary ? As Chris has already said, the less you transmit the lower is the possibility of error. One, trivial, test that you can do, is to print on the serial monitor of Arduino each character, as soon as it is received, instead of printing the whole string at the end. This is to be sure that the character (always the 6th ?) arrives already corrupted or it is a matter of some other conversion.

1 Like

The received bytes are all stored in the same variable over and over again. I'm not sure if the address is the same every time, I can try to figure out how to write that to the screen.

If a different bluetooth hardware device will fix this, I'm certainly willing to use it. I guess ai2 negotiates that during the connection, it is configurable on the hc05.

I am using the mega. I have shortened the strings down as much as possible with me still (most of the time) knowing what they mean. I will make make them one or two characters as a last resort, however I need to be able to troubleshoot the code reasonably as well and I'm trying to find that balance before I give up on that and make it much harder on myself for the sake of chasing down this 6th bit error. I'm sure Chris's approach is ideal and I acknowledge that.

I will will try try the one character at a time screen print, that's a good idea.

A suggestion from the Arduino board is that two objects are trying to use the same memory location. I'm considering that possibility as well.