Review of GL.inet GL-S10 BLE to MQTT gateway with MQTT X open-source client

I started the review of GL.inet GL-S10 BLE to MQTT gateway in December by doing an unboxing and a teardown of the ESP32 gateway and BLE beacon provided. I’ve now had to play with the device and recommended app and software, and it took longer than expected since I encountered several issues during testing, most of which should now be resolved with new firmware, and documentation will be updated very soon.

GL.inet GL-S10 review
BLE beacon, GL-S10 Tool App for Android, and GL-S10 gateway

I mostly followed the steps from the detailed user manual for this review. The first time I did was to install the GL-S10 Tool App for Android, then power the gateway while pressing its button to enter pairing mode and soon enough the gateway was detected.

GL-S10 Tool App Scan

Note you should probably not share the MAC address of your devices as there’s no security by default, and anybody would be able to access the information with the tools we’ll use below.

GL-S10 configure WiFi

You’ll be able to configure network settings like DHCP/FIxed IP and WiFi credentials, as well as MQTT server settings, and the time zone. I could connect to my WiFi access point without issues, but only for a short period of time until I get the message “Device Disconnected”.

GL-S10 device disconnected

This would now happen each time I enter pairing mode to configure the app, and I have less than one minute to do anything before the error. I tried to reset the gateway to factory settings by pressing the button for 10 seconds, and even clear the data and uninstall the app on my phone to try again but I had the same problem. After contacting the company and sharing the information, they determined the hardware might be faulty and sent another device.

Note that I was using a “4G LTE WiFi Modem” hotspot equipped with a SIM card with a 10 Mbps data plan. When I went back to my house with broadband internet, I tried again with the “old” GL-S10 gateway, and the problem disappeared… But it was not without trouble to connect the gateway to my router.

WPA WPA2-PSK

That’s because if your WiFi router is configured with “WPA WPA2-PSK” encryption method it will be shown greyed out because it’s not supported by GL-S10. Changing the settings in the WiFi router is the only solution. Even the latest firmware (v2.3.1) exhibits this behavior. Once this was solved I had a stable connection.

The next step was to install MQTT X MQTT 5.0 open-source desktop client available for Windows, Mac OS, and Linux operating systems. I installed it on my Ubuntu 20.04 laptop as a snap:.


 

MQTTX Ubuntu
Let’s make a new connection with the beta test server from GL.inet at “iot-s10-test.gl-inet.cn” on port 1884.
MQTTX-New-Connection GL.Inet Test Server

The same test server is also used in the Android app, but with the IP address (134.175.4.252) instead of a URL.

MQTT configuration

The MQTT configuration above also includes the Topic’s command and respond strings for the gateway, report configuration from the BLE devices with an RSSI threshold, and filter rules to only send relevant data. If no filter is selected information about other BLE devices will be sent as well as we’ll see below.

Back to MQTT X, I could connect easily to the GL.inet MQTT server…

MQTTX connection successfull

and add a new subscription to GL-IoT/rspTopic/<GL-S10 MAC> to receive responses to MQTT commands I may send.

MQTT X New Subscription

When sending a command using GL-IoT/comTopic/<GL-S10 MAC> with properly formatted JSON data, I never got a reply as if the gateway was offline.
MQTTX No Reponse

But what happened here is that the IP address of the test version had changed:


After changing the settings in the android app with the new IP address…

GL-S10 Tool App mqtt ip address

I still could not receive responses from topic commands, but after subscribing to GL-IoT/dataTopic/<GL-S10 Mac>, I received data from the BLE beacon every second as configured, something that did not work previously.

MQTT X data reporting BLE beacons

I was finally told that I may not have the latest firmware and was asked to upgrade to http://iot-s10-test.gl-inet.cn/s10/ota/gl_s10_v2.3.1.bin which had to manually type in the app before going ahead with the update.

GL-S10 OTA upgrade

The company reckons the online upgrade function is not the most user-friendly, but the rationale was to let the users upgrade their own firmware (since they can build their own), and they plan to streamline the upgrade steps in future versions. While it took a while to make it work, GL.inet was very helpful and responsive to my queries even during the Chinese New Year holidays.

So now that everything works let’s show it works. The GL-S10 Config API provides a list of commands that let the user basically do everything he/she can do in the mobile app through an MQTT client with JSON formatted commands. Let’s go with the commands to configure WiFi and retrieve WiFi credentials as those are the first two commands.

