You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Describe the bug
Firmware update fails with python error Broken pipe, after various progress, sometimes almost immediately, sometimes after +20% uploaded.
Version information (please complete the following information):
File "/Users/XXXXXX/flasher/venv/lib/python3.9/site-packages/miio/updater.py", line 30, in handle_one_request
self.wfile.write(self.payload)
File "/usr/local/bin/python-3.9/3.9.5/Frameworks/Python.framework/Versions/3.9/lib/python3.9/socketserver.py", line 826, in write
self._sock.sendall(b)
BrokenPipeError: [Errno 32] Broken pipe
also followed by message as file is rerequested: Got a request, should be downloading now.
Probable cause
Since official firmware is based on Ubuntu 14, the python version is python 2. I have encountered this count of error when python 2 socket is talking to python 3 socket. I don't know the exact bug or how it happens.
Solution
Serve the firmware file from different webserver such as python 2 (most linux distributions don't use it by default now, but usually still present):
run from directory where file is to start webserver to serve the file: python2 -m SimpleHTTPServer
optionally check with your browser the webserver is ready to serve the file by going to http://<your ip address>:8000/
get MD5 checksum of your firmware file: md5sum firmware.pkg
the update-firmware can take http url instead of path to firmware file mirobo --token XXXX --ip 192.168.8.1 update-firmware http://<your ip address>:8000/firmware.pkg <md5 checksum>
The text was updated successfully, but these errors were encountered:
Low-level socket accesses are hard to debug, that broken pipe comes from the fact that the socket gets closed by the remote (for reason or another). This may very well be something python and/or osx specific.
I put it here for searchability when someone encounters the problem, but I am not sure of the cause and my solution is not a good solution for everybody.
@martin-kokos I think adding a hint like this to the documentation could be helpful:
Instead of using the built-in HTTP server which may not work on all circumstances, you can host the firmware file anywhere that is accessible by the device some details how to do that
Describe the bug
Firmware update fails with python error Broken pipe, after various progress, sometimes almost immediately, sometimes after +20% uploaded.
Version information (please complete the following information):
Device information:
To Reproduce
Steps to reproduce the behavior:
Expected behavior
Complete firmware updage
Console output
also followed by message as file is rerequested:
Got a request, should be downloading now.
Probable cause
Since official firmware is based on Ubuntu 14, the python version is python 2. I have encountered this count of error when python 2 socket is talking to python 3 socket. I don't know the exact bug or how it happens.
Solution
Serve the firmware file from different webserver such as python 2 (most linux distributions don't use it by default now, but usually still present):
python2 -m SimpleHTTPServer
http://<your ip address>:8000/
md5sum firmware.pkg
mirobo --token XXXX --ip 192.168.8.1 update-firmware http://<your ip address>:8000/firmware.pkg <md5 checksum>
The text was updated successfully, but these errors were encountered: