Shellminator V3.0.1
Simple Terminal
|
Bluetooth Low Energy (BLE) is becoming increasingly popular in the world of IoT. It’s a fantastic solution for devices that need to run on battery power for extended periods, making it ideal for sensors, for example. However, one challenge with these gadgets is that they are often deployed in the field, installed in their final location, and after that, not a single wire can stick out of them. This makes configuring them—and potentially modifying their settings later on—quite difficult.
A common feature of these devices is that they usually have at least one button. This is great because with a specific button sequence, they can be switched into configuration mode. Since we also love BLE devices, we created a class that enables all BLE-capable ESP32 boards and Arduino boards supported by ArduinoBLE to run a terminal in configuration mode.
However, it's important to note that hosting a terminal in config mode significantly reduces battery life on such devices. So, we strongly recommend using this feature only in rare cases—maybe once or twice a year at most.
Just like the Web Terminal, we’ve also created a BLE Terminal, which you can find in the lower section of the left-side menu. Unfortunately, not all browsers support interaction with BLE devices. So far, Chrome and Edge have worked reasonably well for us. Firefox, on the other hand, blocks BLE and other external device interactions due to security concerns.
At this point, we’d also like to mention that running a BLE Terminal in an industrial or sensitive environment should be carefully considered, as we cannot take responsibility for any issues that arise.
Both Chrome and Edge will only allow this feature if the Experimental Web Platform features setting is enabled. You can do that at: chrome://flags/#enable-experimental-web-platform-features
Once enabled, you’ll gain access to the browser’s Bluetooth module, which is available at: chrome://bluetooth-internals/#adapter
It's important to keep in mind that the BLE API used by browsers is still under development and may change over time. If you experience issues with the BLE Terminal, it might be due to a recent browser update that modified the BLE API. In that case, please report it as an issue.
Now that we’ve clarified everything, let’s dive in! This implementation is very similar to the WebSocket version, with a few differences.
First, you’ll need the Shellminator BLE software package:
Then, create an object from the ShellminatorBleStream
class:
From this point on, usage is the same as in the WebSocket implementation, but there are some performance differences. BLE was not designed for continuous, high-speed data transfer, so you won’t get the same smooth experience as with other communication methods.
Additionally:
help
might not arrive fully. When using BLE, it’s best to stick to short setter-getter commands. Keep in mind that data loss can happen at any time, so plan accordingly.