Advanced search FAQ Register Login

It is currently Sun Feb 25, 2018 4:23 pm

 

Postby nrg » Thu May 19, 2016 9:57 pm

Hello,

I've bought UPSPico a days ago and today I was trying to set it up on fresh Raspbian lite install. Everything went fine and it was definitely working but after checking pico_status.py which has shown firmware version 00 I've decided to upgrade it unfortunately something went wrong and now all the leds are flashing every 2s. I've managed to save the output of the failed firmware update process

Code: Select all

pi@raspberrypi:~ $ sudo i2cset -y 1 0x6b 0x00 0xff && sudo python picofu3.py -v -f UPS_PIco_0x5C_25_02_2016.hex
Validating firmware: OK
Checking communication with bootloader: OK
Uploading firmware: 0% ........................................................................................ 4.0% ......................................................................................... 9.0% .................Traceback (most recent call last):
  File "picofu3.py", line 546, in <module>
    FWUpdate()   
  File "picofu3.py", line 189, in __init__
    self.fw_upload()
  File "picofu3.py", line 473, in fw_upload
    for resp in PIco:
  File "/usr/lib/python2.7/dist-packages/serial/serialposix.py", line 460, in read
    raise SerialException('device reports readiness to read but returned no data (device disconnected?)')
serial.serialutil.SerialException: device reports readiness to read but returned no data (device disconnected?)


Now trying to get information from I2C I'm getting this

Code: Select all

pi@raspberrypi:~ $ sudo i2cdetect -y 1
     0  1  2  3  4  5  6  7  8  9  a  b  c  d  e  f
00:          -- -- 05 -- -- -- -- -- -- -- -- -- --
10: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
20: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
30: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
40: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
50: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
60: -- -- -- -- -- -- -- -- UU 69 -- -- -- -- -- --
70: -- -- -- -- -- -- -- --                         
pi@raspberrypi:~ $


How can I get this device back to life?

nrg
n00b

Posts: 7

Joined: Thu May 19, 2016 9:47 pm

Postby Jake » Fri May 20, 2016 10:41 am

Hi,

Have you tried using the manual invocation mode, as outlined:

http://www.modmypi.com/download/Simple_ ... _PIco.docx

That will should enable the device to accept firmware, so please try to upload the firmware once again

-- Jake

Jake
ModMyPi

User avatar

Posts: 1397

Joined: Thu Aug 27, 2015 3:57 pm

Forum Administrator & Technical Support

Postby nrg » Sat May 21, 2016 1:03 am

Yes I've tried to use manual method but this doesn't work either, the PIco UPS key combination to invoke bootloader is working because big red led is on but other than that nothing happens

Code: Select all

pi@raspberrypi:~ $ sudo python picofu3.py -v -f UPS_PIco_0x5C_25_02_2016.hex
Validating firmware: OK
Checking communication with bootloader: KO
ERROR: Failed to establish communication with bootloader in PIco. Is the PIco in the bootloader mode? (Red LED lid on PIco)

nrg
n00b

Posts: 7

Joined: Thu May 19, 2016 9:47 pm

Postby Jake » Mon May 23, 2016 8:03 am

Hi,

Have you disable serial when attempting the update?

-- Jake

Jake
ModMyPi

User avatar

Posts: 1397

Joined: Thu Aug 27, 2015 3:57 pm

Forum Administrator & Technical Support

Postby nrg » Tue May 24, 2016 8:10 pm

Hi

So this is something I don't understand, guide to flash the new firmware advises to disable serial port via raspi-config and this is exactly what I'm doing. After this operation there is no longer ttyAMA0 available as serial is disabled. Only in this mode after performing special key combination I'm able to put the UPS Pico in manual boot loader mode where big red led is lit. Unfortunately this is what I'm getting when trying to flash the firmware in this mode

Code: Select all

pi@raspberrypi:~ $ sudo python picofu3.py -v -f UPS_PIco_0x5C_25_02_2016.hex -s
ERROR: Serial port "/dev/ttyAMA0" cannot be found!


on the other hand when serial is active I'm getting something like this

Code: Select all

pi@raspberrypi:~ $ sudo python picofu3.py -v -f UPS_PIco_0x5C_25_02_2016.hex
Validating firmware: OK
Checking communication with bootloader: KO
ERROR: Failed to establish communication with bootloader in PIco. Is the PIco in the bootloader mode? (Red LED lid on PIco)


or this

Code: Select all

pi@raspberrypi:~ $ sudo python picofu3.py -v -f UPS_PIco_0x5C_25_02_2016.hex
Validating firmware: OK
Checking communication with bootloader: KO
ERROR: Something wrong happened during verification of communication channel with PIco bootloader via port: /dev/ttyAMA0 Please verify that the serial port is availble and not used by some other application.


I also have been able to open direct communication with boot loader via minicom

Code: Select all

pi@raspberrypi:~ $ sudo minicom -b 38400 -o -D /dev/ttyAMA0


Welcome to minicom 2.7

OPTIONS: I18n
Compiled on Jan 12 2014, 05:42:53.
Port /dev/ttyAMA0, 18:33:12

Press CTRL-A Z for help on special keys                                 
                                                                         
                                                                         
                                                     
               www.PiModules.com
UPS PIco
BootLoader V1.2




I honestly don't understand how programming the chip should work after disabling the serial port if the very program that is doing this requires the serial to be able to do it! I think I've tried all the options I could think of point by point and I'm getting nowhere and more and more frustrated.

nrg
n00b

Posts: 7

Joined: Thu May 19, 2016 9:47 pm

Postby Jake » Wed May 25, 2016 8:24 am

Hi,

When you disable serial in the raspi-config menu your actually disabling raspian's use of serial - "Enable/Disable shell and kernel messages on the serial connection.". In essence, disabling it here is actually freeing it for use by other devices - I understand why this is confusing.

I assume that originally serial was enabled when you attempted the firmware update? This would be a good indication of why it might fail.

The code you want to use is the following:

Code: Select all

sudo python picofu3.py -v -f UPS_PIco_0x5C_25_02_2016.hex


Minicom must be completely disabled when trying to undertake a firmware update - the line must be completely clear. It sounds like something is trying to use the serial port at the same time as you're trying to do the update?

