• Hi

    Thanks very much for your answer
    I've tested different things

    My firmware is 2v04
    I've tested a simple advertisement using the setAdvertising like that

    NRF.setAdvertising(
       [
    	{0x180F : new Int16Array([E.getTemperature() * 100]).buffer}
       ], 
       {
    		interval:300
    	}
    	);
    
    

    I get ADV_IND as expected with period SCAN_REQ/SCAN_RESP.
    Perfect this is what I was looking for. THanks

    Nevertheless in the puck documentation it is written that we should get a similar behavior with the following code

    NRF.setServices({
    	// Configuring the Envrionmental Sensing Service
    	0x181A: {
    		// Configure Temperature Characteristics
    		0x2A6E: {
    			readable: true,
    			notify: true,
    			writeable: false,
    			value: new Int16Array([E.getTemperature() * 100]).buffer
    		}
    	}
    // Make Envrionmental Sensing Service known 
    }, {advertise: ['0x181A']});
    

    I've tested but DO NOT get any advertising. It is mentioned to be connected to the device. I've tried with the NRF Tool (android) to connect but no advertisement
    Is it a bug or a wrong coding ?


    By the way (not a priority but questioning)
    The only thing I've noticed is that the battery level does not change .. A bit surprised as when I run this code

    setInterval(function() {
      print (E.getBattery());
    }, 500);
    

    I get a variable battery level with 5/10% change at each sample

    I've tried to change in the SetAdvertising with

    Puck.getBatteryPercentage()
    

    But same problem.

    Thanks for your support and help
    I'm developing labs for students and this puck.js is really a nice piece of Hw for training !!

    Regards
    Vpl

  • Fri 2019.07.19

    'in the puck documentation'

    Would you post the link please. There is plenty of documentation. ;-)

    Line #9 looks iffy, re: use of Uint16Array

    http://www.espruino.com/Reference#t_l_Uint16Array_Uint16Array


    'I get a variable battery level with 5/10% change at each sample'

    Could you estimate please, an approximate date the Puck was first powered up, e.g. the plastic tab was removed?

    Then, roughly how many hours the device remains powered up, executing Javascript? e.g. compared to number of hours the battery remained removed

    Has any attempt been made to make use of sleep mode?


    'I'm developing labs for students and this puck.js is really a nice piece of Hw for training'

    Have you considered the MDBT42Q breakout board to be able to attach sensors, such as temperature, humidity, rain gage or even a GPS unit?

    http://www.espruino.com/MDBT42Q

About

Avatar for user94148 @user94148 started