I used this plugin for quite some time now and it works great. Recentely is installed a new Raspberry pi (and did a clean install of Domoticz and all the plugins). But now the plugin does not want to work.
I followed all the steps, but when I tried to test / start the server:
I get the following error:
Job for miio_server.service failed because the control process exited with error code.
See "systemctl status miio_server.service" and "journalctl -xe" for details.
When I check 'systemctl' the following appears:
● miio_server.service - LSB: MIIO Server
Loaded: loaded (/etc/init.d/miio_server; generated; vendor preset: enabled)
Active: failed (Result: exit-code) since Sun 2019-04-28 19:39:35 CEST; 34s ago
Docs: man:systemd-sysv-generator(8)
Process: 25776 ExecStart=/etc/init.d/miio_server start (code=exited, status=1/FAILURE)
Apr 28 19:39:35 raspberrypi systemd[1]: Starting LSB: MIIO Server...
Apr 28 19:39:35 raspberrypi miio_server[25776]: File "/etc/init.d/miio_server", line 14
Apr 28 19:39:35 raspberrypi miio_server[25776]: PATH=/sbin:/bin:/usr/sbin:/usr/bin:/usr/local/bin
Apr 28 19:39:35 raspberrypi miio_server[25776]: ^
Apr 28 19:39:35 raspberrypi miio_server[25776]: SyntaxError: invalid syntax
Apr 28 19:39:35 raspberrypi systemd[1]: miio_server.service: Control process exited, code=exited status=1
Apr 28 19:39:35 raspberrypi systemd[1]: Failed to start LSB: MIIO Server.
Apr 28 19:39:35 raspberrypi systemd[1]: miio_server.service: Unit entered failed state.
Apr 28 19:39:35 raspberrypi systemd[1]: miio_server.service: Failed with result 'exit-code'.
There is an SyntaxError in the file, but on a line that I haven't changed.
The miio_server is below:
#!/home/pi/domoticz/plugins/xiaomi-mirobot/.env/bin/python3
### BEGIN INIT INFO
# Author: mrin
# Provides: miio_server
# Required-Start:
# Required-Stop:
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: MIIO Server
# Description: This daemon will start MIIO Server
### END INIT INFO
NAME="MIIO Server"
PATH=/sbin:/bin:/usr/sbin:/usr/bin:/usr/local/bin
SCRIPTNAME=/etc/init.d/miio_server
PIDFILE=/var/run/miio_server.pid
DAEMON_USER=root
DAEMON=/home/pi/domoticz/plugins/xiaomi-mirobot/miio_server.py
DAEMON_ARGS="192.168.0.193 364b546f737678505353374d496e3255"
DAEMON_ARGS="$DAEMON_ARGS --host 127.0.0.1 --port 22222"
I have the following versions:
ython3 is already the newest version (3.5.3-1).
python3-dev is already the newest version (3.5.3-1).
python3-pip is already the newest version (9.0.1-2+rpt2).
libffi-dev is already the newest version (3.2.1-6).
libssl-dev is already the newest version (1.1.0j-1~deb9u1).
Plugin: Last version from Github
Domoticz; Stable 4.9700
The strange thing is, when I test the function with:
Code: Select all
sudo ./miio_server.py 192.168.0.193 364b546f737678505353374d496e3255 --host 127.0.0.1 --port 22222
It seems to work:
sudo ./miio_server.py 192.168.0.193 364b546f737678505353374d496e3255 --host 127.0.0.1 --port 22222
server: Starting server on 127.0.0.1 22222
server: connected ('127.0.0.1', 48294)
server: got socket msg: ['consumable_status']
server: got socket msg: ['status']
Unable to discover a device at address 192.168.0.193
server: vac result {'cmd': 'consumable_status', 'exception': 'python-miio: Unable to discover the device 192.168.0.193'}
server: send reply ('127.0.0.1', 48294)
Unable to discover a device at address 192.168.0.193
server: vac result {'cmd': 'status', 'exception': 'python-miio: Unable to discover the device 192.168.0.193'}
server: send reply ('127.0.0.1', 48294)
server: got socket msg: ['status']
server: vac result {'cmd': 'status', 'clean_area': 1.64, 'state_code': 8, 'clean_seconds': 0, 'battery': 100, 'error': None, 'fan_level': 77}
server: send reply ('127.0.0.1', 48294)
Has anybody an idea what is wrong?
Edit: I have found a workout. I used the script provided in:
https://www.domoticz.com/forum/viewtopi ... 29#p183929 and now it works again.