Open lulek2007 opened 5 years ago
Maybe changing the conversion to a hex string is enough.
char valueStr[35];
sprintf(valueStr,"%A", value );
Yes but not "%A" this answer -0X1.73BF800D3600AP-18
Correct is "%X" output 6 digit answer 6F5321
But how to create output string like this
MQT: topic/RESULTS = {"RfReceived": {"Data": "D3600A"}}
I have no experience to progam this in line
sprintf(valueStr,"%X", value );
i try
sprintf(valueStr," topic/RESULTS = {"RfReceived": {"Data": " "%X" "}}", value );
but not working
regards MK
Hi @lulek2007,
sorry for the late reply. You have to escape the "
which are in the string, not the one for begin and end. And fit the size oft the array to be able to contain all the characters. Just typed this in my phone not tested, but schould be enough as example to get what to do.
char valueStr[60];
sprintf(valueStr, "topic/RESULTS = {\"RfReceived\" : {\"Data\" : \"%X\"}}", value );
Hello thank you very much for your answer I've already managed and the topic is generated correctly
I added additionally usleep (500);
fprintf (stdout, "Received% s \ n", valueStr);
}
}
mySwitch.resetAvailable ();
}
usleep (500);
}
// Tidy up
on my raspberry pi 0 WH because the CPU load was around 70 - 80% with the RFmqtt process running.
I have a problem with the range of the receiver, about 3m - 4m. I bought this https://www.dhgate.com/product/sovo-433-mhz-superheterodyne-rf-receiver/414959018.html and 4cm long antena for reciver
You can recommend some proven module with a better range
Regards Marcin Kowalik
Hello, At the beginning I would like to thank you very much for this project. He is the only one working with my accessories. I managed to build on rapberry pi 0 WH bridge with 433 sensors to mqtt and conect it to homebridge and apple homekit app.
I use digoo detectors https://www.mydigoo.com/Digoo-DG-HOSA-433MHz-Window-Door-Sensor-PIR-Detector-Wireless-Remote-Controller-External-Alert-Siren-Set-p-93.html or keriji pir 433 detectors etc.
At begining as bridge, I used https://sonoff.itead.cc/en/products/appliances/sonoff-rf-bridge-433 Sonoff 433 bridge and tasmota software.
and processed the topic from this device that looked like this
in homebridge, where tele / sonoff_rf / RESULT is a topic and imprtant information is in 6 digit Date fild like "Data": "D3600A" It is hex data.
I only receive dec digit in your project
Is it possible to add the conversion so that it can be published in mqtt as in tasmota software. This would make it easy for me to move to the raspberry bridge. I do not have to change the processing of all detectors to the current decimal format.
greetings Marcin Kowalik