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

TypeError: argument of type 'NoneType' is not iterable #119

Open
michalisk13 opened this issue Feb 25, 2025 · 0 comments
Open

TypeError: argument of type 'NoneType' is not iterable #119

michalisk13 opened this issue Feb 25, 2025 · 0 comments

Comments

@michalisk13
Copy link

Hi scat community,

I have recently flashed my RPi CM4 with a new Rasbian and plugged in once more my SIMCOM modem as I did many times before.
Although this time I get this weird error I never got before:

scat -t qc -s /dev/ttyUSB2
Traceback (most recent call last):
  File "/usr/lib/python3/dist-packages/serial/serialposix.py", line 322, in open
    self.fd = os.open(self.portstr, os.O_RDWR | os.O_NOCTTY | os.O_NONBLOCK)
              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
OSError: [Errno 16] Device or resource busy: '/dev/ttyUSB2'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/local/bin/scat", line 8, in <module>
    sys.exit(scat_main())
             ^^^^^^^^^^^
  File "/usr/local/lib/python3.11/dist-packages/scat/main.py", line 131, in scat_main
    io_device = scat.iodevices.SerialIO(args.serial, args.baudrate, not args.no_rts, not args.no_dsr)
                ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/dist-packages/scat/iodevices/serialio.py", line 9, in __init__
    self.port = serial.Serial(port_name, baudrate=baudrate, timeout=0.5, rtscts=rts, dsrdtr=dsr)
                ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3/dist-packages/serial/serialutil.py", line 244, in __init__
    self.open()
  File "/usr/lib/python3/dist-packages/serial/serialposix.py", line 325, in open
    raise SerialException(msg.errno, "could not open port {}: {}".format(self._port, msg))
serial.serialutil.SerialException: [Errno 16] could not open port /dev/ttyUSB2: [Errno 16] Device or resource busy: '/dev/ttyUSB2'
user@finalmile0001:~/shark-rs $ sudo scat -t qc -s /dev/ttyUSB2
2025-02-25 15:20:18,265 scat.qualcommparser (stop_diag) INFO: Stopping diag
2025-02-25 15:20:19,767 scat.qualcommparser (init_diag) INFO: Initializing diag
Traceback (most recent call last):
  File "/usr/local/bin/scat", line 8, in <module>
    sys.exit(scat_main())
             ^^^^^^^^^^^
  File "/usr/local/lib/python3.11/dist-packages/scat/main.py", line 202, in scat_main
    current_parser.init_diag()
  File "/usr/local/lib/python3.11/dist-packages/scat/parsers/qualcomm/qualcommparser.py", line 196, in init_diag
    if 'id_range' in result:
       ^^^^^^^^^^^^^^^^^^^^
TypeError: argument of type 'NoneType' is not iterable

Please note that the exact hardware setup was working perfectly just before flashing a new OS on the RPi.

Any ideas?

I am not sure if this is related to issue #83

Thanks,
Mak

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant