Cool stuff for Raspberry Pi, Arduino and all electronics hobby projects
Notifications
Clear all

[Solved / Archived] Witty Pi 4 L3V7 - will not startup when power connected

11 Posts
2 Users
1 Likes
167 Views
(@andrew-simpson17)
Posts: 77
Estimable Member Customer
Topic starter
 

Hi

 

The majority of the time this works as expected.  But sometimes it does not. What i am to detail is the 3rd time it has happened over some months.

 

I have this board configured as a UPS.

 

There is a lipo battery connected to the PH2.0 - 2 pin battery connector.

The main supply, a usb power bank is connected to the USB type C connector for 5V power input (5V).

This is what I have expereinced:

Usb power bank fully discharges.

The red light on your board is lit - proving the lipo battery is working.

If I now connect a fully usb charged battery there is not change.

If I now toggle the On/off switch there is stil no change (apart from the white light flashes for just a few seconds)

I now disconnect the lipo and usb power bank. everything goes dead (obviously)

I reconnect the lipo battery

I reconnect the usb power bank

everything works again.

 

For my user, to do these actions if this issue happens again is impractical. So desperately need a solution if I am to retail my product.

 

There is nothing relevant in the witty logs apart from the original disconnected message due to low voltage.

 

 

 

 

 
Posted : 23/07/2024 11:46 am
(@admin)
Posts: 421
Member Admin
 

Posted by: @andrew-simpson17

If I now connect a fully usb charged battery there is not change.

I guess you mean another power bank, which has been fully charged?

Posted by: @andrew-simpson17

If I now toggle the On/off switch there is stil no change (apart from the white light flashes for just a few seconds)

You already noticed there is something changed, the white LED lights up for a few seconds, indicating the button tapping has been received and processed.

I guess when you said "there is still no change", you mean the device didn't shutdown as expected. Am I correct?

Then I don't understand why you immediately disconnected all power source. Shouldn't you (try to) login to the system and check what was going on? Were you even able to login to the system at that moment? Since the firmware already received the button tapping and processed it, did the software receive the GPIO-4 falling as shutdown signal?

Posted by: @andrew-simpson17

There is nothing relevant in the witty logs apart from the original disconnected message due to low voltage.

How comes there was a low-voltage event? Your power bank got fully discharged and it cut its output, Witty Pi 4 L3V7 doesn't detect low voltage on your power bank, it only detect low voltage on your battery. If you saw low volage event in the log, that means not only the power bank was fully discharged, but also your battery voltage dropped to very low level. That means the software tried to shut down the device due to low voltage. Maybe it failed because the system crashed.

Seeing the red LED on only measn Witty Pi is still powering the Raspberry Pi, it doesn't always mean the system is still running and functional. The actual system status needs to be carefully checked.

 

 

 

 
Posted : 23/07/2024 1:37 pm
(@andrew-simpson17)
Posts: 77
Estimable Member Customer
Topic starter
 

Hi

Thanks for your reply. For some reason I was not notified. So apologies for my late response.

"I guess you mean another power bank, which has been fully charged?"
Yes, that is what I meant.

"I guess when you said "there is still no change", you mean the device didn't shutdown as expected. Am I correct?"
No, I am saying it does not startup - this is with a fully charged (and on) USB Power bank connected.

"Then I don't understand why you immediately disconnected all power source."
I DID not disconnect anything here. The original usb power bank fully discharged. The Rpi went into standbye. I connected a fully charged usb power bank. The Rpi did not start up. If I now press the on/off button it will still not start up. That is the issue. The Rpi will not power on even with a power supply connected.

"Shouldn't you (try to) login to the system and check what was going on"
Yes, I removed the SD card and viewed it under Linux viewer. Nothing in the system logs and nothing in the witty logs to recognise that a power supply has been attached.

"Were you even able to login to the system at that moment?"
No, the Rpi will not boot up as I mentioned previously.

" did the software receive the GPIO-4 falling as shutdown signal?"
Like I said, nothing recorded in the witty logs for that event.

