wladimir-computin / CC1101-ESP-Arduino

ESP8266 / ESP32 / Arduino driver lib for using the great TI C1101 transceiver
Other
76 stars 13 forks source link

Question on Capturing and Replicating "Raw" Data with cc1101-esp-arduino #5

Closed CarlosDanielDev closed 1 week ago

CarlosDanielDev commented 6 months ago

Hi there,

I recently stumbled upon your cc1101-esp-arduino project and I must say, it's impressive – kudos on such a fantastic job! Being relatively new to the IoT scene, I'm keen to dive deeper and understand more about the capabilities of your library.

I'm particularly interested in the possibility of reading "raw" data. My goal is to capture any incoming data in its rawest form and then replicate this to send back to the originator as a response. Could you provide some guidance on whether the cc1101-esp-arduino library supports this functionality? If so, how can I implement this to ensure I can read and capture all types of incoming data and then accurately replicate it for the response?

Looking forward to your insights and thanks in advance for your help!

Best regards, Carlos

wladimir-computin commented 6 months ago

Hi @CarlosDanielDev!

thanks, I was building a remote control for my car and needed the CC1101 in the process.

I'm particularly interested in the possibility of reading "raw" data. My goal is to capture any incoming data in its rawest form and then replicate this to send back to the originator as a response.

Yes, this is definitely the right library for that, however you must know a few things about the signal you want to replicate. The CC1101 can only send/receive digital data and you must know in advance how it is modulated and which frequency it uses. So, for example you can't replicate FM radio with it, but you can replicate a FSK (digital FM) or ASK/OOK (digital AM) modulated signal like a remote control. It is also helpful to know the baud rate (how fast the data is sent), however to blindly replicate signals we can get away with just using a high enough baud rate.

Now, take a look at the examples. In Listen_and_print.ino we setup the CC1101 as a receiver and attach a pin interrupt to it. In the interrupt function we record how long (in microseconds) the pin stayed in LOW or in HIGH. The example writes this information into a string but you should write it into a large enough int array.

Signal: _____-_-_---____--_____
Signal (as binary): 00000101011100001100000...
int array with timing information: [5,1,1,1,3,4,2,...]

Think of the int array as a method to compress the raw data, which otherwise would fill the memory of the ESP8266/32 very quickly.

Every N seconds (the example does it every 5 seconds) the signal is printed. You can however switch the CC1101 to TX mode and control the corresponding pin using a precise timer to send the recorded raw data out again.

I hope this was helpful. If you have trouble implementing it, feel free to reach out here again :)

Best regards, David