Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

BLE beacons Receiving #32

Closed
2bndy5 opened this issue Jul 6, 2021 Discussed in #30 · 2 comments · Fixed by #33
Closed

BLE beacons Receiving #32

2bndy5 opened this issue Jul 6, 2021 Discussed in #30 · 2 comments · Fixed by #33
Labels
enhancement New feature or request

Comments

@2bndy5
Copy link
Member

2bndy5 commented Jul 6, 2021

Discussed in #30

Originally posted by salembream July 3, 2021
Hi,
I am wondering if NRF24L01 can be used to receive other (standard) BLE beacons?
If it is possible, any guidelines to implement it ?

I turned this into a feature request because I want it despite how inaccurate the results may be.

@2bndy5 2bndy5 added the enhancement New feature or request label Jul 6, 2021
@2bndy5
Copy link
Member Author

2bndy5 commented Jul 6, 2021

@salembream Ok, I've added this feature in the rf24-network branch - it will be rolled out with the next release. Docs are updated (they may need a proofreading), and the fake_ble_test example now includes a slave() function that receives BLE payloads and decodes the data within for a specified number of seconds. Use slave(20) to receive for 20 seconds. Sample output from updated example:

pi@rpi2:~/github/CircuitPython_nRF24L01/examples $ python3 nrf24l01_fake_ble_test.py
    nRF24L01 fake BLE beacon test
*** Enter 'M' to broadcast the device name, pa_level, & battery charge.
*** Enter 'T' to broadcast the device name & a temperature
*** Enter 'U' to broadcast a custom URL link
*** Enter 'R' to receive BLE payloads
*** Enter 'Q' to quit example.
r 20
recevied payload from MAC address 5a:d6:bd:95:cc:a5
        device transmitting PA Level: 12 dbm
recevied payload from MAC address 7a:ca:bd:95:cc:a5
        raw buffer (unknowmn format): bytearray(b'\x10\x06\x93\x19\x10#\xce\x0c')
recevied payload from MAC address 68:39:b5:b3:1e:34
        raw buffer (unknowmn format): bytearray(b'\x8b\xb3\xdf\x03\xd0')
recevied payload from MAC address 45:bb:ff:e2:5a:d1
recevied payload from MAC address e6:e6:35:b2:88:64
        device name: nRF24L01
        device transmitting PA Level: -12 dbm
        Battery capacity remaining: 85 %
recevied payload from MAC address 1f:28:4c:48:52:8e
recevied payload from MAC address e6:e6:35:b2:88:64
        device name: nRF24L01
        device transmitting PA Level: -12 dbm
        Battery capacity remaining: 85 %
recevied payload from MAC address e6:e6:35:b2:88:64
        device name: nRF24L01
        device transmitting PA Level: -12 dbm
        Battery capacity remaining: 85 %
recevied payload from MAC address e6:e6:35:b2:88:64
        device name: nRF24L01
        device transmitting PA Level: -12 dbm
        Battery capacity remaining: 85 %
recevied payload from MAC address e6:e6:35:b2:88:64
        device name: nRF24L01
        device transmitting PA Level: -12 dbm
        Battery capacity remaining: 85 %

Clearly a lot more BLE data can be decoded, but for now I'm just decoding all Service Data specifications currently supported by the fake_ble module.

@2bndy5
Copy link
Member Author

2bndy5 commented Jul 6, 2021

debugging this feature at 2 AM seems to have a smaller sample size (ambiant signals) 🤣

@2bndy5 2bndy5 linked a pull request Aug 4, 2021 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant