try to set lower "Update interval" - in my case - 15s
if I remember correctly there are some limitations in domotics plugin framework for timeout
Moderator: leecollings
try to set lower "Update interval" - in my case - 15s
Code: Select all
sudo ./miio_server.py 192.168.10.32 374b473361794f4b66566c5745794944 --host 127.0.0.1 --port 22222
Traceback (most recent call last):
File "./miio_server.py", line 18, in <module>
from miio import Vacuum, DeviceException
File "/usr/local/lib/python3.7/dist-packages/miio/__init__.py", line 2, in <module>
from miio.airconditioningcompanion import (
File "/usr/local/lib/python3.7/dist-packages/miio/airconditioningcompanion.py", line 8, in <module>
from .device import Device, DeviceException
File "/usr/local/lib/python3.7/dist-packages/miio/device.py", line 14, in <module>
from .protocol import Message
File "/usr/local/lib/python3.7/dist-packages/miio/protocol.py", line 206, in <module>
Const(0x2131, Int16ub),
File "/usr/local/lib/python3.7/dist-packages/construct/core.py", line 1930, in __init__
super(Const, self).__init__(subcon)
File "/usr/local/lib/python3.7/dist-packages/construct/core.py", line 288, in __init__
raise TypeError("subcon should be a Construct field")
TypeError: subcon should be a Construct field
Code: Select all
mirobo --ip 192.168.10.32 --token 374b473361794f4b66566c5745794944 start
Starting cleaning: ['ok']
Code: Select all
domoticz@domoticz:/domoticz/plugins/xiaomi-mirobot$ sudo ./miio_server.py xxx.xxx.xxx.xxx KEY --host 127.0.0.1 --port 22222
Traceback (most recent call last):
File "./miio_server.py", line 17, in <module>
from miio import Vacuum, DeviceException
File "/usr/local/lib/python3.7/dist-packages/miio/__init__.py", line 2, in <module>
from miio.airconditioningcompanion import (
File "/usr/local/lib/python3.7/dist-packages/miio/airconditioningcompanion.py", line 8, in <module>
from .device import Device, DeviceException
File "/usr/local/lib/python3.7/dist-packages/miio/device.py", line 14, in <module>
from .protocol import Message
File "/usr/local/lib/python3.7/dist-packages/miio/protocol.py", line 206, in <module>
Const(0x2131, Int16ub),
File "/usr/local/lib/python3.7/dist-packages/construct/core.py", line 1930, in __init__
super(Const, self).__init__(subcon)
File "/usr/local/lib/python3.7/dist-packages/construct/core.py", line 288, in __init__
raise TypeError("subcon should be a Construct field")
TypeError: subcon should be a Construct field
Code: Select all
2020-03-31 17:01:31.504 Error: (xiaomi-mi-robot-vacuum) failed to load 'plugin.py', Python Path used was '/home/pi/domoticz/plugins/xiaomi-mirobot/:/usr/lib/python37.zip:/usr/lib/python3.7:/usr/lib/python3.7/lib-dynload:/usr/local/lib/python3.7/dist-packages:/usr/lib/python3/dist-packages:/usr/lib/python3.7/dist-packages'.
2020-03-31 17:01:31.504 Error: (Sylvain) Module Import failed, exception: 'AttributeError'
2020-03-31 17:01:31.505 Error: (Sylvain) Error Line details not available.
Code: Select all
test: python modules path: ./.env/lib/python3.5/site-packages
test: python modules path: ./.env/lib/python3.7/site-packages
test: trying connect to 127.0.0.1:22222
test: sent request to server [status]
test: reading response...
test: got server reply {'exception': 'python-miio: No response from the device', 'cmd': 'status'}
Yes, same problem here. I had a working system and since a week this error occurs.bueno79 wrote: ↑Tuesday 31 March 2020 17:14 so now miio-server.sh can run, I can add the roborock in Domoticz and see switch. But I get this in domoticz logs :
Code: Select all
2020-03-31 17:01:31.504 Error: (xiaomi-mi-robot-vacuum) failed to load 'plugin.py', Python Path used was '/home/pi/domoticz/plugins/xiaomi-mirobot/:/usr/lib/python37.zip:/usr/lib/python3.7:/usr/lib/python3.7/lib-dynload:/usr/local/lib/python3.7/dist-packages:/usr/lib/python3/dist-packages:/usr/lib/python3.7/dist-packages'. 2020-03-31 17:01:31.504 Error: (Sylvain) Module Import failed, exception: 'AttributeError' 2020-03-31 17:01:31.505 Error: (Sylvain) Error Line details not available.
Code: Select all
sudo nano /etc/systemd/system/[email protected]
Andyf66 wrote: ↑Tuesday 19 June 2018 15:44Code: Select all
[Unit] Description=Xiaomi Mi Robovac service - %i After=network.target [Service] PrivateTmp=true Type=service EnvironmentFile=/etc/systemd/user/%i ExecStart=/home/pi/domoticz/plugins/xiaomi-mirobot/miio_server.py $RUN_OPTS [Install] WantedBy=multi-user.target
Code: Select all
sudo chmod 644 /etc/systemd/system/[email protected]
cd /etc/systemd/user/
sudo nano xiaomi-downstairs-vac
Add to startup:Andyf66 wrote: ↑Tuesday 19 June 2018 15:44Code: Select all
RUN_OPTS=192.168.200.240 4764677338476464578459486a6a4e6f --host 127.0.0.1 --port 22222
Code: Select all
sudo systemctl daemon-reload
sudo systemctl enable [email protected]
sudo systemctl start [email protected]
Code: Select all
systemctl status [email protected]
Tried it, still the same error:
Code: Select all
● [email protected] - Xiaomi Mi Robovac service - xiaomi-downstairs-vac
Loaded: loaded (/etc/systemd/system/[email protected]; enabled; vendor preset: enabled)
Active: failed (Result: exit-code) since Sat 2020-04-04 16:04:48 CEST; 7s ago
Process: 31975 ExecStart=/domoticz/plugins/xiaomi-mirobot/miio_server.py $RUN_OPTS (code=exited, status=1/FAILURE)
Main PID: 31975 (code=exited, status=1/FAILURE)
Apr 04 16:04:48 domoticz miio_server.py[31975]: from miio.chuangmi_ir import ChuangmiIr
Apr 04 16:04:48 domoticz miio_server.py[31975]: File "/usr/local/lib/python3.7/dist-packages/miio/chuangmi_ir.py", line 190, in <module>
Apr 04 16:04:48 domoticz miio_server.py[31975]: Const(0xA567, Int16ul),
Apr 04 16:04:48 domoticz miio_server.py[31975]: File "/usr/local/lib/python3.7/dist-packages/construct/core.py", line 1930, in __init__
Apr 04 16:04:48 domoticz miio_server.py[31975]: super(Const, self).__init__(subcon)
Apr 04 16:04:48 domoticz miio_server.py[31975]: File "/usr/local/lib/python3.7/dist-packages/construct/core.py", line 288, in __init__
Apr 04 16:04:48 domoticz miio_server.py[31975]: raise TypeError("subcon should be a Construct field")
Apr 04 16:04:48 domoticz miio_server.py[31975]: TypeError: subcon should be a Construct field
Apr 04 16:04:48 domoticz systemd[1]: [email protected]: Main process exited, code=exited, status=1/FAILURE
Apr 04 16:04:48 domoticz systemd[1]: [email protected]: Failed with result 'exit-code'.
Code: Select all
android-backup==0.1.0
asn1crypto==0.23.0
attrs==17.2.0
cffi==1.11.2
click==6.7
construct==2.9.31
cryptography==2.1.3
enum-compat==0.0.2
gevent==1.4.0
greenlet==0.4.15
idna==2.6
msgpack-python==0.4.8
netifaces==0.10.6
pretty-cron==1.0.2
pycparser==2.18
pycrypto==2.6.1
python-miio==0.4.4
pytz==2017.3
six==1.11.0
typing==3.6.2
zeroconf==0.19.1
Code: Select all
2020-04-13 17:36:32.424 Error: (xiaomi-mi-robot-vacuum) failed to load 'plugin.py', Python Path used was '/domoticz/plugins/xiaomi-mirobot/:/usr/lib/python37.zip:/usr/lib/python3.7:/usr/lib/python3.7/lib-dynload:/usr/local/lib/python3.7/dist-packages:/usr/lib/python3/dist-packages:/usr/lib/python3.7/dist-packages'.
2020-04-13 17:36:32.424 Error: (Dusty) Module Import failed, exception: 'AttributeError'
2020-04-13 17:36:32.424 Error: (Dusty) Error Line details not available.
Code: Select all
test: python modules path: ././.env/lib/python3.7/site-packages
test: trying connect to 127.0.0.1:22222
test: sent request to server [status]
test: reading response...
./test.py:28: DeprecationWarning: encoding is deprecated, Use raw=False instead.
unpacker = Unpacker(encoding='utf-8')
test: got server reply {'exception': 'python-miio: ', 'cmd': 'status'}
Code: Select all
server: Starting server on 127.0.0.1 22222
server: connected ('127.0.0.1', 46402)
./miio_server.py:67: DeprecationWarning: encoding is deprecated, Use raw=False instead.
unpacker = Unpacker(encoding='utf-8')
server: got socket msg: ['status']
Got error when receiving: timed out
Retrying with incremented id, retries left: 3
Got error when receiving: timed out
Retrying with incremented id, retries left: 2
server: got socket msg: ['status']
Got error when receiving: timed out
Retrying with incremented id, retries left: 1
Got error when receiving: timed out
Code: Select all
2020-05-25 21:01:30.827 (Robot stofzuiger) Pushing 'ReadEvent' on to queue
2020-05-25 21:01:30.832 (Robot stofzuiger) Processing 'ReadEvent' message
2020-05-25 21:01:30.832 (Robot stofzuiger) Received 36 bytes of data
2020-05-25 21:01:30.832 (Robot stofzuiger) 82 a9 65 78 63 65 70 74 69 6f 6e ad 70 79 74 68 6f 6e 2d 6d ©exceptionͰython-m
2020-05-25 21:01:30.832 (Robot stofzuiger) 69 69 6f 3a 20 a3 63 6d 64 a6 73 74 61 74 75 73 .. .. .. .. iio:.ãmdƳtatus
2020-05-25 21:01:30.832 (Robot stofzuiger) Pushing 'onMessageCallback' on to queue
2020-05-25 21:01:30.832 (Robot stofzuiger) Processing 'onMessageCallback' message
2020-05-25 21:01:30.832 (Robot stofzuiger) Calling message handler 'onMessage'.
2020-05-25 21:01:30.833 (Robot stofzuiger) Got: {'exception': 'python-miio: ', 'cmd': 'status'}
2020-05-25 21:01:34.774 (Robot stofzuiger) Pushing 'onHeartbeatCallback' on to queue
2020-05-25 21:01:34.791 (Robot stofzuiger) Processing 'onHeartbeatCallback' message
2020-05-25 21:01:34.791 (Robot stofzuiger) Calling message handler 'onHeartbeat'.
2020-05-25 21:01:34.792 (Robot stofzuiger) Pushing 'WriteDirective' on to queue
2020-05-25 21:01:34.792 (Robot stofzuiger) Processing 'WriteDirective' message
2020-05-25 21:01:34.792 (Robot stofzuiger) Sending 8 bytes of data
2020-05-25 21:01:34.792 (Robot stofzuiger) 91 a6 73 74 61 74 75 73 .. .. .. .. .. .. .. .. .. .. .. .. Ѧstatus
Does no one has an idea how to fix this issue?JanvdW wrote: ↑Monday 25 May 2020 21:19 I have installed the plugin on my RPI4 with Domoticz 2020.2 (build 12067), everything seems to be there, but I don't get it working.
When I run 'sudo ./test.py' I get:Then I stopped the service and manually started the script with 'sudo ./miio_server.py <ip address> token> --host 127.0.0.1 --port 22222' and got:Code: Select all
test: python modules path: ././.env/lib/python3.7/site-packages test: trying connect to 127.0.0.1:22222 test: sent request to server [status] test: reading response... ./test.py:28: DeprecationWarning: encoding is deprecated, Use raw=False instead. unpacker = Unpacker(encoding='utf-8') test: got server reply {'exception': 'python-miio: ', 'cmd': 'status'}
In the Domoticz log (with 'debug = true') I get:Code: Select all
server: Starting server on 127.0.0.1 22222 server: connected ('127.0.0.1', 46402) ./miio_server.py:67: DeprecationWarning: encoding is deprecated, Use raw=False instead. unpacker = Unpacker(encoding='utf-8') server: got socket msg: ['status'] Got error when receiving: timed out Retrying with incremented id, retries left: 3 Got error when receiving: timed out Retrying with incremented id, retries left: 2 server: got socket msg: ['status'] Got error when receiving: timed out Retrying with incremented id, retries left: 1 Got error when receiving: timed out
Any ideas what's wrong?Code: Select all
2020-05-25 21:01:30.827 (Robot stofzuiger) Pushing 'ReadEvent' on to queue 2020-05-25 21:01:30.832 (Robot stofzuiger) Processing 'ReadEvent' message 2020-05-25 21:01:30.832 (Robot stofzuiger) Received 36 bytes of data 2020-05-25 21:01:30.832 (Robot stofzuiger) 82 a9 65 78 63 65 70 74 69 6f 6e ad 70 79 74 68 6f 6e 2d 6d ©exceptionͰython-m 2020-05-25 21:01:30.832 (Robot stofzuiger) 69 69 6f 3a 20 a3 63 6d 64 a6 73 74 61 74 75 73 .. .. .. .. iio:.ãmdƳtatus 2020-05-25 21:01:30.832 (Robot stofzuiger) Pushing 'onMessageCallback' on to queue 2020-05-25 21:01:30.832 (Robot stofzuiger) Processing 'onMessageCallback' message 2020-05-25 21:01:30.832 (Robot stofzuiger) Calling message handler 'onMessage'. 2020-05-25 21:01:30.833 (Robot stofzuiger) Got: {'exception': 'python-miio: ', 'cmd': 'status'} 2020-05-25 21:01:34.774 (Robot stofzuiger) Pushing 'onHeartbeatCallback' on to queue 2020-05-25 21:01:34.791 (Robot stofzuiger) Processing 'onHeartbeatCallback' message 2020-05-25 21:01:34.791 (Robot stofzuiger) Calling message handler 'onHeartbeat'. 2020-05-25 21:01:34.792 (Robot stofzuiger) Pushing 'WriteDirective' on to queue 2020-05-25 21:01:34.792 (Robot stofzuiger) Processing 'WriteDirective' message 2020-05-25 21:01:34.792 (Robot stofzuiger) Sending 8 bytes of data 2020-05-25 21:01:34.792 (Robot stofzuiger) 91 a6 73 74 61 74 75 73 .. .. .. .. .. .. .. .. .. .. .. .. Ѧstatus
Hihi, yes i have
Code: Select all
# and then:
pip3 install -r pip_req.txt
# or pip3 install gevent msgpack-python python-miio==0.3.1
Code: Select all
android-backup==0.1.0
asn1crypto==0.23.0
attrs==17.2.0
cffi==1.11.2
click==6.7
construct==2.9.31
cryptography==2.1.3
enum-compat==0.0.2
gevent==1.4.0
greenlet==0.4.15
idna==2.6
msgpack-python==0.4.8
netifaces==0.10.6
pretty-cron==1.0.2
pycparser==2.18
pycrypto==2.6.1
python-miio==0.4.4
pytz==2017.3
six==1.11.0
typing==3.6.2
zeroconf==0.19.1
Code: Select all
# and then:
pip3 install -r pip_req.txt
# or pip3 install gevent msgpack-python python-miio==0.3.1
Could you check if msgpack is correctly installed?
Users browsing this forum: No registered users and 1 guest