WebControlCNC / WebControl

Web-based Ground Control
GNU General Public License v3.0
59 stars 33 forks source link

Firmware update/upgrade error #38

Open ted1735 opened 5 years ago

ted1735 commented 5 years ago

WebControl Maslow Holey firmware upgrade error

ScreenClip  2 ScreenClip  3 ScreenClip  4 ScreenClip

https://www.evernote.com/shard/s28/client/snv?noteGuid=2680c421-3a14-49ea-8fb6-0261a8761a73&noteKey=633eee4998e63ccc&sn=https%3A%2F%2Fwww.evernote.com%2Fshard%2Fs28%2Fsh%2F2680c421-3a14-49ea-8fb6-0261a8761a73%2F633eee4998e63ccc&title=WebControl%2BMaslow%2BHoley%2Bfirmware%2Bupgrade%2Berror

madgrizzle commented 5 years ago

Thanks for finding that issue. I think it might be a difference between Linux and windows versions of avrdude, but regardless, I see some things I need to xhange/include (such as avrdude itself) in the pyinstaller files.

blurfl commented 5 years ago

Running the 'webcontrol-0.906-rpi-singledirectory' version, the firmware update option seems to be looking for avrdude on a Windows-style path, so it fails. The web page reports 'update complete' though.


pi@pi4:~/webcontrol $ ./webcontrol 
Initializing Logger
/home/pi/.WebControl/log.txt
/home/pi/webcontrol
Initializing Configuration
Camera initialized
##
raspbian gnu/linux
##
----
rpi
singledirectory
----
VIDEOIO ERROR: V4L: can't open camera by index 0
/home/pi
Starting Console Queue Processor
/home/pi/.WebControl/webcontrol-*.port
-$$$$$-
/home/pi/webcontrol/main.py
/home/pi/webcontrol
-$$$$$-
opening browser
check for pyrelease
0.906
v0.906
webcontrol-0.906-rpi-singledirectory.tar.gz
https://api.github.com/repos/madgrizzle/WebControl/releases/assets/15259000
{"hostAddress": "127.0.1.1:5000"}
connected
1c09b890a2ee4e4ba5021281ddd00b92
Attempting to re-establish connection to controller
starting UI
connecting

Connected on port /dev/ttyACM0

Sent G20
I'm connected!
Sending Board Data
Sent Board Data
Sending Board Cut Data compressed
Sent Board Cut Data compressed
Sending: B05  
WebControl 1.27
Firmware Version 1.28

