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
72 stars 14 forks source link

OSError: [Errno 25] Inappropriate ioctl for device when trying to use a usb duart device #70

Closed paulc1983 closed 2 years ago

paulc1983 commented 2 years ago

Hi

I am trying to use this to send an rf signal (433.42 mhz) over a usb duart CP2102 device.

I have the device plugged in to a usb port device which shows up as Cygnal Integrated Products, Inc. CP2102/CP2109 UART Bridge Controller from lsusb, and is listed as /dev/ttyUSB0

when i try to run any of the example command line operations substituting in /dev/ttyUSB0 for the device i get the following error:

OSError: [Errno 25] Inappropriate ioctl for device

Can this library only be used with GPIO pin devices or is there a way to get this to work? My ultimate aim is to get this to work with pi-somfy which currently is dependent on the pigpio library

https://github.com/Nickduino/Pi-Somfy

Any help is much appreciated

fphammerle commented 2 years ago

Hi,

sorry, this library is only compatible with CC1101 transceivers that are connected via SPI (not UART)

paulc1983 commented 2 years ago

thanks for the quick reply. do you happen to know of any starting place to send a signal over cc1101 using UART? I cant seem to find anything when searching, but am pretty new to this so may not be looking for the right thing

fphammerle commented 2 years ago

Personally, I have never come across CC1101 transceivers with UART interfaces, sorry.

Texas instrument's official CC1101 documentation does not mention any UART interface (https://www.ti.com/lit/ds/symlink/cc1101.pdf), so I suspect that your device includes a UART to SPI interface that was developed by a third party. Did you find any documentation online on the serial protocol of your device?

paulc1983 commented 2 years ago

thanks again for taking the time to reply. Although i didnt buy from amazon, this is basically the device https://www.amazon.com/433Mhz-CC1101-Wireless-Transceiver-Module/dp/B07ZCNYXWW

It didnt come with any branding or documentation, but the silicone labs drivers seem to work to install it on windows but other than that im stuck

fphammerle commented 2 years ago

I did a quick search for "RM1101-USB-232" and similar terms. Strangely, there are dozens of listings for that device in various online shops but none reference any documentation. Unfortunately, I have no glue what the serial protocol could look like. The "silicone labs drivers" probably just provides the driver for the USB-to-UART interface. You would need documentation on the UART-to-SPI part.

paulc1983 commented 2 years ago

thanks i will try and contact the seller and ask. looks like I will have to look into buying an SPI device and a physical pi (i wanted to get a proof of concept working first but now it seems a tall order)

thanks for being so helpful and taking the time to reply!