NRF8021540 USB dongle, Python, switching channel bug?

Hi,

I am 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 ('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" - did not help
  #subprocess.call (['usbreset', 'nRF52 USB Product'])
  time.sleep (1)
print ('stopped')

Generates an exception after the first channel switch. Only a reboot/re-plug dongle 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.

OS: Linux (Debian Buster)

Any suggestions for this problem?

Best regards,

Mart

Parents Reply Children
Related