"How comes there was a low-voltage event? Your power bank got fully discharged and it cut its output, Witty Pi 4 L3V7 doesn't detect low voltage on your power bank, it only detect low voltage on your battery. "
the reason for the event is that usb power bank had discharged and the lipo battery minimal level had been reached.

"Maybe it failed because the system crashed"
No. That is not the case. Nothing in my logs at all to say that.

These are my settings:

source utilities.sh; set_low_voltage_threshold '40'
source utilities.sh; set_recovery_voltage_threshold '1'
source utilities.sh; set_default_state '0'
source utilities.sh; set_power_cut_delay_25

" red LED on only measn Witty Pi is still powering the Raspberry Pi, "
Well I waited over 20 minutes and it did not power on at all. The only way to power it on again was by the steps I illustrated in previous comment.

Even if my system crashed (which is did not) and even if the lipo battery was faulty (which it was not because I checked) the Rpi would not startup with a new power supply connected. If the lipo battery was discharged as well I could understand but that was not the case. If all I had to do was disconnect and then reconnect a lipo battery and a usb power bank IMMEDIATELY to power back on then that implies there is nothing wrong with any of my power sources.

 
Posted : 01/08/2024 12:40 pm
(@admin)
Posts: 421
Member Admin
 

@andrew-simpson17

Posted by: @andrew-simpson17

source utilities.sh; set_default_state '0'

There is no set_default_state function in the utilities.sh file. There is one in wittyPi.sh file, which requires user to input a value. If you ported this function into utilties.sh file and removed the need of user input, that is fine. However if you are following the same logic as the function in wittyPi.sh file, then passing value '0' to this function means the board will not boot up your Pi when it is NEWLY gets powered. This functionaliy is used when the board has not been powered before (either by battery or by power bank).

This may not be relevent though, the most important configuration is the set_recovery_voltage_threshold function, which you correctly passed value '1'.

Posted by: @andrew-simpson17

The red light on your board is lit - proving the lipo battery is working.

If I now connect a fully usb charged battery there is not change.

I have to say the description in your original post is rather confusing. If the red light is still on, that means your Pi is (should be) on, why would you expect it to startup your Pi when connecting a new power bank? A running Pi doesn't need such a startup.

According to the new information you provided today, I think you mean the old power bank was fully discharged and hence it cut its 5V output, and the voltage of connected LiPo battery droped under 4.0V and hence Raspberry Pi got shut down. Then I don't understand why you mentioned (in original post) that the red light was on -- it shouldn't be, it should go off (power cut after Pi was shut down).

 

 
Posted : 01/08/2024 1:48 pm
(@andrew-simpson17)
Posts: 77
Estimable Member Customer
Topic starter
 

"If you ported this function"

Yes. So sorry. I should have said so.

"This functionaliy is used when the board has not been powered before (either by battery or by power bank)."

What about when main battery has discharged and lipo battery discharged.  Will it still boot up or should i set this back to "1"?

"If the red light is still on, that means your Pi "

I was referring to the lights on your board? Sorry to confuse. 

"Then I don't understand why you mentioned (in original post) that the red light was on -- it shouldn't be, it should go off (power cut after Pi was shut down)."

There were no lights on the rpi board.  Perhaps I meant a different color on the witty board. Sorry,  cannot remember. I may have made a mistake.   The main point though is that the rpi would not start up by connecting a new usb power bank and pressing the witty on/off button did not work either. For some reason I had to disconnect both batteries and then reconnect to get the Rpi to start up again.

 

thanks for your continued time.

 
Posted : 01/08/2024 1:57 pm
(@admin)
Posts: 421
Member Admin
 

@andrew-simpson17 After your Pi is shut down and its power gets cut,  also your power bank is fully discharged (no 5V output), all lights (including lights on Witty Pi) should go off. If you still see any light on, that is not normal.

