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
81 stars 15 forks source link

Hello Receive examples #41

Open matoxbr opened 3 years ago

matoxbr commented 3 years ago

Guys in the examples folder just found it for shipping. Does anyone have an example to receive? thanks

fphammerle commented 3 years ago

Hi,

receiving is not officially supported yet. I implemented some basic support (private / unstable API).

You can receive packages by calling transceiver._wait_for_packet(timeout_seconds=21, gdo0_gpio_line_name="GPIO25") (or similar)

Example: https://github.com/fphammerle/wireless-sensor/blob/v0.4.0/wireless_sensor/__init__.py#L150

Currently, I cannot guarantee backward-compatibility in future releases yet (thus, the method has a _ prefix)

oragamiman01 commented 9 months ago

Hello,

Do you plan to add receiving support? :)

Thanks

fphammerle commented 9 months ago

Yes, I do. Actually, I have been using transceiver._wait_for_packet for several months already but I haven't found time to make the method / API public yet.

Crsarmv7l commented 9 months ago

Yes, I do. Actually, I have been using transceiver._wait_for_packet for several months already but I haven't found time to make the method / API public yet.

I assume you are using the FIFO buffer due to pythons slow speed?

fphammerle commented 9 months ago

Yes, see CC1101._get_received_packet. In summary:

self._read_burst(
    start_register=FIFORegisterAddress.RX,
    length=self._read_status_register(StatusRegisterAddress.RXBYTES)
)
balaboooot commented 5 months ago

Hello! I have a WS90 weather station, a Respi zero2w, a cc1101. I tried to receive the signal the way you did but failed. So I just need a simple example to receive fsk2 signal. Thanks!

fphammerle commented 5 months ago

Hi, sorry, I do not have enough resources/time to provide support. You first need to know all the properties of the FSK2 signal (center frequency, bandwidth, sample rate, preamble/sync word) and configure CC1101 accordingly. I would recommend analyzing the signal with a RTL-SDR receiver first.