You are reading a single comment by @furuskog and its replies. Click here to read the full conversation.
  • @Wilberforce thank you very much for the help. With a little googling and some other tutorials about the sensor in python I finally had success.

    This is the code I used to get the correct values.

    var currentSevice = false;
    
        function getData() {
          var gatt;
          NRF.connect("C4:7C:8D:62:0D:5A").then(fu­nction(g) {
            gatt = g;
            return gatt.getPrimaryService("00001204-0000-10­00-8000-00805f9b34fb");
          })
          .then(function(service) {
            currentService = service;
            return service.getCharacteristic("00001a00-0000­-1000-8000-00805f9b34fb");
         })
         .then(function(characteristic) {
             return characteristic.writeValue([0xa0, 0x1f]);
         })
         .then(() => {
             return currentService.getCharacteristic("00001a­01-0000-1000-8000-00805f9b34fb");
         })
         .then((characteristic) => {
            return characteristic.readValue();
         })
         .then(function(value) {
            console.log("temperature: ", value.getI­nt16(0, true)/10);
       console.log("Sunlight: ",value.getInt­32(3,true));
       console.log("Moister: ", value.getUin­t8(7,true));
    console.log("Fertility: ", value.getUint16(8,true));
            console.log(JSON.stringify(value.buffer)­);
           gatt.disconnect();
           console.log("Done!");
         })
           .catch(function(error){
             console.log("error", error);
           });
        }
    
        setWatch(function() {
          getData();
        }, BTN, { repeat:true, edge:"rising", debounce:50 });
    
About

Avatar for furuskog @furuskog started