NordicSemiconductor / nRF-Sniffer-for-802.15.4

nRF-based 802.15.4 sniffer (firmware and software)
Other
221 stars 64 forks source link

Linux, Python, error after channel switching #54

Closed mstekker closed 1 year ago

mstekker commented 1 year ago

Hi,

Using a simple python script to test packet sniffing:

`import time import subprocess from nrf802154_sniffer import Nrf802154Sniffer sniffer = Nrf802154Sniffer()

for chan in range (1, 26): print ('reset nrf...') subprocess.call (['usbreset', 'nRF52 USB Product']) print ('chan: ' + str(chan)) print ('starting Thread scan...') sniffer.extcap_capture(fifo="file.pcap", dev="/dev/ttyACM0", channel=chan, metadata="ieee802154-tap") time.sleep (20) print ('stopping Thread scan...') sniffer.stop_sig_handler()

usbreset "nRF52 USB Product"

#subprocess.call (['usbreset', 'nRF52 USB Product'])
time.sleep (1)

print ('stopped') ` Generates an exception after the first channel switch. Only a reboot solves the "lock up". Exception generated after the first channel scan:

Exception: Nrf802154Sniffer (/dev/ttyACM0) channel 2 did not reply properly to setup commands. Please re-plug the device and make sure firmware is correct. Recieved: b''

I already tried a reset usb-function in the script, but that does not work. Only a reboot will solve the lock.

Any suggestions for this problem?

Best regards,

Mart

mstekker commented 1 year ago

solved, I used the wrong channels, script works fine.

best regards,

Mart