dustcloud icon indicating copy to clipboard operation
dustcloud copied to clipboard

flasher.py in Docker container?

Open slaecker opened this issue 7 years ago • 1 comments

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.

slaecker avatar Apr 07 '18 08:04 slaecker

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.

marvinwankersteen avatar Sep 13 '18 17:09 marvinwankersteen