Bluetooth communication

Started by rufsiany_sr, April 02, 2022, 11:23:03 AM

rufsiany_sr

In the previous post I described my attempts to upgrade the firmware to version 3, which were finally successful.
Here is a summary of my attempts to install the BT module to the Current Ranger, which unfortunately failed.
1. I could not program any of the HC-06 modules I have to 230,400 baud. The highest possible speed was 115,200, which BTW. is in line with what I found on the Internet, in majority of posts from people who tried to do it (although it is theoretically possible and was possible with Felix's modules). Since CR expects HC-06 to have 230,400, obviously a module with a different speed is not detected and the command "b" from the console displays the message:
"BT Module not found: cannot enable logging".
2. As I also have a some HC-05s, I tried to use them. Unfortunately, CR sends the "AT" command without "\ r \ n" (line 255 in CurrentRanger_R3.ino) or just "\ r \ n" (line 270) and the HC-05 module is also not recognized.

Questions to Felix: (a) could you recommend reliable source of HC-06 modules programmable up to 230 400 or (b) to modify the firmware by reducing speed to 115,200 for ubiquitus HC-06 or (c) modify it to accept the HC-05. HC-05 can reach 230,400 without any problem. I understand there would still be problems with pressing the button at startup to make HC-05 in AT command mode and maybe other commands to get 05 into slave data mode after initial initialization. So it wouldn't be so easy as the speed reduction for HC-06, although speed is of primary importance.

And the last, but not the least:
If I modify the firmware myself and something goes wrong (there will be no communication via the console), will I be able to put the CR into the bootloader mode to revert to the official version?

Felix

You could try mod the firmware to look for 115200 or whatever baud of that module. But some may come default to 19200 or 38400 and then you're back at not being able to reprogram them and 19200 is uber slow for anything useful.

As far as a "reliable" source ...  ::) :'( ???  ... These are just very generic, probably made by a ton of different china sweat shoppes with a million variants and quite frankly they seem like an afterthought. You'd be better off just using a USB isolator to achieve the same thing but easier and much higher speed.

To mod the firmware, be careful  :)
First backup the old CURRENT.UF2 first (this will save firmware and settings so you can drop it back on the flash drive emulated by the bootloader if anything goes wrong), then attempt to reprogram with your new compiled firmware. More details here: https://lowpowerlab.com/guide/currentranger/programming-firmware-updates/

Mike G

I hope this may help someone, somewhere..... I have an HC-06 which needs the return and line feed after the AT to initiate the OK reply. I set the baud rate by connecting through a serial adapter to the PC and was able to change to 230400 baud and initiate the OK respons from the terminal, along with name and type. Connecting to the CR the BT module was not recognised, after a bit of checking with a logic analyser it seems that once the CR has sent the first AT request this causes the HC-06 to go into some sort of "lock up" and thus cannot respond to the next AT request even though this has the line feed and CR commands. In the end I removed the AT commands without the r and n from the sketch and things work fine now. I also added the feature to cycle through the auto off functions by touching all three touchpads simultaneously, I find this useful when the PC is not connected. Mike G