Avatar for Terrence7

Terrence7

Member since Aug 2018 • Last active Aug 2018
  • 3 conversations
  • 16 comments

Most recent activity

    • 18 comments
    • 4,948 views
  • in Puck.js, Pixl.js and MDBT42
    Avatar for Terrence7

    Gordon, thanks for your incredible support. I am now looking at BLE coding on RPI to pick up the adverts. I hope you might help me in that area once I get over there.

    .net / asp.net / sql server etc dev. This \IOT js dev is a new area for me and its taking a bit to get my head around it.

  • in Puck.js, Pixl.js and MDBT42
    Avatar for Terrence7

    Yes, I was under the impression it would send it just when I ask it to.

    1. So my if else statement just changes What is being advertised, not When it will be advertised.

    2. My setInterval call determines the Frequency of the broadcast.

    3. If I know it takes my son 3 minutes to get all of the dog food out and put it in bowls, then can't I set the interval to 60 seconds? (you mentioned not staying connected if it was too infrequent).

    I have read over that page, all good info, but being new the concepts take a bit to sink in. Q & A really helps.

    Thank you for your clarifications.

  • in Puck.js, Pixl.js and MDBT42
    Avatar for Terrence7

    although I'd still recommend that you use the counter method if you want to be sure you don't miss things happening.

    My IOT hub will be a rpi3. I plan on capturing the battery reading when the lid has been opened, and thus will only be one hit a day. In my else statement I send a 0, though you are recommending a count.

    I don't plan on doing anything with the count, but I am interested in your suggestion, please tell me more about how this will help. (a bit slow here :) )

    Here is the current state of my code:

    function sendAdvert() {
      if(Puck.light() > 0.50){
        NRF.setAdvertising({0x180F : [Puck.getBatteryPercentage()]});
      }
      else{
       NRF.setAdvertising({0xFFFF:[0]});
      }
    }
    
    setInterval(sendAdvert, 1500);
    digitalRead(LED1);
    NRF.setTxPower(4);
    
    
  • in Puck.js, Pixl.js and MDBT42
    Avatar for Terrence7

    Here is my proposed code, do you have any suggestions?

    1. So in this code, LED1 is not an output, so I shouldn't have to do a read correct?

    2. The only reason you suggested bumping power with setTxPower(4) is just to give me some more distance correct?

    Thank you.

    function sendAdvert() {
      if(Puck.light() > 0.50){
        NRF.setAdvertising({0x180F : Puck.getBatteryPercentage()});
      }
      else{
       NRF.setAdvertising({0xFFFF:"0"});
      }
    }
    
    NRF.setTxPower(4);
    setInterval(sendAdvert, 1500);
    
    
  • in Puck.js, Pixl.js and MDBT42
    Avatar for Terrence7

    @allObjects, @Gordon Thank you for your great responses.

    I have settled on using the light sensor, as the puck will be inside the tub, and will get flooded with light when he opens the lid.

    Problem is distance. Gordon, how far should I expect a puck to Rpi to be able to communicate?

    What I usually say is to transmit a number all the time, and to then just increment that number when something happens.

    Isn't that going to burn up the battery? I would like to get a couple of months battery out of a once a day event advert.

  • in Puck.js, Pixl.js and MDBT42
    Avatar for Terrence7

    @allObjects Thanks for you helpful comments.

    Any thought on this comment?

    Where I am having trouble is the BLE part of the equation. I just want to send a signal, do I have to do advertising and or GATT services, or can I just send a signal without all of the BLE ceremony?

  • in Puck.js, Pixl.js and MDBT42
    Avatar for Terrence7

    Robin, thank you for those links. I will start reading and watching them.

    I can figure out how to take a reading on the mag or accelerometer.

    Where I am having trouble is the BLE part of the equation. I just want to send a signal, do I have to do advertising and or GATT services, or can I just send a signal without all of the BLE ceremony?

  • in Puck.js, Pixl.js and MDBT42
    Avatar for Terrence7

    I plan on creating a notice to inform me when my son feeds the dogs.
    I am going to Velcro the Puck in the round screw in lid to the dog food bucket.
    When he turns the lid to open it up, the accelerometer will sense movement and send out a message (battery level).

    My Ras Pi will be listening for that message and when it receives it, it will send a message to my Azure IOT Hub. ( can handle the raspberry pi code)

    I wonder if you could help me on the how I might go about programming the Puck to send a message when the accelerometer senses movement?

    Is it possible with the graphical designer?

    Thank you for any coding you can help me with so this doesn't take me a month to figure out.

Actions