fphammerle / python-cc1101

Python Library & Command Line Tool to Transmit RF Signals via CC1101 Transceivers
https://pypi.org/project/cc1101/
GNU General Public License v3.0
78 stars 15 forks source link

FileNotFoundError: [Errno 2] No such file or directory #104

Closed leumasme closed 1 year ago

leumasme commented 1 year ago

After Installing the library and wiring a to instructions and connecting my CC1101 to my Pi Zero W according to the table in the Readme, I am getting a FileNotFoundError: [Errno 2] No such file or directory Error.

This seems to happen both when using the library in a script, as well as when using the cc1101-transmit command script.

$ printf '\x01\x02\x03' | cc1101-transmit -f 433920000 -r 1000
Traceback (most recent call last):
  File "/home/pi/.local/bin/cc1101-transmit", line 8, in <module>
    sys.exit(_transmit())
  File "/home/pi/.local/lib/python3.9/site-packages/cc1101/_cli.py", line 157, in _transmit
    with cc1101.CC1101(lock_spi_device=True) as transceiver:
  File "/home/pi/.local/lib/python3.9/site-packages/cc1101/__init__.py", line 548, in __enter__
    self._spi.open(self._spi_bus, self._spi_chip_select)
FileNotFoundError: [Errno 2] No such file or directory

Looking at the error, I can only suspect that this error may actually mean that my CC1101 module failed to connect(?), and the "No such file or directory" message is about the device and not an actual filesystem file/folder. Is this guess correct or is this a Library issue? Is something just wrong with my CC1101 board or wiring to it?

A clearer error message in this case would be beneficial either way. Thank you for your time.

leumasme commented 1 year ago

I had to first enable the SPI Interface in raspi-config, as found here.

fphammerle commented 1 year ago

Thanks for reporting how you fixed the issue!

I should probably mention raspi-config in README.md.