GL-S10 API SET_WIFI_CONFIG

After having created a new subscription with GL-IoT/rspTopic/<GL-S10 MAC>, let’s create a command (See bottom right section) with GL-IoT/comTopic/<GL-S10 MAC> and JSON data as follows:


When type is equal to 0, SSID, PASSWORD can be set, when equal to 1 SSID, USERNAME, USERPASSWORD can be set. ssid is the access point name p to 32 characters, pwd the password up to 64 characters, and id is the command number (0x01) for SET_WIFI_CONFIG.

If everything works we should receive the following JSON data as a reply:


0x00 represents execution success and 0x01 represents execution failure in the result field.

But we can send the GET_WIFI_CONFIG command to double-check:

GL-S10 API GET_WIFI_CONFIG

All good. As already mentioned you can also configure/check other gateway parameters with the API such as DHCP/Fixed IP, MQTT server, topics, timer intervals, Bluetooth filters, and so on.

Let’s turn on the BLE beacon provided with the GL-S10, add a new subscription to  GL-IoT/dataTopic/<GL-S10 MAC>, and receive data every second or whatever time interval configured in the app or through the MQTT client.

MQTT X BLE Beacon data

The data looks as follows:


The top is some information about the gateway, and the dev_list reports information about the BLE beacon including the MAC, RSSI, ad (Broadcast data advData ) and a timestamp. If the BLE beacon includes a name there will also be an “n” field with the data.

Here we have “two” devices, but that’s clearly our BLE beacon sending two messages. The RSSI is around -43 to -45 dBm with the beacon around five centimeters from the gateway. Let’s see what happens if I move the BLE beacon to around 9 meters from the gateway (line-of-sight):


The signal strength has dropped significantly to -65 dBm, and this type of data could help us estimate the distance from the gateway within a room, as with multiple beacons even the indoor location. I’ve done this with MAC filtering to only show data from the beacon. Let’s remove the MAC filtering:


There’s a new device with “697E44B45AE0” Bluetooth MAC. I can’t find the brand with a look-up, but yesterday, I noticed another device with MAC A4E22988ED6F which looks up to “Qingdao Haier Technology Co.,Ltd”. Hmm.. do I have any Haier devices in this house? Oh yes, this week I installed an air conditioner in the bedroom, and sure enough, there’s an open WiFi access point for the air conditioner as well. So my aircon is broadcasting BLE messages…

The gateway could be used as a (is my girlfriend at home?) tracking device… since it can track her Amazfit Bip Watch:


There would be more to test notably improved security with username, password, and SSL/TLS connection, but I’ve run out of time for this review.

I’d like to thank GL.inet for sending GL-S10 BLE to MQTT gateway for review. You can purchase it together with the beacon for $29.90 on GL.Inet store.

Share this:
FacebookTwitterHacker NewsSlashdotRedditLinkedInPinterestFlipboardMeWeLineEmailShare

Support CNX Software! Donate via cryptocurrencies, become a Patron on Patreon, or purchase goods on Amazon or Aliexpress

ROCK 5 ITX RK3588 mini-ITX motherboard

5 Replies to “Review of GL.inet GL-S10 BLE to MQTT gateway with MQTT X open-source client”

  1. Thanks for the review!
    I wish they start to sell it via Amazon, just like (most) of their other products, because shipping and customs is a deal breaker right now.

  2. Thanks for the write-up. Nice!
    I want to use this device as a BLE Proxy feeding into Home Assistant. Is this possible using your MQTT guide here? Would Home Assistant be able to recognize it – just like that?
    I see that some others recommend re-flashing the device (https://blakadder.com/gl-s10/)
    Why is it that you never mention that option ?

    Many thanks or your advice.

      1. Ok, thanks again.
        Now that the ESP community firmware is available, would you still recommend MQTT with the standard firmware, or could you see community firmware as a better option?

        1. It’s difficult for me to recommend anything because I only used it for the review. I’d say if the default firmware works well for you, then use it. If not, then flash ESPHome firmware.

Leave a Reply

Your email address will not be published. Required fields are marked *

Boardcon Rockchip and Allwinner SoM and SBC products
Boardcon Rockchip and Allwinner SoM and SBC products