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

[Solved / Archived] Witty Pi 4 not starting

21 Posts
2 Users
0 Likes
818 Views
(@eagleshot)
Posts: 32
Eminent Member
Topic starter
 

Hello everyone.

For my setup I'm using a Witty Pi 4 connected directly to a 2S battery which is charged by a solar panel. When the system has power, it restarts on schedule with the extra capacitor to stabilise the microcontroller voltage. It also starts as expected when the battery is disconnected and then reconnected ("default ON"). While the system normally restarts after the voltage drops below the low voltage threshold and then returns to the recovery voltage, this does not always happen. I've had several cases during testing where the battery voltage was very low (around 6V) and the voltage recovered above the recovery voltage threshold, but the system didn't restart. As my setup can be buried in snow for several weeks/months, this can unfortunately happen, even if the system is switched off before the battery is empty.

Is there any way to explain/fix this problem? My only idea is that it could be caused by a brown out.

Thanks for your help!
Eagleshot

 

@admin

 
Posted : 28/04/2024 2:39 pm
(@admin)
Posts: 479
Member Admin
 

Posted by: @eagleshot

during testing where the battery voltage was very low (around 6V) and the voltage recovered above the recovery voltage threshold, but the system didn't restart.

"System didn't start" really provides almost no information. It is better to provide more information about how you tested it. How did you wire it, what were your configurations in software, what did the device behave exactly? 

 
Posted : 28/04/2024 6:17 pm
(@eagleshot)
Posts: 32
Eminent Member
Topic starter
 

Sorry, i got some things about the wiring mixed up in my first response as we are currently doing multiple different tests to assess the reliability of the Witty Pi. Attached below is an image of the setup we used. For the test we used a 2S 7.4V Li-Ion battery connected to a 12V DC/DC converter which was then attached to the Witty Pi. Normally the battery gets charged by a solar panel, however for this test it was coverd and can be ignored. I know this is a little bit of an unusual setup, but this is a kind of 12V solar battery bank, that we already used for other devices and wanted to test.

For testing we set the low voltage treshold of the Witty Pi to 6.7V and the recovery voltage treshold to 7V. We then ran the Witty Pi for about 1 minute and then turned it off again repeatedly to drain the battery. However the DC/DC converter can only output 12V until the battery voltage is around 6.3V. So what happens is that the Witty Pi starts up as it still has a 12V input and because of the power draw, the voltage drops down to the battery voltage which is around 6.3V. I know this because the Raspberry Pi still worked fine in the last run and uploaded the log data including the battery voltage during operation (around 6.3V). After this, the Witty Pi obviously no longer started and we let the battery recharge after some time. Unfortunately, after that, the system only restarted about 50% of our tests and had to be restarted manually by unplugging and plugging back in the battery the other times.

Now i know this is a little bit of an unusual setup and we will directly attach the Witty Pi to the battery for our final setup so we can turn it off before the battery is empty to avoid this - however the end result is still that the Witty Pi will sometimes not restart in a worst case scenario. As we are building a solar powered system that will be in the mountains where the solar panel can be covered under snow for a long time, this is a pretty big issue for us, as we can't restart it manually.

Unfortunately I've had no success in reproducing this issue with my lab power supply so far, even with lower voltages. My only ideas is that this maybe could be a current or brown-out related issue.

Any input is greatly appreciated! 🙂

1714507482-signal-2024-04-30-204618_002.png
 
Posted : 30/04/2024 10:04 pm
(@admin)
Posts: 479
Member Admin
 

Witty Pi 4's VIN should be connected to a battery, whose voltage will drop continuously during the discharging. That way Witty Pi can turn off the Pi before the battery runs out.

In your setup, a boost DC/DC converter is placed between the battery and Witty Pi 4. Unless it is a very specially designed DC/DC converter, its output voltage (12V) will not drop until the battery can't provide the minimum required voltage. When the 12V DC/DC converter outputs lower than 12V, it is already too late to shutdown your Pi because the battery has been run out. There is no garentee that the system can finish the shutdown gracefully.

An example of proper setup is shown in attached drawing, maybe it is very similar to your final setup?

In any case, you need to make sure the voltage applies to Witty Pi is not too low. It should be at least 6V but I suggest to give it 6.5V or higher. If the solar panel is covered and doesn't output enough voltage, the charging circuit should be smart enough to cut its output and do not pull down the voltage of the battery.

If for any reason you feed Witty Pi a very low voltage (<6V), its on-board DC/DC may not work and its MCU may not get enough voltage to work properly, that could cause all kinds of problems.

1714551716-Solar_Charger.jpg
 
Posted : 01/05/2024 10:21 am
(@eagleshot)
Posts: 32
Eminent Member
Topic starter
 

Thank you very much for your detailed answer - that is exactly the setup that we are currently using and so far we didn‘t have any problems. May I ask why you do not use the built-in brown-out detector of the ATTiny841 since it is designed to handle problems like this with the MCU having a too low voltage?

1714659347-IMG_1298.jpeg
 
Posted : 02/05/2024 4:15 pm
(@admin)
Posts: 479
Member Admin
 

@eagleshot we didn't have such scenario well considered, and we recently do realize turnning on B.O.D. is the right way to go. That's why we recently made such change.

However it will take some time to spawn to products in stock. At the moment the quickest way to turn on B.O.D. is to flash the firmware with proper fuse settings, which has been introduced in this tutorial.

 
Posted : 02/05/2024 5:27 pm
(@eagleshot)
Posts: 32
Eminent Member
Topic starter
 

Awesome!😀 Do you plan further software updates for this except just enabling the BOD fuses? For example when the MCU is reset by the BOD it immediately restarts the Pi if the default power mode is on which is not optimal on battery powered devices.

 

Also an input/feature request for my use case: A „high reliability“ mode that can be enabled would be very helpful, where the MCU checks if a timer has been set or sets one if none is programmed. This would enable another safety net for applications that require it and can‘t easily be accessed.

 
Posted : 03/05/2024 12:09 am
(@admin)
Posts: 479
Member Admin
 

@eagleshot unless the MCU knows it is just recovered from the BOD reset, it can not take different action in such case. If you know how to let the MCU to figure out such situation, please advise.

The "high reliability" mode you mentioned would introduce quite a lot logic in the code, and most probably the remaining space in MCU is not enough for that.

 

 
Posted : 03/05/2024 5:57 pm
(@eagleshot)
Posts: 32
Eminent Member
Topic starter
 

You can check the MCU reset cause in the MCUSR register (page 46 of the datasheet). Ok, in this case I will probably add a second MCU to my Witty Pi that triggers a start if the Witty Pi hasn't started for a while as a backup. 🙂

1714811279-Screenshot-2024-05-04-at-10-17-30-Atmel-AVR-ATtiny441_841-Datasheet-ATtiny841pdf.png
 
Posted : 04/05/2024 10:27 am
(@admin)
Posts: 479
Member Admin
 

@eagleshot thanks, we will look into it and see if we can do something.

 
Posted : 08/05/2024 8:13 am
(@eagleshot)
Posts: 32
Eminent Member
Topic starter
 

@admin Do you have an ETA on how long this will take to implement? I have 10+ units, that I want to update in the very near future and would prefer to not do this twice. I could also help with testing the changes if it's useful to you.

 
Posted : 13/05/2024 12:42 pm
(@admin)
Posts: 479
Member Admin
 

@eagleshot Witty Pi 4 is currently out of stock. When it is back to stock, it will come with firmware version 0x06 and have the B.O.D. enabled by default.

 
Posted : 13/05/2024 1:41 pm
(@admin)
Posts: 479
Member Admin
 

@eagleshot Detecting previous B.O.D. reset and take different action is not included in firmware 0x06. We can't promise it will be there.

 
Posted : 13/05/2024 1:43 pm
(@eagleshot)
Posts: 32
Eminent Member
Topic starter
 

I already have my units at home (with an older firmware) and will upgrade the firmware/B.O.D manually anyway so I don't need new ones at the moment. However we want to deploy our 10+ systems to the field very soon, so if this could be implemented I would be very glad. Can't you give a rough estimate, how long this will take to implement? Again if you need help with testing this (or coding) I will gladly assist.

 
Posted : 13/05/2024 5:14 pm
(@admin)
Posts: 479
Member Admin
 

@eagleshot unfortunately we currently do not have bandwidth to work on this. Also this feature is not likely to be implemented in standard firmware, because it has quite assumptions: system is powered by battery, voltage could drop low enough to trigger B.O.D. reset, restore from B.O.D reset still doesn't mean the battery is good enough to finish booting Raspberry Pi etc. These assumptions are quite specific for certain use case, and some behavior you prefer may not be suitable for other users.

I do think making custom firmware would be a better way.

 
Posted : 13/05/2024 6:24 pm
Page 1 / 2
Join Waitlist We will inform you when the product arrives in stock. Please leave your valid email address below.