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.
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.
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.
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”.
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.
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:.
1 |
sudo snap install mqttx |
Let’s make a new connection with the beta test server from GL.inet at “iot-s10-test.gl-inet.cn” on port 1884.
The same test server is also used in the Android app, but with the IP address (134.175.4.252) instead of a URL.
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…
and add a new subscription to GL-IoT/rspTopic/<GL-S10 MAC> to receive responses to MQTT commands I may send.
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.
But what happened here is that the IP address of the test version had changed:
1 2 3 |
ping iot-s10-test.gl-inet.cn PING iot-s10-test.gl-inet.cn (167.172.193.67) 56(84) bytes of data. 64 bytes from 167.172.193.67 (167.172.193.67): icmp_seq=1 ttl=47 time=362 ms |
After changing the settings in the android app with the new 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.
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.
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.
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:
1 2 3 4 5 6 7 8 9 10 |
{ "jsonrpc": "2.0", "method": "SET_WIFI_CONFIG", "params": { "type":0, "ssid": "LPT Maker", "pwd": "password" }, "id": 1 } |
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:
1 2 3 4 5 |
{ "jsonrpc": "2.0", "result": 0, "id": 1 } |
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:
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.
The data looks as follows:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 |
{ "dev_wifi_sta_mac": "E8DB841D7388", "dev_ble_mac": "E8DB841D738A", "dev_sn": "32d1e73977ae85e2", "dev_id": "E8d7388", "dev_version": "2.3.1", "dev_list": [ { "mac": "D896E08B7E29", "rssi": -43, "ad": "0201061AFF4C0002151732050807568877293527446341505900014B07C51816C0DE0200014B070400000000000000000000000022F70C", "ts": 18446744072867391000 }, { "mac": "D896E08B7E29", "rssi": -45, "ad": "0201061AFF4C0002151732050807568877293527446341505900014B07C51816C0DE0200014B070400000000000000000000000022F70C", "ts": 18446744072867394000 } ], "dev_list_len": 2, "publish_ts": 18446744072867394000 } |
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):
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 |
{ "dev_wifi_sta_mac": "E8DB841D7388", "dev_ble_mac": "E8DB841D738A", "dev_sn": "32d1e73977ae85e2", "dev_id": "E8d7388", "dev_version": "2.3.1", "dev_list": [ { "mac": "D896E08B7E29", "rssi": -65, "ad": "0201061AFF4C0002151732050807568877293527446341505900014B07C51816C0DE0200014B070400000000000000000000000022F70C", "ts": 18446744072867475000 }, { "mac": "D896E08B7E29", "rssi": -65, "ad": "0201061AFF4C0002151732050807568877293527446341505900014B07C51816C0DE0200014B070400000000000000000000000022F70C", "ts": 18446744072867478000 } ], "dev_list_len": 2, "publish_ts": 18446744072867478000 } |
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:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 |
{ "dev_wifi_sta_mac": "E8DB841D7388", "dev_ble_mac": "E8DB841D738A", "dev_sn": "32d1e73977ae85e2", "dev_id": "E8d7388", "dev_version": "2.3.1", "dev_list": [ { "mac": "697E44B45AE0", "rssi": -68, "ad": "0201021107FC9DD0B3CB84E0840642F3F7E2E0BFCB", "ts": 18446744072868538000 }, { "mac": "D896E08B7E29", "rssi": -72, "ad": "0201061AFF4C0002151732050807568877293527446341505900014B07C51816C0DE0200014B070400000000000000000000000022F70C", "ts": 18446744072868538000 } ], "dev_list_len": 2, "publish_ts": 18446744072868538000 } |
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:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 |
{ "dev_wifi_sta_mac": "E8DB841D7388", "dev_ble_mac": "E8DB841D738A", "dev_sn": "32d1e73977ae85e2", "dev_id": "E8d7388", "dev_version": "2.3.1", "dev_list": [ { "mac": "EB5B4CBA55EE", "rssi": -81, "n": "Amazfit Bip Watch", "ad": "0201061BFF5701006E74DCD42A214DE1A8988A3FFA043C9E03EB5B4CBA55EE1209416D617A666974204269702057617463680302E0FE", "ts": 18446744072869593000 }, { "mac": "D896E08B7E29", "rssi": -70, "ad": "0201061AFF4C0002151732050807568877293527446341505900014B07C51816C0DE0200014B070400000000000000000000000022F70C", "ts": 18446744072869593000 } ], "dev_list_len": 2, "publish_ts": 18446744072869595000 } |
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.
Jean-Luc started CNX Software in 2010 as a part-time endeavor, before quitting his job as a software engineering manager, and starting to write daily news, and reviews full time later in 2011.
Support CNX Software! Donate via cryptocurrencies, become a Patron on Patreon, or purchase goods on Amazon or Aliexpress
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.
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.
I don’t see why Home Assistant would not recognize the MQTT packets.
I did the review in February 2022, I don’t think community firmware was available at the time.
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?
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.