Mqtt setup for 1 wire ds18b20 sensors - Printable Version +- OpenMarine (https://forum.openmarine.net) +-- Forum: OpenPlotter (https://forum.openmarine.net/forumdisplay.php?fid=1) +--- Forum: How do I...? (https://forum.openmarine.net/forumdisplay.php?fid=3) +--- Thread: Mqtt setup for 1 wire ds18b20 sensors (/showthread.php?tid=70) |
Mqtt setup for 1 wire ds18b20 sensors - PaddyB - 2016-04-28 What do I put into the short and topic fields so ds18b20 sensor data will get send over mqtt? I know the answer is in the web somewhere, I've had it working before, just can't find it now. Thanks Sent from my SGP511 using Tapatalk RE: Mqtt setup for 1 wire ds18b20 sensors - Sailoog - 2016-04-28 1W Short: sensor1 MQTT topic: temp/coolant ACTIONS Trigger: None (always true) Action:
RE: Mqtt setup for 1 wire ds18b20 sensors - PaddyB - 2016-04-28 Great, back in again. Thanks. Sent from my SGP511 using Tapatalk RE: Mqtt setup for 1 wire ds18b20 sensors - davidec - 2016-05-03 Hi Sailoog, I verified this case using a frequence of 60 secs, but seems that for each event mqtt receives 2 messages. Moreover for each message it is opened a new TCP socket. In this way I have a lot of tcp sockets opened (those sockets are closed only by timeout condition) Is it the behaviour expected? Checking configuration and logs I have: ds18b20 = [['18DS20std', 't18std0', 'C', '000003e16e42', '1W0', '1'], ['18DS20imp', 't18imp2', 'C', '800000035457', '1W1', '1'], ['intDSstd4', 't18std4', 'C', '000003e13053', '1W2', '1']] topics = [['tmp', 'temp/int4', 'MQTT0']] triggers = [[1, -1, -1, -1, [['HOUT0', '', 0.0, 0]]], [1, -1, -1, -1, [['MQTT0', '[t18std4]', 1.0, 2]]]] from mosquitto.log: 1462282427: New connection from 127.0.0.1 on port 1883. 1462282427: New client connected from 127.0.0.1 as paho/0D56FD3D31FE699C3A (c1, k60, umqttpi). 1462282427: New connection from 127.0.0.1 on port 1883. 1462282427: New client connected from 127.0.0.1 as paho/46C1713D7C0F644F27 (c1, k60, umqttpi). ... 1462283479: Socket error on client paho/373C43968871DDD006, disconnecting. 1462283479: Socket error on client paho/5D9F2F7DC7D704C251, disconnecting. Thanks in advance Davide RE: Mqtt setup for 1 wire ds18b20 sensors - Sailoog - 2016-05-03 Yes, we set 2 brokers, local and remote, so each event could be received by clients connected to remote server and clients connected to OP server simultaneously. We are using the publish.single function: https://github.com/eclipse/paho.mqtt.python#single Quote:Publish a single message to a broker, then disconnect cleanly Do you think this is not happening? RE: Mqtt setup for 1 wire ds18b20 sensors - davidec - 2016-05-04 (2016-05-03, 05:54 PM)Sailoog Wrote: Yes, we set 2 brokers, local and remote, so each event could be received by clients connected to remote server and clients connected to OP server simultaneously. Opps, my mistake, I didn't read your code and I configured remote broker as local.... About timeout tcp socket it seems the keepalive option doesn't work very well, I need to double check the log. Thanks Davide RE: Mqtt setup for 1 wire ds18b20 sensors - Sailoog - 2016-05-04 This happens because we don't have a good documentation I hope to have time after v0.8.0 release. You are right, keepalive variations doesn't make change, it doesn't work or we are misunderstanding its purpose. AFAIK you can define timeout when make a normal connection but not in publish.single function. Anyway, after doing some test, my number of sockets is high but stable, they born and die, and it seems that doesn't affect performance. Many of open sockets belong to kplex and internal OP jobs (sensors, calculations...). I need to test with a really high number of mqtt topics and publications to see if the system endures or we have to change strategy. Thanks Davide, you are being really helpful debugging OP |