Control Hexabitz modules from a smartphone app using Bluetooth

Similar projects worth following
This demo project introduces Hexabitz Bluetooth/BLE module (H23R10) and a demo Android App used to control a variety of arrays. You can easily control different shapes and types of arrays by changing the ID of modules your are talking with. The app and BLE module will set you up for success on your IoT and home automation projects! We will also demo, step-by-step, the process to update smartBASIC scripts running on the embedded BT900 module in case you want to write your own scripts

Smartphone Control of Hexabitz Modules

Controlling your projects from a smartphone is an awesome feature that you can easily add with Hexabitz H23R10 Bluetooth/BLE module. We built a really simple Android app to control few modules -nothing fancy- so that anyone can take the app and morph it to her own needs. The app source code is available here. H23Rx module source code is available here as well.

The app has multiple tabs, one for example controls the H01R00 RGB LED module via color picker, RGB sliders and toggle buttons:

Another tab controls the solid state relay module (H0FR60) via toggle buttons and a timeout timer: 

We will add more tabs with time to control and read signals from other modules. There's also a future plan for an iOS demo app as well.

Each tab features a textbox for module ID so that you can easily control different array shapes. Just build the array, run exploration CLI command and then enter the module ID in the app and start the action. 

Android Application Implementation


  • Updating H23R10 Module smartBASIC Scripts

    Hexabitz09/09/2018 at 04:19 0 comments

    Using UwTerminalX and an Array Port

    H23R10 module is based on Laird BT900 dual-mode Bluetooth/BLE V4 module which runs special scripts called smartBASIC. These scripts control the BT900 module internal operations.  Check these documents for more details about this scripting language (smartBasic core and extensions).

    Here's a step-by-step guide to update smartBASIC scripts on H23R10 modules:

    1. Load the latest firmware on H23R10 module. Check this article for firmware update instructions.
    2. Connect to H23R10 module CLI from any array port and delete the current smartBasic script by typing the following command:

      And then reboot the H23R10 module. You should see a solid green LED if the script was deleted successfully.

    3. If you already have a pre-compiled smartBasic script (binary .uwc file), skip to step 4. If not, navigate to this website to compile it online. Choose the appropriate smartBasic source code (.sb file). Select BT900 device from the list and as firmware version. Then click XCompile. The webpage generates and downloads a .uwc file, which is the binary smartBasic script. 
    4. Download the UwTerminalX tool from Laird website. Click Accept if you get the help screen. Setup both Config and Terminal tabs as shown in the picture below. Make sure you set Baudrate to 115200, Handshaking to None and uncheck all RTS, DTR, BREAK, LoalEcho and LinMode options.

    5. Using the CLI and your favorite terminal software, connect to H23R10 module again (using any array port) and type in the following command 

      >bt-download-script uart                                                        
      Downloading new smartBASIC program to BT900 via UART. Please set baudrate to 115200 then open this port again and load the smartBASIC file   
    6. Close this port from your terminal software.

    7. In UwTerminalX, click OK on Config tab, it will switch to Terminal tab and open the port. Right click and choose Load and choose your compiled smartBasic script (.uwc file). The file will be sent to the BT900 script. There's 30 seconds timeout between entering the bt-download-script CLI command and finish sending the script file via UwTerminalX 

    8. Reboot the H23R10 module again and you should see a bright green LED blink and then the LED turns off meaning a smartBasic script is running successfully.

    Updating Over-the-Air (OTA)

View project log

Enjoy this project?



Similar Projects

Does this project spark your interest?

Become a member to follow this project and never miss any updates