-
Notifications
You must be signed in to change notification settings - Fork 41
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
MQTT subscription not working #23
Comments
I saw your comment, long ago when i just started going the path of this project, but at the time i understood nothing about this issue, now that i have solved the problem in the same way, i gave you a thumb up for your solution. i wish i could understand it before. another part i had to change in the code of Gateway.c, is where a recieved message from mosquitto is scanned with the missing part of the sensor ID, leading to sending a message to DeviceID=0, and not the correct one. |
in this issue comments by JojoS62 and myself, are now incorporated in this update. comment by JojoS62: Is this the actual version? I found the MQTT subscription is not working, the topic is not valid: sprintf(subsciptionMask, "%s/%03d/#/down", MQTT_ROOT, theConfig.networkId); The /down part is not allowed after the /#, but an /+ is ok. When the SensorID is appended then the correct topic name is: "%s/%03d/+/down/+" and then by me: another part i had to change in the code of Gateway.c, is where a recieved message from mosquitto is scanned with the missing part of the sensor ID, leading to sending a message to DeviceID=0, and not the correct one. had to change 2 lines from: sscanf(msg->topic, "RFM/%d/%d/%d", &network, &data.nodeID, &data.sensorID); to: sscanf(msg->topic, "RFM/%d/%d/down/%d", &network, &data.nodeID, &data.sensorID);
Hi i go with the tutorial and everything work perfect but still idk where i can define actual data to send , do i must make different file too send it or edit some attached file ? |
The p^rocess monitor the MQTT server an look for notification on its channel (RFM/....). You need to publish on the same MQTT server on the appropriate topic and the information will be carried by the system. |
Is this the actual version? I found the MQTT subscription is not working, the topic is not valid:
sprintf(subsciptionMask, "%s/%03d/#/down", MQTT_ROOT, theConfig.networkId);
The /down part is not allowed after the /#, but an /+ is ok. When the SensorID is appended then the correct topic name is: "%s/%03d/+/down/+"
I've modified the fork for sending and receiving strings, that works also fine.
Thanks for sharing your code.
The text was updated successfully, but these errors were encountered: