bjarne-hansen / py-nrf24

Library for NRF24L01 communication using pigpiod on Raspberry Pi.
MIT License
51 stars 21 forks source link

Missed packets from Logitech mouse. #42

Open b1narygl1tch opened 1 month ago

b1narygl1tch commented 1 month ago

Hello! I'm experimenting with Raspberry Pi, SPI-connected NRF24L01 module and this library. In NRF24L01 promiscuous mode I see some data on RX, but I definitely don't see packets from my Logitech mouse.

To check this I use an old project https://github.com/DigitalSecurity/raspjack based on https://github.com/jpbarraca/pynrf24 library. In its turn this library relies on RPi.GPIO (https://pypi.org/project/RPi.GPIO/) and spidev (https://pypi.org/project/spidev/). In raspjack's rj-scanner script I see the mouse movement packets (payload starts with 0x00 0xC2) and device's address. As I already said, in my script which utilises the py-nrf24 library I see some data, but there's no packets from my mouse. There's no such address (received from rj-scanner script) nor Logitech mouse move packets.

I compared output of both tools in terms of NRF24L01 registers statuses. There're no differences except RF_PWR bit of RF_SETUP register which shouldn't affect the setup.

This is how my script reads radio data (was taken from examples):

<init promiscuous mode>
while True:
    <loop through radio channels>
    while self.radio.data_ready():
        payload = self.radio.get_payload()
        address = ':'.join('{:02X}'.format(b) for b in payload[0:5])
        raw_packet = ':'.join('{:02X}'.format(b) for b in payload[5:])
        packet = self.extract_packet_from_raw_data(raw_packet)

I would be appreciated if you help to solve the issue with missing Logitech packets or give an advice where to dig further!

bjarne-hansen commented 1 month ago

Hi b1narygl1tch I’m not sure your mouse uses NRF24L01. Most likelybit uses bluetooth.There are lots of BT and BLE libraries around - maybe you should consider trying that out? //bjarneOn 8 Jul 2024, at 15.14, b1narygl1tch @.***> wrote: Hello! I'm experimenting with Raspberry Pi, SPI-connected NRF24L01 module and this library. In NRF24L01 promiscuous mode I see some data on RX, but I definitely don't see packets from my Logitech mouse. To check this I use an old project https://github.com/DigitalSecurity/raspjack based on https://github.com/jpbarraca/pynrf24 library. In its turn this library relies on RPi.GPIO (https://pypi.org/project/RPi.GPIO/) and spidev (https://pypi.org/project/spidev/). In raspjack's rj-scanner script I see the mouse movement packets (payload starts with 0x00 0xC2) and device's address. As I already said, in my script which utilises the py-nrf24 library I see some data, but there's no packets from my mouse. There's no such address (received from rj-scanner script) nor Logitech mouse move packets. I compared output of both tools in terms of NRF24L01 registers statuses. There're no differences except RF_PWR bit of RF_SETUP register which shouldn't affect the setup. This is how my script reads radio data (was taken from examples):

while True: while self.radio.data_ready(): payload = self.radio.get_payload() address = ':'.join('{:02X}'.format(b) for b in payload[0:5]) raw_packet = ':'.join('{:02X}'.format(b) for b in payload[5:]) packet = self.extract_packet_from_raw_data(raw_packet) I would be appreciated if you help to solve the issue with missing Logitech packets or give an advice where to dig further! —Reply to this email directly, view it on GitHub, or unsubscribe.You are receiving this because you are subscribed to this thread.Message ID: ***@***.***>
b1narygl1tch commented 1 month ago

Hello @bjarne-hansen

Thank you for the reply! Some (or maybe all of them) Logitech devices don't use Bluetooth. They use their own protocol instead, but the frequency is the same - 2.4 GHz. The mouse USB dongle I have, has NRF24L01 inside. To be more precise it is Logitech C-U0007 Unifying Dongle.

I'm trying to implement MouseJack. You can read more details here: https://www.bastille.net/research/vulnerabilities/mousejack/technical-details Here is a list with affected devices (Logitech is also there): https://www.bastille.net/research/vulnerabilities/mousejack/affected-devices

Moreover, as I already said, I see packets from the mouse (they have a specific format and comes when I move mouse) by using another tool called raspjack. I would like to use yours library for my project and hope that we'll find a solution for the issue.