Avatar for louisld

louisld

Member since Jul 2018 • Last active Jul 2018
  • 1 conversations
  • 8 comments

Most recent activity

    • 14 comments
    • 4,452 views
  • in Other Boards
    Avatar for louisld

    Thank you for your grateful help !

  • in Other Boards
    Avatar for louisld

    Ok thank you so much it works ! Just a last question : if I want to use another service than that of heart rate should I use heart service and just change the name or there is a specific service ?

  • in Other Boards
    Avatar for louisld

    When i delete the NRF.updateServices function I get no error. But I still can't see the service.

  • in Other Boards
    Avatar for louisld

    Ok, I understand I can't put the characteristic I want in a random service.
    I tried to follow the requirement for the heart rate service but I still have the same problem. It's says Unable to find the service with UUID 0x2A37.

    var Ruuvitag = require("Ruuvitag");
    
    Ruuvitag.setEnvOn(true);
    
    NRF.setServices({
      0x180D: {
        0x2902:{
          value: 0,
          read: true,
          write: true,
        },
        0x2A37: {
          notify: true,
          value : [Math.round(Ruuvitag.getEnvData().temp)]­,
        }
      }
    }, { advertise: [0x180D] });
    
    setInterval(function () {
      NRF.updateServices({
        0x180D: {
          0x2A37: {
            value : [Math.round(Ruuvitag.getEnvData().temp)]­,
            notify: true
          }
        }
      });
    }, 1000);
    
  • in Other Boards
    Avatar for louisld

    I tried several times but nothing changed. Here is my new code :

    var Ruuvitag = require("Ruuvitag");
    
    Ruuvitag.setEnvOn(true);
    
    NRF.setServices({
      0x1800: { // heart_rate
        0x2A6E: { // heart_rate_measurement
          notify: true,
          value : [Math.round(Ruuvitag.getEnvData().temp)]­,
        }
      }
    }, { advertise: [0x1801] });
    
    setInterval(function () {
      NRF.updateServices({
        0x1800: {
          0x2A6E: {
            value : [Math.round(Ruuvitag.getEnvData().temp)]­,
            notify: true
          }
        }
      });
    }, 1000);
    

    Here is what I get with my phone :

    It's says no service. And in the section "TX characteristic" I can see an error from the javascript interpreter but I'm not able to read it because it goes too fast.
    I don't understand why there is an error even with the IDE disconnected. The code looks very simple.

  • in Other Boards
    Avatar for louisld

    When I'm connecting to RuuvTag with nRFC app on android I can see service but I can't see the characteristic.

  • in Other Boards
    Avatar for louisld

    Yes i get this message. Thank you very much. I will try to use BLE with the IDE disconnected.

  • in Other Boards
    Avatar for louisld

    Hello,
    I'm trying to set up a GATT service on the Ruuvitag. I used the Espruino's documentation to find that code :

    var Ruuvitag = require("Ruuvitag");
    
    Ruuvitag.setEnvOn(true);
    
    NRF.setServices({
      0x1800: {
        0x2A6E: {
          notify: true,
          value : Ruuvitag.getEnvData().temp,
        }
      }
    }, { advertise: [0x1801] });
    
    setInterval(function () {
      NRF.updateServices({
        0x1800: {
          0x2A6E: {
            value: Ruuvitag.getEnvData().temp,
            notify: true
          }
        }
      });
    }, 1000);
    

    But when I run it on the Ruuvitag, I got the following error from the javascript console :

    Uncaught Error: Unable to find service with UUID 0x2a6e
     at line 8 col 4
      });
       ^
    in function called from system
    

    I don't know what i'm doing wrong. Thanks for helping me.

Actions