-
Notifications
You must be signed in to change notification settings - Fork 15
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
sending 25 bit ook signal. #185
Comments
|
for _wait_for_packet I had to use the libgpiod python package. I have the code changes if you'd like a PR. Can there be multiple fixed values for packages received or would I have to use variable mode for that? Also I noticed some packages are not showing up. I wonder what I can do to receive all packages, maybe have less message repeats and count repeats another way? maybe automate the set_packet_length_bytes function. |
Thanks, I am already using
As far as I know, in fixed length mode CC1101 only supports a single length.
Sorry, I can't provide support here (I would need to analyze the signal). |
Ok, so I've exhausted all options here, still not receiving anything at all. import cc1101
with cc1101.CC1101() as transceiver:
transceiver.set_base_frequency_hertz(433.92e6)
transceiver.set_symbol_rate_baud(2048)
transceiver.set_sync_mode(cc1101.SyncMode.NO_PREAMBLE_AND_SYNC_WORD)
transceiver.disable_checksum()
transceiver.set_packet_length_mode(cc1101.PacketLengthMode.VARIABLE)
transceiver._set_filter_bandwidth(mantissa=3, exponent=3)
transceiver._enable_receive_mode()
print(transceiver) # CC1101(marcstate=startcal, base_frequency=433.92MHz, symbol_rate=2.05kBaud, modulation_format=ASK_OOK, sync_mode=NO_PREAMBLE_AND_SYNC_WORD, packet_length≤255B, output_power=(0xc6,0))
while True:
packet = transceiver._get_received_packet()
if packet and packet.payload: print(packet.payload) ... and ... radio silence .... (except b'\xff\xff' appearing out of nowhere with no radio involved) |
To verify that the settings above are correct, I would 1. record the original signal (e.g. with a RTL-SDR dongle), 2. transmit with your settings above & record the transmitted signal in the same way as 1. and then compare if 1. and 2. look similar (same base frequency, symbol rate etc.) b'\xff\xff' are probably noise |
the two variables i'm not sure about is the symbol rate and filter bandwidth. I didn't know the rtl_sdr dongle reports back a symbol rate, is this perhaps the sample rate?. I guess that's something I can check. |
rtl_sdr dongle does not report the symbol rate. You need to (manually) derive the symbol rate from the signal captured by the rtl_sdr dongle. the sample rate is the configured rate that the rtl_sdr dongle records in |
I scanned with rtl sdr.
ASK bit_rate is the same as the baud_rate. bits_per_second = (119 * 8) * (1 / 0.279) 3410 baud samples per secondReceiver getting nothing still. |
I did a little sanity check test by doing this: transceiver._enable_receive_mode()
while True:
packet = transceiver._get_received_packet()
if packet and packet.payload:
print(packet.payload)
transceiver._enable_receive_mode()
So it looks like packet payload only changes if you call _enable_receive_mode() in a loop continuously after receiving packets. Also the GPIO rising EDGE only gets called once, perhaps I've got to listen to both RISING and FALLING edges? |
Personally, I use |
transmit only takes bytes and I'd like to send 25 bits of information about 4 times,
my parameters are the following:
And the key is
0011011101100111101111000
.Also not sure that this is the correct way to both receive and transmit at the same time. I suspect this makes sense in a callback way of doing this.
The text was updated successfully, but these errors were encountered: