Can't update firmware using update tool on Linux mint 18.2
I've read and googled just about all your forums - TBH, totally lost now! :-( ..
I have 2 new pycom wipy/bluetooth boards and expansion boards. I've followed examples exactly! I'm trying to get past 'go' and just update firmware!
I follow screen prompts and get the error:
"Something failed trying to connect to the device"
I've also ran as :/> sudo ./update
There is no error debug for me to see what failed?
I'm using firmware update tool:
The device looks like it is attached as:
If i do />lsusb
Bus 006 Device 013: ID 0403:6015 Future Technology Devices International, Ltd Bridge(I2C/SPI/UART/FIFO)
If I check dmesg I can see that it is using:
[364919.283591] usb 6-2: FTDI USB Serial Device converter now attached to ttyUSB0
The update tool does identify that it is on /dev/ttyUSB0
This is as far as I get...
I've also attached cutecom to the port just to see if I can get 'anything' back or to the device.
Both my devices have the same behavior. And I've checked and double checked that I have got my jumper wired to ground and pin G23.
I've also checked i have py-serial and dialog installed.
My version of python is:
nherriot@kieran ~/applications/pycom1_1_6/pyupgrade $ python --version
Can someone give pointers on what to try next?
Kind regards, Nicholas Herriot
Hi @xykon thanks for the info and quick response :-) ...
I've not really studied udev rules on my Linux mint machines. However adding dialout did not effect the behavior of 'cutecom'.
Changing the read write permissions on the USB device survives reboot. I'm sure if I have a different device take USB0 then I will be stuck again.
Any info on how files are copied to and from the device or is anyone in the community looking at a plugin for pycharm?
Great stuff - keep up the good work... :-)
Kind regards, Nicholas.
@nherriot Most Linux systems use devfs, udev or some other implementation of a dynamic device tree, so using chmod on a device would not survive a reboot or possibly even removing and plugging back a USB serial device. Most Linux systems have a dedicated group for serial devices with write access and the best way to get permanent access to the serial ports is by adding the group to each user that should be allowed to use serial devices. On most Linux systems this group is named
dialoutbut as there are so many different variants of Linux we cannot check all of them.
Hi @xykon ,
did you want me to try the new package and test?
Also this may help people in the future. For Linux systems you may need to alter read/write permissions to /dev/ttyUSB0 above and beyond adding a user to the dialout group. It's a bit of a gotcha and can really stump you for a while. So instructions for Linux could have things to try if there are permissions problems. So for my I did:
/> sudo chmod a+rw /dev/ttyUSB0
Do you know what protocol is used to transfer files across USB ? As I have a pycharm license and would rather use that as my IDE.
Kind regards, Nicholas
@nherriot Just FYI I have uploaded a new beta version of the Linux firmware updater : http://beta.pycom.io/downloads/pycom_firmware_update_1.10.0.b2.tar.gz
We currently do not have a public GitHub repo for the firmware update tool.
@nherriot Yes I forgot to ask you to check the jumpers... it seems sometimes they fall off during transit (we will have that corrected in the next hardware revision of the expansion board).
As for uploading code, it is correct that our boards to not work as a mass storage device. Code can be uploaded via ftp or by using our plugins for Visual Studio Code and/or Atom. Both will be able to upload code either via the USB connection or via WLAN (either directly connected or through a network router).
Hello again @xykon.
one more question. From reading the guides (I've not read everything yet!) am I correct in saying that the pycom device does not expose it's self as a mass storage device???? :-( .... And that the correct way to get programs onto the device is via FTP ?
What ways can I upload my programs via my USB connection? And do I have to use some special plugin? I'm really hoping I've missed something!!!
Kind regards, Nicholas.
@xykon thanks for the reply.
No problem. If you would like me to raise feedback or bugs that I find let me know what github repo the code is in (it says it's open source in the license).
I used picocom which seemed to work. Out of interest if anyone is using cutecom they need to select the 'CR Line End' as the terminator character rather than 'Line Feed'.
I also found out the problem with the second board. There were no jumpers on RX and TX on the expansion board. This one is also now updated with the new firmware. Please find attached an image of the output string as seen from picocom. And the execute string I used was:
/> picocom -b 115200 -r -l /dev/ttyUSB0
Now to figure out how to upload a file and run it! :-)
Kind regards, Nicholas
@nherriot My apologies I had added some code to clean up the distribution package and it seems it accidentally excluded the init.py script. I will upload a new beta version later today that will also include a few other fixes.
As you are using the Expansion Board 2.0, can you please use a serial terminal emulator (such as minicom/screen) and check the output you receive from the module when you press the reset button on the module with the firmware wire attached. You should see some messages including "Waiting for download" at the end. Please refer to this help article for more details.
thanks for your quick reply.
I've tried the firmware update now on a different Linux machine (before I read your post) and I've moved on slightly. :-)...
Using the pyupgrade and upgrade tool I can flash one of the boards, it works fine. The other I just keep getting the same error. Is it possible that it's damaged in some way? And how would I verify this?
The pyupgrade tool will not run out the box given the instructions and the deployed code. There is no /init.py inside the bin directory. This means that python does not know /bin is a module. So this looks like a bug. The error you get is:
nherriot@Zenbook-UX32A ~/applications/pycom.io/pyupgrade $ python lopyupdate.py
Traceback (most recent call last):
File "lopyupdate.py", line 30, in <module>
from bin.updater import NPyProgrammer
ImportError: No module named bin.updater
To fix this as I said you need a init.py file. I have fixed this on my machine. Can you give me the link to your github repo and I'll submit a bug and patch proposal? :-)
Please find attached a screen shot of the error message on board 2. Not sure what help this will be for you.
Last point, you wanted to see messages on serial when I plugged the boards in? Did you mean output to dmesg log? I'm not sure what you wanted me to gather - can you be more specific?
Thanks for all your help up to now.
Kind regards, Nicholas
@nherriot First off I suggest you try different USB cables as this seems to be the most common reason for firmware updates to fail.
Second I suggest you try the GUI firmware update tool:
GUI (Qt dependencies): run python2 lopyupdate.py (needs py-qscintilla py-setuptools py-serial py-requests and its dependencies).(see README).
Try pressing the reset button on the module after connecting it to your PC with the firmware update jumper wire attached.
Please check the permissions of your USB port. You may need to add your current user to the dialout (default on most Linux systems but the group name can vary between systems) group
(sudo usermod -a -G dialout $USER)
If you are still unable to flash, please post the output you get from the module on the serial port when pressing the reset button on the module with the firmware update jumper wire attached.