Avatar for Pierre

Pierre

Member since Jul 2016 • Last active Jul 2016
  • 1 conversations
  • 9 comments

Most recent activity

  • in Interfacing
    Avatar for Pierre

    Just in case someone comes looking for the answer here. The video + write-up are available: Turn your BBC micro:bit into an Eddystone-URL beacon using Espruino

    • 3 comments
    • 3,042 views
  • in Interfacing
    Avatar for Pierre

    And it does. Both on iOS and Android. Thank you for "fixing" this (making this feature available)!
    I'll try to do a screencast (in English) explaining how things need to be setup tonight/tomorrow.

    Buying custom beacons probably is cheaper than using a micro:bit, but if a school has them available, this is at least a fun project to doe.

  • in Interfacing
    Avatar for Pierre

    So that would be a build newer than 27-Jul-2016 14:45 ?
    (newer than espruino_1v86.148_efm32ggstk.hex)

  • in Interfacing
    Avatar for Pierre

    p.s. I did create a new topic for this like you asked, but for now continuing here. Google Chrome on iOS is happy with it also and finds the beacon (see bottom right corner of the screen).

  • in Interfacing
    Avatar for Pierre

    Strange. Not on Android in Physical Web.But it shows up in Beacon Scanner now on Android! :)

  • in Interfacing
    Avatar for Pierre

    It just did on iOS though when I tested your code on my microbit....
    Checking Android..

  • in Interfacing
    Avatar for Pierre

    OK, I am not an expert on Eddystone beacons. I have got two ordered from China so I can actually see how they use Eddystone-URL.
    I have seen it demonstrated in this post (true, not with micro:bit) and since I managed to get the micro:bit work as an iBeacon, this (have it behave like an Eddystone-URL) sounded easy.
    I failed to get the mBed code working, although this page does have nice documentation, and when trying to adapt the BLE API code that Dough posted I also failed up to now.

    I used the Eddystone URL script to create:

    setInterval(function() {
      NRF.setName('Testing Espruino');
      NRF.setAdvertising({
        0x10 : [
            0x03,  // Length of Service List
            0x03,  // Param: Service List
            0xAA, 0xFE,  // Eddystone ID
            0x13,  // Length of Service Data
            0x16,  // Service Data
            0xAA, 0xFE, // Eddystone ID
            0x10,  // Frame type: URL
            0xF8, // Power
            0x03, // https://
            'g',
            'o',
            'o',
            '.',
            'g',
            'l',
            '/',
            'a',
            '0',
            'm',
            'n',
            's',
            'S',]});
    }, 30000);
    

    The name-change works, but as soon as I scan it, I receive an error:

    Uncaught Error: Got BLE error code 12
     at line 25 col 15
            'S',]});
                  ^
    in function called from system
    

    It only happens when I use an app, not right away. The name-change does work however. No Eddystone related info is shown though.
    If I make the URL short enough, no error is thrown, but the lack of info remains and no tools that scan for beacons recognise the microbit as a beacon.

    That is as far as I got. Hope you can help me. Thanks! :)

  • in Interfacing
    Avatar for Pierre

    For anyone trying to follow this along:
    I ran this code on the microbit:

    setInterval(function() {
      NRF.setAdvertising({
        0x180F : [88]
      });
    }, 30000);
    

    And then installed nRF Connect for Mobile for Android. If I then scan for the microbit, it shows (in this case a fake) battery percentage of 88% (see included image). A lot of the other free BLE tools in the Play store failed to either find the microbit or to display the data.

    Note though that on iOS nRF Connect does not give the same result. In fact, it fails to show the data. I used Bluetooth Smart Scanner and LE Nearby to create the other two screenshots.

    p.s. the iOS screenshots were created today using different (still fake) battery percentage of 100% = 0x64

    Next challenge: have it broadcast Eddystone-URL, but I'll start a new topic for that.

Actions