Sending: G20  
Sending: $$ 
/home/pi/webcontrol/firmware/maslowcnc/*.hex
portClosed0
connection closed at serialPortThread
/dev/ttyACM0
/home/pi/webcontrol
/home/pi/webcontrol/firmware/maslowcnc/maslowcnc-1.26.hex
"C:\Program Files (x86)\Arduino\hardware\tools\avr\bin\avrdude" -Cavr/avrdude.conf -v -patmega2560 -cwiring -P/dev/ttyACM0 -b115200 -D -Uflash:w:/home/pi/webcontrol/firmware/maslowcnc/maslowcnc-1.26.hex:i
sh: 1: C:\Program Files (x86)\Arduino\hardware\tools\avr\bin\avrdude: not found
32512
closing modals
{"title": "Actions"}
connecting

Connected on port /dev/ttyACM0

Sent G20
Sending: B05  
WebControl 1.27
Firmware Version 1.28

Sending: G20  
Sending: $$ 
/home/pi/.WebControlwc_diagnostics_20191002-215659.zip
PYINSTALLER
pi@pi4:~/webcontrol $ 
madgrizzle commented 5 years ago

Yeah, I'm going to see if I can package avrdude in the pyinstaller.

madgrizzle commented 5 years ago

So, here's something to overcome.. The goal is to be able to install webcontrol and be able to update the firmware with just a single install file. I seem to be able to run avrdude by packaging both avrdude.exe and libusb0.dll into the pyinstaller. But I worry about the driver for the arduino. I looked at the driver file details for the arduino connected to my Win10 computer and its:

C:\WINDOWS\system32\DRIVERS\usbser.sys

This is a Microsoft provided driver and I think it's built-in to Windows 10.. so does anyone know if a different driver is needed?

What about Linux and RPI? Anyone know enough about this stuff to know?

madgrizzle commented 5 years ago

I created a new version, but my computer is reporting it as a virus. Another computer seems fine though. I noticed the troubled computer hasn't updated in nearly a year.. so going through the long and excruciating process of trying to update.

davidelang commented 5 years ago

Linux/Pi already has the driver on the system

OS/X and older windows versions may need a driver to communicate, but that's a one-time thing, upgrades don't change this.

David Lang

On Thu, 3 Oct 2019, madgrizzle wrote:

So, here's something to overcome.. The goal is to be able to install webcontrol and be able to update the firmware with just a single install file. I seem to be able to run avrdude by packaging both avrdude.exe and libusb0.dll into the pyinstaller. But I worry about the driver for the arduino. I looked at the driver file details for the arduino connected to my Win10 computer and its:

C:\WINDOWS\system32\DRIVERS\usbser.sys

This is a Microsoft provided driver and I think it's built-in to Windows 10.. so does anyone know if a different driver is needed?

What about Linux and RPI? Anyone know enough about this stuff to know?

madgrizzle commented 5 years ago

My windows updates keep failing, but at least the virus definition file updated and doesn't report webcontrol as a trojan horse. Hopefully will have new releases to test out sometime today.

madgrizzle commented 5 years ago

Please all try again with latest (I deleted previous release). Win32 builds will be added soon.

blurfl commented 5 years ago

Firmware update 'Stock' works here on Win10-64 and various Pi's. 💯

I could wish that there was a firmware option for me to burn a local version of firmware... 😁 For now I can keep replacing a file in the singledirectory-firmware folder, but that's harder with the singlefile version.

madgrizzle commented 5 years ago

In think I could add a local firmware option located using the .WebControl directory.

blurfl commented 5 years ago

That would be excellent! 👍

madgrizzle commented 5 years ago

Win32 versions added for testing.

ted1735 commented 4 years ago

Error occurred when trying to upgrade firmware to holey for calibration.

### After trying to build the ftdi and usblib files, and finding dependency issues with udev and udev-dev, i then installed avrdude at the command line and it added the proper ftdilib!!!

/home/ted/webcontrol/tools/avrdude: error while loading shared libraries: libftdi.so.1: cannot open shared object file: No such file or directory connecting

/home/ted Starting Console Queue Processor /home/ted/.WebControl/webcontrol-*.port -$$$$$- /home/ted/webcontrol/main.py /home/ted/webcontrol -$$$$$- opening browser check for pyrelease /usr/bin/exo-open: /home/ted/webcontrol/libz.so.1: version ZLIB_1.2.9' not found (required by /usr/lib/x86_64-linux-gnu/libpng16.so.16) /usr/bin/exo-open: /home/ted/webcontrol/libz.so.1: versionZLIB_1.2.9' not found (required by /usr/lib/x86_64-linux-gnu/libpng16.so.16) 0.917 None XPCOMGlueLoad error for file /usr/lib/firefox/libmozgtk.so: /home/ted/webcontrol/libz.so.1: version ZLIB_1.2.9' not found (required by /usr/lib/x86_64-linux-gnu/libpng16.so.16) Couldn't load XPCOM. XPCOMGlueLoad error for file /usr/lib/firefox/libmozgtk.so: /home/ted/webcontrol/libz.so.1: versionZLIB_1.2.9' not found (required by /usr/lib/x86_64-linux-gnu/libpng16.so.16) Couldn't load XPCOM. /usr/bin/xdg-open: 851: /usr/bin/xdg-open: iceweasel: not found /usr/bin/xdg-open: 851: /usr/bin/xdg-open: seamonkey: not found /usr/bin/xdg-open: 851: /usr/bin/xdg-open: mozilla: not found /usr/bin/xdg-open: 851: /usr/bin/xdg-open: epiphany: not found /usr/bin/xdg-open: 851: /usr/bin/xdg-open: konqueror: not found /usr/bin/xdg-open: 851: /usr/bin/xdg-open: chromium: not found /usr/bin/xdg-open: 851: /usr/bin/xdg-open: chromium-browser: not found /usr/bin/xdg-open: 851: /usr/bin/xdg-open: google-chrome: not found /usr/bin/xdg-open: 851: /usr/bin/xdg-open: www-browser: not found /usr/bin/xdg-open: 851: /usr/bin/xdg-open: links2: not found /usr/bin/xdg-open: 851: /usr/bin/xdg-open: elinks: not found /usr/bin/xdg-open: 851: /usr/bin/xdg-open: links: not found /usr/bin/xdg-open: 851: /usr/bin/xdg-open: lynx: not found /usr/bin/xdg-open: 851: /usr/bin/xdg-open: w3m: not found xdg-open: no method available for opening 'http://localhost:5000' connecting

Connected on port /dev/ttyACM0

{"hostAddress": "127.0.1.1:5000"} connected 537a01b235594902be170acb5a157fc9 starting UI I'm connected! Sending Board Data Sent Board Data Sending Board Cut Data compressed Sent Board Cut Data compressed 537a01b235594902be170acb5a157fc9 uncompressed:1349064 compressed3D:171319 Sending Gcode compressed Sent Gcode compressed uncompressed:2 compressed3D:22 Sending Gcode compressed Sent Gcode compressed 537a01b235594902be170acb5a157fc9 processing request to close connection closed at serialPortThread /home/ted/webcontrol/tools/avrdude: error while loading shared libraries: libftdi.so.1: cannot open shared object file: No such file or directory connecting

Connected on port /dev/ttyACM0

### After trying to build the ftdi and usblib files, and finding dependency issues with udev and udev-dev, i then installed avrdude at the command line and it added the proper ftdilib!!!

Selecting previously unselected package libftdi1:amd64. (Reading database ... 257710 files and directories currently installed.) Preparing to unpack .../libftdi1_0.20-4build3_amd64.deb ... Unpacking libftdi1:amd64 (0.20-4build3) ... Selecting previously unselected package avrdude. Preparing to unpack .../avrdude_6.3-4_amd64.deb ... Unpacking avrdude (6.3-4) ... Setting up libftdi1:amd64 (0.20-4build3) ... Setting up avrdude (6.3-4) ... Processing triggers for man-db (2.8.3-2ubuntu0.1) ... Processing triggers for libc-bin (2.28-0ubuntu1+zorin4)

I was then able to upgrade the firmware to holey successfully with webcontrol

home/ted/webcontrol/tools/avrdude: error while loading shared libraries: libftdi.so.1: cannot open shared object file: No such file or directory connecting

Connected on port /dev/ttyACM0

537a01b235594902be170acb5a157fc9 processing request to close connection closed at serialPortThread /home/ted/webcontrol/tools/avrdude: error while loading shared libraries: libftdi.so.1: cannot open shared object file: No such file or directory connecting

Connected on port /dev/ttyACM0

check for pyrelease 0.917 None 537a01b235594902be170acb5a157fc9 processing request to close connection closed at serialPortThread

avrdude: Version 6.2 Copyright (c) 2000-2005 Brian Dean, http://www.bdmicro.com/ Copyright (c) 2007-2014 Joerg Wunsch

     System wide configuration file is "/home/ted/webcontrol/tools/avrdude.conf"
     User configuration file is "/home/ted/.avrduderc"
     User configuration file does not exist or is not a regular file, skipping

     Using Port                    : /dev/ttyACM0
     Using Programmer              : wiring
     Overriding Baud Rate          : 115200
     AVR Part                      : ATmega2560
     Chip Erase delay              : 9000 us
     PAGEL                         : PD7
     BS2                           : PA0
     RESET disposition             : dedicated
     RETRY pulse                   : SCK
     serial program mode           : yes
     parallel program mode         : yes
     Timeout                       : 200
     StabDelay                     : 100
     CmdexeDelay                   : 25
     SyncLoops                     : 32
     ByteDelay                     : 0
     PollIndex                     : 3
     PollValue                     : 0x53
     Memory Detail                 :

                              Block Poll               Page                       Polled
       Memory Type Mode Delay Size  Indx Paged  Size   Size #Pages MinW  MaxW   ReadBack
       ----------- ---- ----- ----- ---- ------ ------ ---- ------ ----- ----- ---------
       eeprom        65    10     8    0 no       4096    8      0  9000  9000 0x00 0x00
       flash         65    10   256    0 yes    262144  256   1024  4500  4500 0x00 0x00
       lfuse          0     0     0    0 no          1    0      0  9000  9000 0x00 0x00
       hfuse          0     0     0    0 no          1    0      0  9000  9000 0x00 0x00
       efuse          0     0     0    0 no          1    0      0  9000  9000 0x00 0x00
       lock           0     0     0    0 no          1    0      0  9000  9000 0x00 0x00
       calibration    0     0     0    0 no          1    0      0     0     0 0x00 0x00
       signature      0     0     0    0 no          3    0      0     0     0 0x00 0x00

     Programmer Type : Wiring
     Description     : Wiring
     Programmer Model: AVRISP
     Hardware Version: 15
     Firmware Version Master : 2.10
     Vtarget         : 0.0 V
     SCK period      : 0.1 us

avrdude: AVR device initialized and ready to accept instructions

Reading | ################################################## | 100% 0.01s

avrdude: Device signature = 0x1e9801 (probably m2560) avrdude: safemode: hfuse reads as D8 avrdude: safemode: efuse reads as FD avrdude: reading input file "/home/ted/webcontrol/firmware/holey/holey-51.27.hex" avrdude: writing flash (63842 bytes):

Writing | ################################################## | 100% 10.24s

avrdude: 63842 bytes of flash written avrdude: verifying flash memory against /home/ted/webcontrol/firmware/holey/holey-51.27.hex: avrdude: load data flash data from input file /home/ted/webcontrol/firmware/holey/holey-51.27.hex: avrdude: input file /home/ted/webcontrol/firmware/holey/holey-51.27.hex contains 63842 bytes avrdude: reading on-chip flash data:

Reading | ################################################## | 100% 8.19s

avrdude: verifying ... avrdude: 63842 bytes of flash verified

avrdude: safemode: hfuse reads as D8 avrdude: safemode: efuse reads as FD avrdude: safemode: Fuses OK (E:FD, H:D8, L:FF)

avrdude done. Thank you.

connecting

Connected on port /dev/ttyACM0

Sending: B05
Sending: G20
One Error Report Command Misread WebControl 1.27 Firmware Version 51.27

Sending: $$ Sending: B05
firmwareKeyString Exception: value = 2996.97 firmwareKeyString Exception: value = 413.4 firmwareKeyString Exception: value = 152.4 firmwareKeyString Exception: value = 2 firmwareKeyString Exception: value = 131.2 firmwareKeyString Exception: value = 1650 firmwareKeyString Exception: value = 750 firmwareKeyString Exception: value = 102.498904 Sending: G20
WebControl 1.27 Firmware Version 51.27

Sending: $$ Sending: B05
firmwareKeyString Exception: value = 2996.97 firmwareKeyString Exception: value = 413.4 firmwareKeyString Exception: value = 152.4 firmwareKeyString Exception: value = 2 firmwareKeyString Exception: value = 131.2 firmwareKeyString Exception: value = 1650 firmwareKeyString Exception: value = 750 firmwareKeyString Exception: value = 102.498904 Sending: G20
WebControl 1.27 Firmware Version 51.27

Sending: $$ Sending: B05
firmwareKeyString Exception: value = 2996.97 firmwareKeyString Exception: value = 413.4 firmwareKeyString Exception: value = 152.4 firmwareKeyString Exception: value = 2 firmwareKeyString Exception: value = 131.2 firmwareKeyString Exception: value = 1650 firmwareKeyString Exception: value = 750 firmwareKeyString Exception: value = 102.498904 Sending: G20
WebControl 1.27 Firmware Version 51.27

Sending: $$ Sending: $2=2996.97 firmwareKeyString Exception: value = 2996.97 firmwareKeyString Exception: value = 413.4 firmwareKeyString Exception: value = 152.4 firmwareKeyString Exception: value = 2 firmwareKeyString Exception: value = 131.2 firmwareKeyString Exception: value = 1650 firmwareKeyString Exception: value = 750 firmwareKeyString Exception: value = 102.498904 Sending: $3=413.4 Sending: $5=152.4 Sending: $7=2 Sending: $8=131.2 Sending: $11=1650 Sending: $15=750 Sending: $29=1300.00 Sending: $37=102.498904 Sending: $38=2.00000 Sending: $45=0.00000516850 Sending: $46=97.9000 Sending: $2=2996.97 Sending: $3=413.4 Sending: $5=152.4 Sending: $7=2 Sending: $8=131.2 Sending: $11=1650 Sending: $15=750 Sending: $29=1300.00 Sending: $37=102.498904 Sending: $38=2.00000 Sending: $45=0.00000516850 Sending: $46=97.9000 Sending: $2=2996.97 Sending: $3=413.4 Sending: $5=152.4 Sending: $7=2 Sending: $8=131.2 Sending: $11=1650 Sending: $15=750 Sending: $29=1300.00 Sending: $37=102.498904 Sending: $38=2.00000 Sending: $45=0.00000516850 Sending: $46=97.9000 Sending: $2=2996.97 Sending: $3=413.4 Sending: $5=152.4 Sending: $7=2 Sending: $8=131.2 Sending: $11=1650 Sending: $15=750 Sending: $29=1300.00 Sending: $37=102.498904 Sending: $38=2.00000 Sending: $45=0.00000516850 Sending: $46=97.9000 537a01b235594902be170acb5a157fc9

madgrizzle commented 4 years ago

With which operating system did this occur?

ted1735 commented 4 years ago

Linux zorin latest

madgrizzle commented 4 years ago

Could this possibily Zorin thing? I don't have a linux machine with an arduino connected to it (I just run linux on a VM and don't have any hardware connected to the host box) so it's hard for me to test. But, I did search my linux VM (ubuntu 16.04) and I was able to find ftdi related files (for example, libtdi.so.1 that I saw was marked as missing in your log).. So are these files not included in Zorin's distro or is there something I else going on?

blurfl commented 4 years ago

Could this possibily Zorin thing?

I see the same thing in Mint19 using the singleDirectory-0.917. Replacing the tools/avrdude executable with a newer version (from Arduino 1.8.10 in this case) solves the issue and allows the webcontrol/Actions/firmwareUpgrade process to complete properly.

madgrizzle commented 4 years ago

So is it an avrdude version issue only or is there also a driver issue for the usb?

blurfl commented 4 years ago

I would guess that it's an avrdude version issue. The newer version reports "Version 6.3-20190619". No other change was needed to restore operation beyond replacing that one executable file. I think that version is built using the scripts here.

madgrizzle commented 4 years ago

So this new version contains all the missing files and @ted1735 wouldn't have needed to build the ftdi and usblib files?

blurfl commented 4 years ago

That's how it looks to me. Just replicated the situation on a Fedora 30 VM; singleDirectory-0.917 firmware update failed and replacing the tools/avrdude with the newer version solved it.

madgrizzle commented 4 years ago

great.. will try to figure out how to get a copy of it. apt-get only seems to get me 6.25

madgrizzle commented 4 years ago

ok, got it built. Will try to build releases tonight and post a new version.

ted1735 commented 4 years ago

sound great! Its always hard when you feel like you are the only one having an issue, however glad it was able to be replicated and discovered!! If you need any more info LMK!! I run my apps off an old Intel dual core laptop, and a pi 3b+ so if you need something in particular tested. I am happy to help. Webcontrol is such an amazing and innovative program and has made using Maslow so much easier and more efficient!!

blurfl commented 4 years ago

the singleDirectory v0.918 seems to have done the trick on the Mint19 and Fedora31 VMs. 💯👍

madgrizzle commented 4 years ago

I am happy to help.

Thanks for testing this out and the research in determining the problem. It saves me countless, countless hours.. especially for things I'm not very familiar with.