Puck.js v2 and sending RSSI to a Raspberry Pi 5

Posted on
  • Hi all,

    Wondering if anyone knows if transmitting the RSSI of a puck v2 to a Pi is possible? I'm using the Pi 5. I noticed in the documentation for the RSSI function it states that it only works on ESP32 boards but wanted to confirm.

    Thanks!

  • If you mean this https://www.espruino.com/Reference#l_Blu­etoothRemoteGATTServer_setRSSIHandler then the documentation says something else. However the other side (=Pi5) already has its own rssi value for the connection to the Puck so why to send it from Puck to the Pi? Maybe describe what you are trying to do.

  • Hi - which function are you referring to? I think they should all work on nRF52.

    But as @fanoush says, RSSI is generally something reported by the receiving device, so while the Puck can tell you what its RSSI is, the Raspberry Pi should have its own RSSI value it sees for the Puck as well, and that may be all you need.

  • Thatwas correct fanoush, and thank you for the help both. I've implemented a function that gets the RSSI natively with python/bleak.

    I'm curious if you can reccomend a way to increase the frequency/accuracy of the nRF52's RSSI value on the puck? I'm looking to use it in a dance performance essentially but i've found the RSSI value does not update as often/as accurately as i'd like it to. On my Pi i'm using the strongest antenna I could find.

    I'm aware also it may just be a case of getting a stronger BLE beacon, unfortunately it appears those are quite hard to come by in the UK, especially if the beacon needs to be small.

  • Assuming you're not connected, the RSSI value will come every time there's an advertisement - so it's pretty easy to increase that with https://www.espruino.com/Reference#l_NRF­_setAdvertising

    For instance: NRF.setAdvertising({},{interval:60}); will be about 10x faster than normal. You can also use NRF.setTxPower(4) to boost the Puck's output power

  • Thank you Gordon, that's helped tremendously.

  • Both changes of course affect battery life and also having the RSSI handler set to your JS code on Puck side and being called so frequently draws battery even more. So doing both changes (interval and TX power) but reading RSSI on Raspberry side may be the best.

  • Post a reply
    • Bold
    • Italics
    • Link
    • Image
    • List
    • Quote
    • code
    • Preview
About

Puck.js v2 and sending RSSI to a Raspberry Pi 5

Posted by Avatar for giftguide @giftguide

Actions