Skip to content
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

Open
JojoS62 opened this issue Jan 2, 2017 · 3 comments
Open

MQTT subscription not working #23

JojoS62 opened this issue Jan 2, 2017 · 3 comments

Comments

@JojoS62
Copy link

JojoS62 commented Jan 2, 2017

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.

@davidabek1
Copy link

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.
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);

davidabek1 added a commit to davidabek1/HomeAutomation that referenced this issue Apr 15, 2017
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);
@sanchezz2
Copy link

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 ?

@abouillot
Copy link
Owner

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants