Shop OBEX P1 Docs P2 Docs Learn Events
Testing HC-05 / HM-10 bluetooth modules — Parallax Forums

Testing HC-05 / HM-10 bluetooth modules

Was supposed to be just testing HC-05 bluetooth module, but just discovered that Apple devices do not allow the regular bluetooth from HC-05, only BLE from newer HM-10 modules.

So, ordered some HM-10, should come tomorrow...

In the meantime, dug up an Android tablet and installed an app called "BT Robot Controller". This has some buttons to move robot forward and back and such. Every time you push a button, a character will appear in PST window using this code.

Comments

  • RaymanRayman Posts: 16,427

    What I really want to do is use an app called "Mecanum Robot". This is in both apple and android stores. But, seems to only work with BLE :(

    So, well guessing putting this on hold until HM-10 modules show up :(

  • RaymanRayman Posts: 16,427
    edited 2026-05-25 17:15

    Got some HM-10 (AKA AT-09, MLT-BT05) modules today...

    Doesn't work with Mecanum Robot app, but does with app called "MicroBlue".
    Finally have some control with iPhone!
    MicroBlue seems workable and is also configurable, but really wanted Mecanum app to work...

    MicroBlue has some encoding for some reason that have to figure out, but can see text in PST, although it seems to include some control characters that move the text all over the place...
    Appears that serial has some kind of header, the payload, then some kind of trailer.

    Really easy to use though, just click the red bluetooth symbol, look for HC-05 (strange?) and connect. Bluetooth symbol turns blue.

    Guess I'll try robot with Microblue and if that doesn't work out... Maybe AI can make an app for me. Heard it can do that...

    Should mention that didn't have to enter a passcode to pair. Interesting...

  • RaymanRayman Posts: 16,427

    I'm thinking the Mecanum app is bound to some kind of ID on bluetooth module... I see the light on BT module change from blinking to solid, indicating connection, but then app seems to disconnect...

  • JonnyMacJonnyMac Posts: 9,829

    It's a shame that Mecanum Robot controller app doesn't work. I found one of those HM-10s in my parts bin and connected it. Was able to use the serial bridge to set the device name to ROBOT. My HM-10 shows up on the list and seems to connect (HM-10 LED goes solid), but I get a "failed connection" message and nothing comes through when pressing the buttons. Pity. If those MicroBit docs are accurate it looks like every widget/button corresponds to a single character which would make it easy to use.

    Holy smokes, that Microblue program sends a lot of bytes for one keypress! 25 for Up and for Right. 22 for Left and for Down.

    I really need to read reviews before paying for for unknown things from the AppStore. I found a little app called Bluetooth Terminal from Lukas Pistrol. It has a configurable 12-key pad -- for $6. I did it. It's not too hard to set up, though not very sexy. Note you can hide unused keys (I did; see image). I'm not sure it's worth the $6, but it does seem to work. Here's the output from my customized keypad using the attached program. It's setup to show one packet at a time. The last line is the timestamp, but I don't know how that's evaluated.

    For a real waste of time and money ($12 to unlock "everything") there is an app called Bluetooth for Arduino. What a piece of absolute garbage. I'd have been better off taking $12 out of my wallet and eating it. I've been dealing with a terrible headache all day and this made it worse. The gamepad, even after being setup doesn't work. The terminal does -- when it doesn't randomly disconnect from the device. Again, it's garbage -- don't waste your time or money.

    My friend Joshua wants to learn P1 programming via a remotely controlled robot, so I've been watching your posts with interest. We have a wireless PS2 controller attachment working, but it would be nice to get it to work from a phone, too.

  • JonnyMacJonnyMac Posts: 9,829
    edited 2026-05-26 01:22

    The AppStore recommended a program called Dabble that is supposed to work with HM-10s and ESP32s. It's free, and the Gamepad does work. It's sends out a lot of characters, but they seem be of fixed length -- at least in digital mode. Here's a capture of the gamepad buttons.

    Up        <FF><01><01><01><02><00><01><00><FF><01><01><01><02><00><00><00>
    Right     <FF><01><01><01><02><00><08><00><FF><01><01><01><02><00><00><00>
    Down      <FF><01><01><01><02><00><02><00><FF><01><01><01><02><00><00><00>
    Left      <FF><01><01><01><02><00><04><00><FF><01><01><01><02><00><00><00>
    Triangle  <FF><01><01><01><02><04><00><00><FF><01><01><01><02><00><00><00>
    Circle    <FF><01><01><01><02><08><00><00><FF><01><01><01><02><00><00><00>
    Cross X   <FF><01><01><01><02><10><00><00><FF><01><01><01><02><00><00><00>
    Square    <FF><01><01><01><02><20><00><00><FF><01><01><01><02><00><00><00>
    Start     <FF><01><01><01><02><01><00><00><FF><01><01><01><02><00><00><00>
    Select    <FF><01><01><01><02><02><00><00><FF><01><01><01><02><00><00><00>
    

    The analog mode spat out a lot more bytes, as did the accelerometer mode.

    There are aspects of this program that seem to need an ESP32 with specific code running it it. So far, this seems to be the best of the apps I looked at over the last hour.

    1284 x 2778 - 243K
  • RaymanRayman Posts: 16,427

    Can’t find any code for MicroBlue but found things for dabble on GitHub and here:

    https://ai.thestempedia.com/docs/dabble-app/led-brightness-control-module/

    That link has the arduino sketch that can presumably decode the input…

    Guess will use this if can’t decode microblue …

    Think will have to make custom app in future, doesn’t seem like should be too hard.

  • RaymanRayman Posts: 16,427
    edited 2026-05-26 16:16

    Think found code for microblue here:

    https://github.com/snappyxo/microblue-arduino

    Appears very simple… delimiters are just 1 2 and 3 with id between 1 and 2 and value between 2 and 3.

    Can also send data back using this protocol…

  • RaymanRayman Posts: 16,427
    edited 2026-05-26 12:33

    Ai says new hm-10 modules default to 115200 baud…

    Think I’ll change it to that, looks easy to do…

    Wait the app might be fixed to 9600? Not sure…. Maybe…

  • RaymanRayman Posts: 16,427

    Think have a handle on MicroBlue iPhone app now...
    The attached code receives and then displays data on PST.

    Not 100% sure the timeout code is good, but maybe it is...

    The buttons are interesting. It sends a message when pressed and another when released. Guess that could be useful...

  • RaymanRayman Posts: 16,427

    Found a slideshow on how to customize the app. Very useful!
    https://snappyxo.io/microblue/file/2ehP0spT3ZtAY96EuQmD

  • JonnyMacJonnyMac Posts: 9,829

    Think will have to make custom app in future, doesn’t seem like should be too hard.

    Agreed.

    The buttons are interesting. It sends a message when pressed and another when released. Guess that could be useful.

    I saw that with Dabble, too. In the screen shot above each line represents me doing a quick touch and release. Since iPhone screens are multi-touch, you can register more than one button at a time. Looking through their library the keep variable where each bit indicates the current state of a particular button.

  • This is a very recent development. No clue if it's of any interest. :)

  • RaymanRayman Posts: 16,427

    The adafruit bluefruit app looks interesting…. Could be useful

  • This PicoMiteBT is compatible with BT keyboards, mice, game-controllers, etc.

    On my Android device, I have the app "proxiOS" which emulates a keyboard and trackpad. Rock solid performance, thus far.

Sign In or Register to comment.