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

Upd Gateway.c -MQTT subscription not working #23 #24

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

davidabek1
Copy link

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

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

Successfully merging this pull request may close these issues.

1 participant