dustcloud
dustcloud copied to clipboard
flasher.py in Docker container?
I prepared a docker container which builds the custom firmware. Now I wonder if running flasher.py inside the container will work concerning communicating with the robot. I'm no python programmer so I'm not sure how to interpret the code. The script would need to get the Docker host IP and passing an optional port to the script would also be cool.
Had the same problem and get the flasher running.
You have to start the container with --net=host and need to modify the flasher.py.
For me, the script used the wrong interface. It uses the interface where the default route is attached.
Change line 165:
local_ip = findIP()
to
local_ip = 'wlan-ip-address'
I must also comment out line number 52: print('\r%s |%s| %s%% %s' % (prefix, bar, percent, suffix), end = '\r')
Because the flasher.py failed of some UnicodeEncodeError:
Traceback (most recent call last):
File "./dustcloud/devices/xiaomi.vacuum/firmwarebuilder/flasher.py", line 207, in <module>
main()
File "./dustcloud/devices/xiaomi.vacuum/firmwarebuilder/flasher.py", line 196, in main
printProgressBar(ota_progress, 100, prefix = 'Progress:', length = 50)
File "./dustcloud/devices/xiaomi.vacuum/firmwarebuilder/flasher.py", line 52, in printProgressBar
print('\r%s |%s| %s%% %s' % (prefix, bar, percent, suffix), end = '\r')
UnicodeEncodeError: 'ascii' codec can't encode characters in position 12-13: ordinal not in range(128)
After this changes, flashing was successfully.