3s1d / vlx2mqtt Goto Github PK
View Code? Open in Web Editor NEWpyvlx to MQTT glue
pyvlx to MQTT glue
Seems that an "import time" is missing
2021-12-28 03:23:59,362 Unexpected disconnection. Reconnecting in 5 seconds
Exception in thread Thread-1:
Traceback (most recent call last):
File "/usr/local/lib/python3.9/threading.py", line 954, in _bootstrap_inner
self.run()
File "/usr/local/lib/python3.9/threading.py", line 892, in run
self._target(*self._args, **self._kwargs)
File "/usr/local/lib/python3.9/site-packages/paho/mqtt/client.py", line 3452, in _thread_main
self.loop_forever(retry_first_connection=True)
File "/usr/local/lib/python3.9/site-packages/paho/mqtt/client.py", line 1779, in loop_forever
rc = self.loop(timeout, max_packets)
File "/usr/local/lib/python3.9/site-packages/paho/mqtt/client.py", line 1181, in loop
rc = self.loop_read(max_packets)
File "/usr/local/lib/python3.9/site-packages/paho/mqtt/client.py", line 1574, in loop_read
return self._loop_rc_handle(rc)
File "/usr/local/lib/python3.9/site-packages/paho/mqtt/client.py", line 2227, in _loop_rc_handle
self._do_on_disconnect(rc, properties)
File "/usr/local/lib/python3.9/site-packages/paho/mqtt/client.py", line 3360, in _do_on_disconnect
self.on_disconnect(self, self._userdata, rc)
File "/vlx2mqtt.py", line 128, in mqtt_on_disconnect
time.sleep(5)
NameError: name 'time' is not defined
Hi nice work :)
Just a problem for me only the status connected/disconnected is publish:
My logs looks like this:
2019-04-28 14:12:41,521 Starting vlx2mqtt
2019-04-28 14:12:41,522 DEBUG MODE
2019-04-28 14:12:41,522 Using selector: EpollSelector
2019-04-28 14:12:41,523 klf200 : klf200
2019-04-28 14:12:41,523 MQTT broker : 10.0.0.25
2019-04-28 14:12:41,523 port : 1883
2019-04-28 14:12:41,523 statustopic : /vlx2mqtt/status
2019-04-28 14:12:41,523 Connecting to KLF 200.
2019-04-28 14:12:45,796 Connected to: KLF 200: Software version: 0.2.0.0.71.0, hardware version: 5, protocol version: 3.14
2019-04-28 14:12:49,459 vlx nodes : 4
2019-04-28 14:12:49,459 Volet roulant cour
2019-04-28 14:12:49,459 Fenêtre cour
2019-04-28 14:12:49,459 Fenêtre jardin
2019-04-28 14:12:49,459 Volet roulant jardin
2019-04-28 14:12:49,460 Connected to 10.0.0.25:1883
2019-04-28 14:12:49,460 Subscribing to Volet roulant cour/set
2019-04-28 14:12:49,460 Subscribing to Fenêtre cour/set
2019-04-28 14:12:49,460 Subscribing to Fenêtre jardin/set
2019-04-28 14:12:49,460 Subscribing to Volet roulant jardin/set
2019-04-28 14:12:50,462 watching: Volet roulant cour
2019-04-28 14:12:50,462 watching: Fenêtre cour
2019-04-28 14:12:50,462 watching: Fenêtre jardin
2019-04-28 14:12:50,462 watching: Volet roulant jardin
2019-04-28 14:13:10,538 Fenêtre cour at 100%
2019-04-28 14:13:10,632 Fenêtre cour at 100%
2019-04-28 14:14:49,980 Volet roulant cour at 0%
2019-04-28 14:14:51,032 Fenêtre cour at 100%
2019-04-28 14:14:52,108 Fenêtre jardin at 100%
2019-04-28 14:14:53,185 Volet roulant jardin at 0%
2019-04-28 14:17:01,130 Exiting on signal 2
2019-04-28 14:17:01,739 Disconnecting from broker
2019-04-28 14:17:01,740 Clean disconnection
And mosquittos logs:
Client mosqsub/27867-mosquito sending PINGREQ
Client mosqsub/27867-mosquito received PINGRESP
Client mosqsub/27867-mosquito received PUBLISH (d0, q0, r0, m0, '/vlx2mqtt/status', ... (9 bytes))
/vlx2mqtt/status CONNECTED
Client mosqsub/27867-mosquito sending PINGREQ
Client mosqsub/27867-mosquito received PINGRESP
Client mosqsub/27867-mosquito received PUBLISH (d0, q0, r0, m0, '/vlx2mqtt/status', ... (12 bytes))
/vlx2mqtt/status DISCONNECTED
Could the space in node names or the 'ê' be the problem?
going to open another issue for another use case :)
Publishing 2 value at the same time i got:
Connected to: KLF 200: Software version: 0.2.0.0.71.0, hardware version: 5, protocol version: 3.14
Traceback (most recent call last):
File "vlx2mqtt.py", line 196, in <module>
LOOP.run_until_complete(main(LOOP))
File "/usr/lib/python3.5/asyncio/base_events.py", line 466, in run_until_complete
return future.result()
File "/usr/lib/python3.5/asyncio/futures.py", line 293, in result
raise self._exception
File "/usr/lib/python3.5/asyncio/tasks.py", line 239, in _step
result = coro.send(None)
File "vlx2mqtt.py", line 174, in main
for name, value in nodes.items():
RuntimeError: dictionary changed size during iteration
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.