This project uses the Web Bluetooth API and balena to control Bluetooth Low Energy (BLE) devices remotely from a browser.
- A balenaOS supported device with BLE e.g Raspberry Pi 3A+/3B/3B+/Zero W/4B
- An SD card
- Power supply
- LED
- Resistor (above 50 Ohms, advisable to include for long test sessions)
- A computer, laptop, or Android smartphone with BLE running the latest Chrome web browser
- A push button
- Breadboard to add ease to this test build (optional)
- balenaEtcher to write balenaOS to SD card
- A free balenaCloud account to set up and manage the Pi
- A download of this project
- Download and install balena CLI tools, which allows you to install the project code on your device
Refer to the step by step walkthrough in the blog post.
This project can be used as a reference for developing your own solution.
-
The
utils
directory containscharacteristics
andservices
relevant to the Bluetooth device we created. Feel free to explore the bleno API and experiment with other BLE properties and characteristics to make your own custom BLE peripheral device. -
ble-client.js
contains code for connecting your browser(the client) to your bluetooth device. -
index.html
is the UI for the client. The UI is being hosted on GitHub pages. You can choose your own solution.
This project uses the bleno library to create a BLE peripheral device.