Bluetooth serial bridge
Want to make a serial connection between two microcontrollers using bluetooth.
Started looking at stuff but seems need a Master and not clear how to do that...
But, maybe am starting to like AI because google tells me about HC-05.
Seems this thing can be master or slave.
Looks like very simple connections too.
<$10 on Amazon. Seems like easy way to go.
Appears code is mostly for Arduino, but that's easy to adapt for Propeller...
Comments
I've used the HC-0x modules as receivers on P1s many times, usually controlled through a terminal app on my phone. The attached picture shows a mini "Stranger Things" wall I made with WS2811 Christmas lights. I made a little BT app for my Android phone using MIT App Inventor that allowed me to control the lights with a P1. Mostly I'd ask a customer who was visiting the booth their name, type it in, and the P1 would spell out their name on the lights. It was a big hit.
From a code standpoint, it was just a serial connection on the P1 side.
I went through old parts boxes and found an HC-05 and cleaned up the attached terminal program which can be used to set-up your HC-05s. The only drag is that you have to push a button on them while applying power to get them into command mode.
Although I don't do Arduino, I decided to use it to turn ESP32s into Bluetooth modules. It was a piece of cake, all I had to do was redirect the BT to the UART.
I believe that Random Nerd Tutorials helped me figure it out. You could also use the ESP32 as an I/O expander.
I am experimenting with a "bridge" using ESP-01 modules with ESP-NOW (very early stages), but this may be of interest to Ray as it can be used like the HC-05 BT, but unlike the HC-05, using ESP-NOW you can go 1-to-1, or 1-to-many.
I'm not an Arduino guy, either, but I have found useful information on that site.
Yeah I have been following ESP-NOW and it's exciting stuff.
Some of the round trip latencies that I have seen are ludicrously low.
Great Scott has a neat YouTube video, comparing with other technologies.
A great way to get a feel for the ESP32 capabilities is to load up Annex32. It's a BASIC interpreter but darn, there isn't much that they don't cover.
They show examples of mixing ESP32 and ESP8266 on ESP-NOW.
Only for non-commercial use though.
Haven't heard of ESP-NOW, have to check that out...
HC-05 are $10 each on Amazon though.. Hard to beat that..
Just noticed HC-06. Have to see if that's any better....
Took a peek at ESP-Now... Looks like any ESP32 bluetooth module will work?
Guess this is just software... These are 2 for $10, guess that is better.
But, coding looks more difficult. Have to actually program the device...
ESP-NOW is also part of the ESP8266 which is why I'm using the ESP-01S (latest with larger flash). You can get them for < $3 each:
-- https://www.amazon.com/10Gtek-ESP8266-ESP-01S-WiFi-Module/dp/B09J2KPHTN
Over lunch I loaded MicroPython into a couple of ESP-01S modules with this:
-- https://www.amazon.com/Stemedu-ESP8266-Adapter-Programmer-Downloader/dp/B097SZMK2W
I have tried a couple of other devices, but this is the only one that seemed to work without issues.
I used esptool.exe from the command line to erase the flash and install MicroPython -- was a non-brainer, and was recognized by Thonny as soon as I opened the editor. Of course, you can also program the ESP-01S using the Arduino IDE if you prefer C. A good friend of mine has a network of ESPs around his home (out in the woods), and he was the one who suggested ESP-NOW when I told him what I want to do.
The HC-06 is slave only, so it may not work in a bridge type app.
I like his videos; they're always educational.
Yup, HC-05 is master/slave, HC-06 is slave only.
I have had a HC-05 bridge setup and it really is just like having a wire link between UARTs. IIRC, I didn't get auto-reconnect working but it was only a quick experiment.
Bluetooth was actually designed for industrial use and has built-in error checking.
My HMIs have been Android tablets since 2012 and they are rock solid. My environment is lots of metal and lots of EMR. I have literally never had a glitch.
Because my tablet is only HMI, once the machine is running, it can be removed from the area. Pretty cool to bring the tablet back in to range and see the machine data suddenly start updating.
Where I am atm, the client is connected to the tablet via factory WiFi which allows him to create a new program at his PC and send it over but he prefers to walk out to the machine and bring the device back to his office because the HMI touchscreen is more convenient than his mouse/keyboard.
I posit that; all that anything needs anymore is not a dedicated HMI but something like a HC-05. Our phones and tablets are the most powerful HMIs ever created. The reason I get to replace perfectly good control systems is because the old dedicated HMI (the most abused element) has died and replacing it is no longer possible.
@Rayman
Came to fire-up the Arduino IDE and it was gone
No reason for me to uninstall...probably a senior moment 
Anyway, the above is at least similar to what I did.