using rtl_433 and arduino module

425 views
Skip to first unread message

reda Y

unread,
Jun 12, 2020, 9:09:18 AM6/12/20
to rtl_433
Hi all,

please, i want to read the data sent from 433MHz arduino module using rtl_433, in the image below the obtained result,
 
my question how can read the data sent ( i have sent 1 with arduino module below you can find the arduino sktech) 

Thanks in advance

arduino code : 
#include <RH_ASK.h>

RH_ASK driver(2000, 11, A0, 5);

void setup(){
    Serial.begin(115200);
    if (!driver.init()){
         Serial.println("init failed");
    }
}

const uint8_t len = 1;
uint8_t msg[len] = {1};

void loop(){
    driver.send(msg, len);
    driver.waitPacketSent();
    Serial.println("sent !");

    msg[len-1]++;
    delay(1000);
}




Capture2.JPG




Christian Z.

unread,
Jun 12, 2020, 9:23:26 AM6/12/20
to rtl_433
What kind of receiver is that? A cheap 1-bit OOK receiver like this? https://www.amazon.com/dp/B076Q64MBQ/
Are you running the receiver on the Arduino and sending raw data to rtl_433 on a host? What kind of raw data are you sending?
Or do you want to add some recevier to the host running rtl_433?

reda Y

unread,
Jun 12, 2020, 1:17:11 PM6/12/20
to rtl_433
i'm using the RTL-SDR receiver 

Christian Z.

unread,
Jun 12, 2020, 4:55:17 PM6/12/20
to rtl_433
Ok, sorry. Yes, that makes sense. It looks like it is working fine!
Your question then is "how to I get the payload data from rtl_433", right?
What program do you want to read the payload data with?
A simple example could be
    rtl_433 -f 433.812M -s 1024k -R 67 -F json | your_program_that_reads_json
or perhaps
    rtl_433 -f 433.812M -s 1024k -R 67 -F csv | your_script_that_reads_csv
If your program is in Python I recommend
    rtl_433 -f 433.812M -s 1024k -R 67 -F syslog:127.0.0.1:1433
and then change e.g. examples/rtl_433_statsd_relay.py (remove everything statsd and replace "statsd.gauge" with "print".

reda Y

unread,
Jun 12, 2020, 5:45:49 PM6/12/20
to rtl_433
thanks very much,

yes this is my question exactly,
and i will create a python script to read the data, can you explain to me the last part please :
"and then change e.g. examples/rtl_433_statsd_relay.py (remove everything statsd and replace "statsd.gauge" with "print"."

thank you again,

Christian Z.

unread,
Jun 13, 2020, 5:33:00 AM6/13/20
to rtl_433
I'll add a simple Python example to rtl_433 for you, likely tomorrow, to explain in detail.

reda Y

unread,
Jun 13, 2020, 8:15:56 AM6/13/20
to rtl_433
great,
thanks brother,

reda Y

unread,
Jun 13, 2020, 12:50:26 PM6/13/20
to rtl_433
hi bro,

i got this result, no msg decoded !, and i dont know why,

Capture3.JPG

 

Christian Z.

unread,
Jun 13, 2020, 4:59:25 PM6/13/20
to rtl_433
The table looks good. Your byte (len=1) is in "Payload". The fields "msg" and "codes" are ok to be emtpy, this decoder does not use them.

reda Y

unread,
Jun 13, 2020, 5:02:11 PM6/13/20
to rtl_433
thanks christian,

but how can i read the information, in this example i have sent bit 0 as information !!,

if i sent for exmple the number 25, how can i read it !!

thanks again

Christian Z.

unread,
Jun 13, 2020, 5:06:47 PM6/13/20
to rtl_433
Did you perhaps sent "0" (the string) instead of 0 (the number)? In ASCII 48 = 0, 49 = 1, ... https://en.wikipedia.org/wiki/ASCII

reda Y

unread,
Jun 13, 2020, 5:23:46 PM6/13/20
to rtl_433
i have sent 0 number, this is my code arduino :
#include <RH_ASK.h>

RH_ASK driver(2000, 11, A0, 5);

void setup(){
   Serial.begin(115200);
   if (!driver.init()){
        Serial.println("init failed");
   }
}

const uint8_t len = 1;
uint8_t msg[len] = {0};

void loop(){
   driver.send(msg, len);
   driver.waitPacketSent();
   Serial.println("sent !");

    msg[len-1]++;
   delay(1000);
}

reda Y

unread,
Jun 13, 2020, 5:37:28 PM6/13/20
to rtl_433
thanks a lot christian,

i have tried to send string "welcome", 
and i have recuperated the payload successfully, the payload is coded in asccii,

below a picture for that,
thanks again,

best regards

Capture4.JPG



On Saturday, June 13, 2020 at 11:06:47 PM UTC+2, Christian Z. wrote:

Christian Z.

unread,
Jun 14, 2020, 2:17:36 PM6/14/20
to rtl_433
I have added a short and simple example for custom data handling now: https://github.com/merbanan/rtl_433/blob/master/examples/rtl_433_custom.py
For your use-case check for model == "RadioHead-ASK", maybe also check id, to, and from then handle data["payload"]

reda Y

unread,
Jun 14, 2020, 3:51:52 PM6/14/20
to rtl_433
great work,

thank you very much,
Reply all
Reply to author
Forward
0 new messages