Just wanted to say thanks. It works very well for me.
Now I don’t need to write my own =)
Just wanted to say thanks. It works very well for me.
Now I don’t need to write my own =)
I am having difficulties with the MQTT on Arduino. On Serial Monitor it says :
-2
try again in 5 seconds
Attempting MQTT connection…
failed, rc=
-2
try again in 5 seconds
Attempting MQTT connection…
SOLVED
Edit:
// If you want to use a username and password, uncomment next line and comment the line if (client.connect(“433toMQTTto433”)) {
if (client.connect(“433toMQTTto433”, mqtt_user, mqtt_password)) {
// and set username and password at the program beginning
// if (client.connect(“433toMQTTto433”)) {
ok now i have other problem… now i am connected my broker:
ÿConnecting to
Casa
.
.
WiFi connected
client mqtt not connected, trying to connect
Attempting MQTT connection…
connected
subscription OK to
home/commands/#
but i dont receive the message;
"Hey I got a callback "
how can i do??? @masterkenobi @1technophile @prefectionist
Hello,
Did you try to publish a message like stated in the tutorial?
If you have mosquitto:
mosquitto_pub -t home/MQTTto433/ -m 1315156
hello 1technophile.
yes i tried that command on my putty:
pi@hassbian: ~ § mosquitto_pub -t home/MQTTto433/ -m 1315156
and when a click enter show a new line like this:
pi@hassbian: ~ §
but on serial monitor shows only:
ȤlìÈãHø¬¬DzhÅ?üConnecting to
Casa
.
.
.
.
WiFi connected
client mqtt not connected, trying to connect
Attempting MQTT connection…
connected
subscription OK to
home/commands/#
i confirmed all the wires and everthing is ok, and the receiver works good because, i used it on older project that i had.
next step??
Open another command line and subscribe to home/# , republish your message and check if you see it on the first command line
you tell me on terminal 1 put:
mosquitto_sub -t home/#
and terminal 2 put:
mosquitto_pub -t home/MQTTto433/ -m 1315156
??
i try it and show me
pi@hassbian:~ $ mosquitto_sub -t home/#
1315156
but on terminal monitor not show
Do you have mosquitto or another broker installed ?you should see 1315156 on the terminal window where you subscribed
i have installed mosquitto… now i do another test… i put this line on terminal:
mosquitto_pub -t home/commands/rf -m 1315156
and now show me on SERIAL monitor:
Hey I got a callback
Receiving data by MQTT
home/commands/rf
1315156
Send received data by RF 433
1315156
now, what command i should put on terminal, when a press door bell to show me a code?
edit; i tried this line:
mosquitto_sub -t home/433toMQTT -v
but when i press the door bell not shows the code on serial monitor, my door bell is the same @masterkenobi he tested it and works,
whats wrong?
yes i saw that code on the terminal window.
How far it is from the receiver , try to put it closer
How about other sensors? Do you get any code when you trigger the sensor?
1technophile the receiver its very closer. I tested it with many distance.
The funny thing i tried the example rcswitch received sample code with my arduino and when i press button the code shows.
But if i follow your tutorial dont show anything.
Very strange.
And if you put into your arduino the receive example of rcswitch do you see something from your doorbell sensor?
Masterkenoby thanks for your support and attention too.
No…i tried door bell, 2 different door/windows sensors like yours and no…i dont get any code.
Yes if i try the sample receive code on (examples arduino) yes i can see codes of my door bell,and the other things like a doors/windows sensores.
But if a try with your code into my nodemcu…and put this like as you said:
mosquitto_sub -t home/433toMQTT -v
Nop…not show any codes on Serial Monitor.
Are you sure you subscribed to the correct topic? Try MQTT fx for windows and subscribe to topic # so that you can see all payloads in every topics receive by your MQTT broker.
When I get home I’m going to test it and I’ll tell you. When you test this for the first time it was also with the command: mosquitto_sub -t home / 433toMQTT -v ???
tell me what command you want me to put in this program that you tell me.subscribe what exactly?
When I get home I’m going to test it and I’ll tell you. When you test this for the first time it was also with the command: mosquitto_sub -t home / 433toMQTT -v ???
tell me what command you want me to put in this program that you tell me.subscribe what exactly?