Notifications
Clear all

Pi turns off

21 Posts
5 Users
0 Reactions
2,563 Views
(@piadmin)
Member Admin
Joined: 5 years ago
Posts: 78
 
Posted by: @ajl

Hi. Nice! -thanks for that, it worked great, see paste below. Not clear why I2C doesn't seem to be working, it's a new Pi.

Hi,

It was working as you show us before. You entered BL mode, and in this mode I2C is not working as interrupts are not allowed. 

Posted by: @ajl

Last question.  I want to use the battery for powering the Pi for as long as possible when the mains power fails (the Pi is indoors in a heated room).  How can I program the UPS to shut down the Pi when the battery level falls to a certain value and then restarts when  the power returns?

Sudo i2cset -y 1 0x6b 0x01 0xff

When battery is lower than 3V6 for LiPO type battery system shutdown safety and keep running RTC.

On a clear Pi (without any hardware, and with medium load software running) it is about 3-5 minutes the small, included battery of 450 mAh. Could be longer depending to the software you are running on the Pi.

NOTE. The UPS PIco HV4.0 is checking powering conditions when sleeping every 8 or 10 seconds, so after power applied you will wait some seconds depending to on which point of these 8-10 seconds you enter the power. Could be ASAP, could be 1 second but could be also 8 seconds. We are doing that to save battery energy as checking of A/D is consume more power that sleep state of micro controller. Probably in the next version of firmware we will enter checking the A/D during the sleep (it is possible) without wake-up for some milliseconds, but not now. It is task for next to next version.

BR PiM


   
ReplyQuote
(@piadmin)
Member Admin
Joined: 5 years ago
Posts: 78
 

Hi,

There are 2 types of implemented bootloaders in the UPS PIco HV4.0. The Local and the Remote.

The Local has activated Watchdog, so if within 16 or 32 seconds (I do not remember exactly) user does not start new firmware uploading, system restarts and running normally with the old firmware.

The Remote once entered to the bootloader mode, stay on this forever, giving user possibility to upload firmware even if system is not always accessible. 

We can discuss what version of bootloader should be Local or Remote, but it is only about naming. The core idea is the same, one bootloader restarts the system if uploading not started, and the second stay forever and wait for new firmware.

You definitely entered the Remote Bootloader. This is the explanation of your case in very details.

BR PiM


   
ReplyQuote
 AJL
(@ajl)
Active Member
Joined: 3 years ago
Posts: 12
Topic starter  

Your reply dated  I bought the "UPS PIco HV4.0B Advanced" model with Lipo battery and SCap so I assume I have the model B so only one back up power source can be used at once.  Is the Model B upgradable to the BC?

thanks

 


   
ReplyQuote
(@piadmin)
Member Admin
Joined: 5 years ago
Posts: 78
 
Posted by: @ajl
  UPS PIco Firmware..........................: 0133
  UPS PIco Bootloader........................: 41
  UPS PIco PCB Version.......................: 41
  UPS PIco PCB Defaut Battery................: Battery LiPO+SC 'l' 0x6C
  UPS PIco Set Battery.......................: Battery LiPO 'L' 0x4C

Hi,

When you ran the script, you see you have already version BC, so not need to change anything

To upgrade the B to BC you need to change one SMD transistor, that is very difficult for a "normal user"

However, our new production, we release will be only BC, as we found the proper parts (you know the Semiconductors Crisis) and manufacture only version BC from now.

BR PiM


   
ReplyQuote
 AJL
(@ajl)
Active Member
Joined: 3 years ago
Posts: 12
Topic starter  

My Pi program writes data to the SD every 300 seconds so I would like to set the STA to reset the Pi in case the program hangs.  Can you please confirm the command line to set the STA to do this?  Thanks again.


   
ReplyQuote
(@piadmin)
Member Admin
Joined: 5 years ago
Posts: 78
 

Hi,

it is 8 bit variable, and when 0xff means disabled, so the maximum is 0xfe = 254 seconds.

Remember it is a hardware reset.

 

sudo  i2cset -y 1 0x6b 0x05 0xXX

where 0xXX is your seconds number in hex, 0xff disables it 

 

You can always read it with 

sudo  i2cget -y 1 0x6b 0x05

 

See attachment

EDIT: //comments are private so DO not try these values

BR PiM


   
ReplyQuote
Page 2 / 2
Share: