Saturday, 27 April 2019

Micro:bits and Eddystone URL beacons, together with App Lab

An idea for something amusing to do would be for students to use uBits to broadcast URLs as Eddystone beacons (read by the Physical Web app) and then have those URLs go to a number of apps that are built using App Lab from code.org.

Example uBit BLE Eddystone beacon code

Create simple(-ish!) apps using App Lab
The apps can be downloaded as a complete zip file and installed on a local machine, thereby removing the need to go outside the school environment once you've created the app.

Update

I've tried the download/install on my local machine out. It works. However

  • I also made it data-driven, using the Data facilities provided, which are based on stashing the data in the Cloud of Code.org. That works ok, in fact, I was able to alter the app's text display by changing the online data, just like you'd hope...
  • I cannot yet find a way yo make the code able to look at the source URL and thus change its behaviours using URL parameters. It doesn't seem to find the Document object, and thus enable access to its properties. That means for different rooms I need a whole different install, even if the only change is the Room ID, which drives the data lookups. Damn.
Further Update (02 Oct 2022)

This is now completely broken, because Google withdrew the Eddystone API etc., the microbit DAL function advertiseURL() is also deprecated, and the microbit Bluetooth extension no longer contains the relevant functions. Bum.