-
Notifications
You must be signed in to change notification settings - Fork 28
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 packet is always {} #10
Comments
Hi Kevin, if you are using other BACnet sniffer tools like YABE on the same PC, where you run the BACnet2MQTT gateway, make sure you close them all before running npm start. Regarding the publishing format: You can edit the publish_msg in mqtt_client.js to your desire. E.g., you can publish each BACnet object on a separate topic. For example like this:
Matthias |
Thanks Matthias, that was helpful. I still don't read any objects and the web interface still doesn't work but there is some progress in mqtt. |
I wasn't successful with the web interface either. I'm just editing the "baspi.json" with my bacnet objects: Enter the IP of the BACnet device you want to read from. Add the BACnet objects, which you want to read. You can use tools like YABE to figure out the objects you want to read: |
@magicmatt007 thanks, can you please file an PR and we can add this into the readme. And if you find bugs, pls contribute the fix. We built this stack some time ago on customer needs. We are happy to look into improvements :) |
could I
could I be cheeky and ask for your mosquitto config for this? I am battling to get the formatting right... many many thanks |
Any chance that you still keep the mosquito config file? |
Can you post the code for the modified mqtt_client.js? |
I know support for mqtt other than infinimesh is limited.
I modified the mqtt_client.js to run on mosquito with username and password authentication.
However, with several different bacnet devices, all I get is empty {} messages to mqtt on a weird subscription. devices/0x132/state/reported/delta
which seems hardwired into the code and doesn't make much sense to me. I'm mostly a poke and try coder and I don't fully understand bacnet-stack.
I can read the bacnet OK with other apps including node-red. I think I have the correct type and instances in the config file.
Also, the web server doesn't seem to work. I get the main screen for "who is" and "object" but nothing happens when I click the buttons. The REST API doesn't work either.
So is this so totally entwined with infinimesh that it is hopeless to try to fix it?
I think there are others who would like to use this gateway with their existing setup.
Kevin
pi@pi3:~/bacnet-mqtt-gateway $ npm start
{"level":"info","message":"Gateway server listening on port 8083","timestamp":"2020-12-20 21:57:39"}
{"level":"info","message":"Device configs found: baspi.json,baspi1.json,baspi2.json","timestamp":"2020-12-20 21:57:39"}
{"level":"info","message":"Client connected","timestamp":"2020-12-20 21:57:39"}
{"level":"info","message":"Schedule polling for device 10.0.1.32 with expression */3 * * * * *","timestamp":"2020-12-20 21:57:39"}
{"level":"info","message":"Schedule polling for device 10.0.1.150 with expression */3 * * * * *","timestamp":"2020-12-20 21:57:39"}
{"level":"info","message":"Schedule polling for device 10.0.1.150 with expression */3 * * * * *","timestamp":"2020-12-20 21:57:39"}
{"level":"info","message":"Fetching device object values","timestamp":"2020-12-20 21:57:42"}
{"level":"info","message":"Fetching device object values","timestamp":"2020-12-20 21:57:42"}
{"level":"info","message":"Sending actuals for device 10.0.1.150 to IoT Hub","timestamp":"2020-12-20 21:57:42"}
{"level":"info","message":"{}","timestamp":"2020-12-20 21:57:42"}
{"level":"info","message":"Publish message to MQTT Broker","timestamp":"2020-12-20 21:57:42"}
{"level":"info","message":"Sending actuals for device 10.0.1.150 to IoT Hub","timestamp":"2020-12-20 21:57:42"}
{"level":"info","message":"{}","timestamp":"2020-12-20 21:57:42"}
{"level":"info","message":"Publish message to MQTT Broker","timestamp":"2020-12-20 21:57:42"}
{"level":"info","message":"Fetching device object values","timestamp":"2020-12-20 21:57:42"}
{"level":"info","message":"Fetching device object values","timestamp":"2020-12-20 21:57:45"}
{"level":"info","message":"Fetching device object values","timestamp":"2020-12-20 21:57:45"}
{"level":"info","message":"Fetching device object values","timestamp":"2020-12-20 21:57:45"}
{"level":"info","message":"Sending actuals for device 10.0.1.150 to IoT Hub","timestamp":"2020-12-20 21:57:45"}
{"level":"info","message":"{}","timestamp":"2020-12-20 21:57:45"}
{"level":"info","message":"Publish message to MQTT Broker","timestamp":"2020-12-20 21:57:45"}
{"level":"info","message":"Sending actuals for device 10.0.1.150 to IoT Hub","timestamp":"2020-12-20 21:57:45"}
{"level":"info","message":"{}","timestamp":"2020-12-20 21:57:45"}
{"level":"info","message":"Publish message to MQTT Broker","timestamp":"2020-12-20 21:57:45"}
{"level":"info","message":"Sending actuals for device 10.0.1.32 to IoT Hub","timestamp":"2020-12-20 21:57:45"}
{"level":"info","message":"{}","timestamp":"2020-12-20 21:57:45"}
{"level":"info","message":"Publish message to MQTT Broker","timestamp":"2020-12-20 21:57:45"}
{"level":"info","message":"Fetching device object values","timestamp":"2020-12-20 21:57:48"}
{"level":"info","message":"Fetching device object values","timestamp":"2020-12-20 21:57:48"}
{"level":"info","message":"Sending actuals for device 10.0.1.32 to IoT Hub","timestamp":"2020-12-20 21:57:48"}
{"level":"info","message":"{}","timestamp":"2020-12-20 21:57:48"}
{"level":"info","message":"Publish message to MQTT Broker","timestamp":"2020-12-20 21:57:48"}
{"level":"info","message":"Fetching device object values","timestamp":"2020-12-20 21:57:48"}
{"level":"info","message":"Sending actuals for device 10.0.1.150 to IoT Hub","timestamp":"2020-12-20 21:57:48"}
{"level":"info","message":"{}","timestamp":"2020-12-20 21:57:48"}
{"level":"info","message":"Publish message to MQTT Broker","timestamp":"2020-12-20 21:57:48"}
{"level":"info","message":"Sending actuals for device 10.0.1.150 to IoT Hub","timestamp":"2020-12-20 21:57:48"}
{"level":"info","message":"{}","timestamp":"2020-12-20 21:57:48"}
{"level":"info","message":"Publish message to MQTT Broker","timestamp":"2020-12-20 21:57:48"}
{"level":"info","message":"Fetching device object values","timestamp":"2020-12-20 21:57:51"}
{"level":"info","message":"Fetching device object values","timestamp":"2020-12-20 21:57:51"}
{"level":"info","message":"Fetching device object values","timestamp":"2020-12-20 21:57:51"}
{"level":"info","message":"Sending actuals for device 10.0.1.150 to IoT Hub","timestamp":"2020-12-20 21:57:51"}
{"level":"info","message":"{}","timestamp":"2020-12-20 21:57:51"}
{"level":"info","message":"Publish message to MQTT Broker","timestamp":"2020-12-20 21:57:51"}
{"level":"info","message":"Sending actuals for device 10.0.1.32 to IoT Hub","timestamp":"2020-12-20 21:57:51"}
{"level":"info","message":"{}","timestamp":"2020-12-20 21:57:51"}
{"level":"info","message":"Publish message to MQTT Broker","timestamp":"2020-12-20 21:57:51"}
{"level":"info","message":"Sending actuals for device 10.0.1.150 to IoT Hub","timestamp":"2020-12-20 21:57:51"}
{"level":"info","message":"{}","timestamp":"2020-12-20 21:57:51"}
{"level":"info","message":"Publish message to MQTT Broker","timestamp":"2020-12-20 21:57:51"}
^C
The text was updated successfully, but these errors were encountered: