Discover and develop Bangle.js applications using Espruino, Bluetooth Low Energy and Pareto Anywhere open source IoT middleware.
Learn how to program a Bangle.js smart watch with existing applications, or develop your own.
A Bangle.js and, optionally, a Pareto Anywhere instance to make sense of the data
Browse to the Espruino IDE and connect using Web Bluetooth.
A web browser which supports Web Bluetooth
Many—but not all—modern browsers such as Chrome support Web Bluetooth by default. MDN maintains this list of browser compatibility should your preferred web browser fail to support Web Bluetooth by default.
Point a web browser to espruino.com/ide/ and observe the integrated development environment (IDE) as in the screenshot below.
Click on the Connect/Disconnect icon at top left, and then select Web Bluetooth from the popup.
Identify and select Bangle.js from the list of scanned devices, then click Pair.
If the desired Bangle.js does not appear, check the following:
If pairing is successful, the Connect/Disconnect icon at top left will turn green.
The Bangle.js can now be programmed wirelessly from the browser using Web Bluetooth, which is the subject of the next step.
Run a simple "Hello World!" JavaScript program on the Bangle.js.
From the Espruino IDE connected to the Bangle.js:
Copy Ctrl+C and paste Ctrl+V the following lines of code into the code editor window of the Espruino IDE:
// Display Hello World! g.clear(); g.setFont('Vector', 30); g.drawString("Hello World!"); // Transmit Bluetooth Low Energy advertising packets NRF.setAdvertising({}, { showName: false, manufacturer: 0x0590, manufacturerData: JSON.stringify({ name: "Bangle.js 2" }) });
Click on the Send to Espruino button in the centre toolbar, ensuring that the default option to write to RAM is selected.
A progress bar will appear in the bottom right corner followed by SENT in the bottom left corner of the IDE once the program upload completes.
The program will automatically execute and any console output, including error messages, may be observed in the area highlighted in the screenshot below.
The Bangle.js will immediately display Hello World!
The Bangle.js will not, however, transmit Bluetooth Low Energy advertising packets while it is connected. Click on the Connect/Disconnect icon at top left to disconnect from the Bangle.js.
If an instance of Pareto Anywhere is running, the Bangle.js should be discoverable by its Bluetooth Low Energy advertising packets which use the company code 0x0590 registered to Pur3 Ltd, the company which develops the Espruino open source firmware running on the Bangle.js as well as the web IDE we used to upload our "Hello World!" program.
Program execution can be stopped by a short button press followed by a long button press.
Explore the potential of the Bangle.js in context-aware physical spaces.
Load our Emojuino app from the Bangle.js App Loader and transmit emojis that can be displayed in Pareto Anywhere's Live Directory web app.
Load our SensiBLE app from the Bangle.js App Loader and transmit data from all sensors that can be observed in Pareto Anywhere's APIs and web apps.
Load our DirAct app from the Bangle.js App Loader and transmit real-time proximity interactions that can be observed in Pareto Anywhere's APIs and web apps.
See our Espruino Apps repository on GitHub for the latest available programs. More content to come!
Tutorial prepared with ♥ by jeffyactive.
You can reelyActive's open source efforts directly by contributing code & docs, collectively by sharing across your network, and commercially through our packages. We invite you to Gordon's work on Espruino with a donation too!Continue exploring our open architecture and all its applications.