You are reading a single comment by @Gordon and its replies. Click here to read the full conversation.
  • Hi.

    I want people will be able to see: name of the device, battery, temp

    But you also want the URL to be shown as well?

    I think the issue is you have some of the arguments in the wrong places, and also some you don't need. Try:

    NRF.setAdvertising([
       require("ble_eddystone").get("http://www­.david.com"),
      {
       0x180F : [NRF.getBattery()],
       0x1809 : [Math.round(E.getTemperature())]
      } 
    ], {
       name  : "David",
       showName: true,
       discoverable : true,
       connectable : false,
       scannable : true,
       interval:100
    });
    

    This does seem to be reasonable well documented (including an example specifically onm showing battery percentage and eddystone) on http://www.espruino.com/Reference#l_NRF_­setAdvertising

    what is the different between discoverable \scannable - isn't all the same?

    discoverable is whether it can be seen by normal devices scanning for it. scannable refers to 'scan response' - there is some advertising info that isn't sent out all the time, a device that's scanning has to 'ask' for it. That's what 'scan response' is.

    For what you're doing, you don't need a scan response.

    if I disable showname - I will see every data except the devcie name - right?

    Yes, correct.

    maybe I'm using the wrong app on my phone ?

    nRF Connect is fine...

    when I just search using bluethhoth scan - I don't see the device at all.

    If it's coming up with those errors then it may not be appearing. Also, you need to be disconnected from Bluetooth for the device to start advertising.

    when I search using "BLE Scanner" - I see the device (without any information ) but when I press "Open url" - it redirect my to my site . but no name\temp - nothing.

    Maybe try it with the new code I suggested.

    However some older Espruino firmwares did have a problem when advertising using an even number of advertising packets. If you really can't upgrade the firmware (not even with the iOS/Android phone that you seem to be using with nRF Connect???) then you could try:

    NRF.setAdvertising([
       require("ble_eddystone").get("http://www­.david.com"),
      {
       0x180F : [NRF.getBattery()],
       0x1809 : [Math.round(E.getTemperature())]
      },
      {
       0x180F : [NRF.getBattery()],
       0x1809 : [Math.round(E.getTemperature())]
      } 
    ], {
       name  : "David",
       showName: true,
       discoverable : true,
       connectable : false,
       scannable : true,
       interval:100
    });
    

    when I use "nRF Connect" - I don't the name of the device just "Te" and the battery 3% temp 85

    That'll be because of your old code - try with the updated code.

About

Avatar for Gordon @Gordon started