The symptom you described indicates the board was in an unexpected state (probably the MCU was crashed), so it did not react to button action. A power cycle will reset its state and hance it works again.

As for why the MCU would crash, most probably it was due to insurficient input voltage. Yes, you set the low-voltage threshold to 4V, which is rather high. However it really depends on the battery, if the battery could not deliver the required current, its voltage drops very quick and it may cause the MCU to crash before the shutdown process is done.

If you have not turned on the brown-out detection by properly setting the fuses in ATtiny841, please follow the tutorial below to upgrade the firmware, which will set the fuses properly and enable brown-out detection.

https://www.uugear.com/portfolio/compile-flash-firmware-for-witty-pi-4/

With brown-out detection, the MCU will directly reset when the input voltage is too low, instead of barely running and finally crash.

 
Posted : 01/08/2024 3:16 pm
(@andrew-simpson17)
Posts: 77
Estimable Member Customer
Topic starter
 

"If you still see any light on, that is not normal."

I do not think I explained myself properly which I apologises for. Lights on when reconnected usb power bank.

 

" Yes, you set the low-voltage threshold to 4V, which is rather high. However it really depends on the battery, if the battery could not deliver the required current,"

This is acting as UPS so, immediate cut-off is required you see.  These lipo batteries are supposed to be top of their range. So, there is not much that can be done here via your configuration setttings?

 

"A power cycle will reset its state and hance it works again."

 

This explains the scenario I faced - thanks.

 

 

"With brown-out detection, the MCU will directly reset when the input voltage is too low, instead of barely running and finally crash."

This looks all involved 🙂  If the MCU directly resets will it also reset my configuation settings? What I am trying to get to is will my customers ever have to detach the usb power bank and lipo battey or/and press the on/off button for the board to power up the Rpi?

 

Thanks

 

 

 
Posted : 01/08/2024 3:28 pm
(@admin)
Posts: 421
Member Admin
 

Posted by: @andrew-simpson17

If the MCU directly resets will it also reset my configuation settings?

No. Your configuration are stored in the EEPROM within the MCU. If the MCU gets reset (maybe due to too low input voltage), the data in EEPROM will be safe. Next time when the MCU is up (because input voltatge is high enough), it will automatically load the configuration from EEPROM.

When the MCU is reset, the power to Raspberry Pi will be cut too. If your LiPo battery's voltage quickly recover to above 2.7V (it usuall does, because the heavy load is disconnected), your MCU will start running too. Because you configured default state to off, it would not boot up your Pi. When new power bank is connected, because you configured recoverage threshold to non-zero value, it should boot up your Pi. I guess that is the behavior you want. However this bases on the assumption that the current issue you mentioned was due to the crash caused by brown-out.

 
Posted : 01/08/2024 5:28 pm
(@andrew-simpson17)
Posts: 77
Estimable Member Customer
Topic starter
 

Hi.

Excellent support.

Yes, this is based correctly.

 

Many thanks!

 
Posted : 01/08/2024 7:46 pm
(@andrew-simpson17)
Posts: 77
Estimable Member Customer
Topic starter
 

Hi

 

When I get to this part of the instructions:

 

Here you can find the output directory, which stores the compiled firmware (.hex file). In this example, the output directory is “/var/folders/j3/bcqz5xv531j_3cb0bxqbqbq00000gn/T/arduino_build_418439/”, if you open that directory, you will find the “WittyPi4.ino.hex” file there.

 

i can see 2 hex files in that directory:

  1. sketch_aug2a.ino.hex
  2. sketch_aug2a.ino.with_bootloader.hex

 

Which one do I use?

 

Thanks

 
Posted : 02/08/2024 10:01 pm
(@admin)
Posts: 421
Member Admin
 

@andrew-simpson17 If your firmware source file name is "sketch_aug2a.ino", then you will use "sketch_aug2a.ino.hex" as the compiled firmware file.

 
Posted : 03/08/2024 11:57 am
Join Waitlist We will inform you when the product arrives in stock. Please leave your valid email address below.