I would suggest that using a fresh install of raspian, and starting from the very beginning of the quick start manual (http://www.pimodules.com/_pdf/UPS_PIco_Manual.pdf) firmware update section, ensuring that serial is disabled etc. etc. following the steps very carefully and using the manual method you will be able to update the firmware on the device.

Jake
ModMyPi

User avatar

Posts: 1397

Joined: Thu Aug 27, 2015 3:57 pm

Forum Administrator & Technical Support

Postby nrg » Wed May 25, 2016 8:31 pm

Hi Jake,

I've tried exactly what you have suggested. Fresh raspbian install and step by step configuration of the files required for normal UPS operation. Unfortunately whenever I disable the serial in the raspi-config and reboot the pi there is no longer serial device /dev/ttyAMA0 so all I'm getting from picofu3 script is "ERROR: Serial port "/dev/ttyAMA0" cannot be found!" I don't know how can I make the pi to disable kernel messages so they are not sent out on the serial port but still have ttyAMA0 device as this is the serial port that the script requires. I don't do anything else then enabling/disabling the serial port via raspi-config therefore it actually is disabling the whole physical device not just kernel messages sent to that device. Well at least this is what i think is happening based on the evidence. As you can see below there is no such device after disabling it in the raspi-config.

Code: Select all

pi@raspberrypi:~ $ ls /dev
autofs           gpiomem  loop7               ptmx   ram6    tty1   tty22  tty35  tty48  tty60      vc-mem  vcsa6
block            hwrng    loop-control        pts    ram7    tty10  tty23  tty36  tty49  tty61      vcs     vcsm
btrfs-control    i2c-1    mapper              ram0   ram8    tty11  tty24  tty37  tty5   tty62      vcs1    vhci
bus              initctl  mem                 ram1   ram9    tty12  tty25  tty38  tty50  tty63      vcs2    watchdog
cachefiles       input    memory_bandwidth    ram10  random  tty13  tty26  tty39  tty51  tty7       vcs3    watchdog0
char             kmsg     mmcblk0             ram11  raw     tty14  tty27  tty4   tty52  tty8       vcs4    xconsole
console          log      mmcblk0p1           ram12  rfkill  tty15  tty28  tty40  tty53  tty9       vcs5    zero
cpu_dma_latency  loop0    mmcblk0p2           ram13  shm     tty16  tty29  tty41  tty54  ttyprintk  vcs6
cuse             loop1    mqueue              ram14  snd     tty17  tty3   tty42  tty55  uhid       vcsa
disk             loop2    net                 ram15  stderr  tty18  tty30  tty43  tty56  uinput     vcsa1
fb0              loop3    network_latency     ram2   stdin   tty19  tty31  tty44  tty57  urandom    vcsa2
fd               loop4    network_throughput  ram3   stdout  tty2   tty32  tty45  tty58  vc-cma     vcsa3
full             loop5    null                ram4   tty     tty20  tty33  tty46  tty59  vchiq      vcsa4
fuse             loop6    ppp                 ram5   tty0    tty21  tty34  tty47  tty6   vcio       vcsa5


*Update* after long hours spent to find the solution

I think I know the reason why I can't flash the firmware. Reading raspberry pi forums I found that because raspbian has changed from sysvinit to systemd there were changes made with regards to the serial interface and how it's handled. I've installed some old version of raspbian from 24/09/2015 and indeed after disabling serial in raspi-config it is still available after reboot so this is completely different than what it is in the most up to date version. The problem is repositories has changed a lot since that time and I don't think picofu3.py is compatible with that old system, anyway I've tried the update and error I was getting was completely different than before

Code: Select all

pi@raspberrypi ~ $ sudo python picofu3.py -v -f UPS_PIco_0x5C_25_02_2016.hex
Traceback (most recent call last):
  File "picofu3.py", line 65, in <module>
    i2c = smbus.SMBus(1)
IOError: [Errno 2] No such file or directory


Now I'm sure the problem lies with the new version of raspbian and how the serial interface is handled by raspi-config. What should I do now?

nrg
n00b

Posts: 7

Joined: Thu May 19, 2016 9:47 pm

Postby Jake » Thu May 26, 2016 1:10 pm

Hmmm strange. Can you try the following for me?

Code: Select all

sudo nano /boot/config.txt


Add this at the bottom

Code: Select all

dtoverlay=pi3-disable-bt-overlay


Then run this:

Code: Select all

sudo systemctl disable hciuart


Then retry the flash?

-- Jake

Jake
ModMyPi

User avatar

Posts: 1397

Joined: Thu Aug 27, 2015 3:57 pm

Forum Administrator & Technical Support

Postby nrg » Thu May 26, 2016 9:18 pm

So the good news is that ttyAMA0 is present after disabling the serial in raspi-config when I did all the steps you have requested. UPS Pico goes to bootloader mode without problems and the big red led is lit but when I try to flash the firmware familiar message is showing up on the screen

Code: Select all

pi@raspberrypi:~ $ sudo python picofu3.py -v -f UPS_PIco_0x5C_25_02_2016.hex
Validating firmware: OK
Checking communication with bootloader: KO
ERROR: Failed to establish communication with bootloader in PIco. Is the PIco in the bootloader mode? (Red LED lid on PIco)


Since it's so much hassle to set this serial port running maybe easier solution would be to use external 3.3V USB serial adapter and connect it to specific pins on UPS? I think I've seen that picofu3.py have an option for something like that and serial port could be forced as a parameter? I would only need to know how many pins needs to be connected and how, or maybe you have a better solution?

nrg
n00b

Posts: 7

Joined: Thu May 19, 2016 9:47 pm

Postby JW27 » Mon Jun 06, 2016 12:56 pm

Any news on this issue please?

I'm having exactly the same issue with RasPi 2B & latest Jessie OS.


Cheers,

Jason

JW27
n00b

Posts: 1

Joined: Mon Jun 06, 2016 12:54 pm

Next

Who is online

Users browsing this forum: No registered users and 1 guest

Board index

The teamDelete all board cookies • All times are UTC [ DST ]