|
Post by roadkingrandy on Oct 7, 2018 7:55:23 GMT -8
You have a SunAir board? What is the exact board you have for the power controller. Makes a difference. BP I'm using the SunAirPlus board version 0040-050515-01 and USB PowerControl version 0042-112116-001. I have SunAirPlus JP4 LiPo Battery out connected to the USB PowerControl JP1 LipoBatIn.
|
|
|
Post by triggerfish on Oct 9, 2018 5:00:04 GMT -8
You have a SunAir board? What is the exact board you have for the power controller. Makes a difference. BP With my girlfriend for the weekend. Will check for the exact numbers when I get home. My SunAirPlus board has number 0040-050515-01 My PowerController has number 0042-112116-001 (http://forum.switchdoc.com/attachment/download/352)
|
|
|
Post by SDL on Oct 9, 2018 16:54:39 GMT -8
Those are both current.
BP
|
|
|
Post by SDL on Oct 9, 2018 16:56:22 GMT -8
But... When the powercontroller powered down everything, the Raspberry is also powered down... So the watchdog has no power to decide on anything? Shouldn't the watchdog be powered by JP13/3 and JP13/4 on the SunAir board in stead? Read more: forum.switchdoc.com/thread/667/connecting-watchdog-version-100217-boot?page=3#ixzz5TU9DkZE5The deal is here is that the watchdog can be powered down when the Pi is powered down because the Watchdog will not reboot a powered down RPi, but just one that has lost it's way! BP
|
|
|
Post by roadkingrandy on Oct 9, 2018 18:38:50 GMT -8
But... When the powercontroller powered down everything, the Raspberry is also powered down... So the watchdog has no power to decide on anything? Shouldn't the watchdog be powered by JP13/3 and JP13/4 on the SunAir board in stead? Read more: forum.switchdoc.com/thread/667/connecting-watchdog-version-100217-boot?page=3#ixzz5TU9DkZE5The deal is here is that the watchdog can be powered down when the Pi is powered down because the Watchdog will not reboot a powered down RPi, but just one that has lost it's way! BP This is my first foray into whatever you call this hobby - digital electronics, IoT? That's been puzzling me - nothing like problems to help you learn things - I always tell my support techs (I'm in IT), you don't learn anything when it all works just fine, lol. With everything connected the way the GroveWeatherPi instructions say: The VDD and GND on JP13 on the SunAirPlus are going to the SwitchDoc Labs I2C Mux along with SCL and SDA via a Grove to jumper cable. I believe that's how we're monitoring the power stats on the SunAirPlus board for the battery and solar panels. The only power connections to the Watchdog are coming from the GPIO 1 & 6 pins on the Pi (which is off) so the Watchdog is doing nothing. With the SunAirPlus power switch on, I removed the connection from Dog1 out to USB PowerControl TP3 and the system immediately booted. So some interaction between the USB PowerControl and the Watchdog is preventing the system from starting. The Watchdog is not booting the Pi, it's shutting it down the USB Power Control board. With no PatTheDog script running, as soon as the Dog LED blinks, power is cut to the entire system. I tested that. With the GroveWeatherPi, when the battery power drops below 3.5V (as reported by the SunAirPlus monitoring the battery), we shutdown the Pi via a script. At that point, boards are still powered up but the Pi is off. The problem the Watchdog is supposed to solve is a case where the battery starts charging again but since the power to the USB Control never dropped below 3.4V, it never shut off power to all the boards. Since power was never shut off, the Pi won't be rebooted. The Watchdog connected to TP3 (COut) makes the USB Control turn off power. the USB Control won't turn the power back on until the battery reaches 3.9V. The version of USB Power Control board I have is 0042-112116-01.
|
|
|
Post by triggerfish on Oct 9, 2018 23:29:43 GMT -8
The only power connections to the Watchdog are coming from the GPIO 1 & 6 pins on the Pi (which is off) so the Watchdog is doing nothing. With the SunAirPlus power switch on, I removed the connection from Dog1 out to USB PowerControl TP3 and the system immediately booted. So some interaction between the USB PowerControl and the Watchdog is preventing the system from starting. That's my point. I understand the watchdog is only powering off when it is not patted anymore, in a normal situation when the script stopped because it detected a low battery. So far, so good... The system is down, the sun is hopefully charging the battery up to a level it can power the system again... But then... What decides to tell the power controller to switch the stuff on again? In my experience, nothing happens until i briefly disconnect TP3 from Dog1, so as quoted apparently "So some interaction between the USB PowerControl and the Watchdog is preventing the system from starting."
|
|
|
Post by SDL on Oct 10, 2018 5:48:36 GMT -8
I'm going to have to dig into this design (John did the GWP design) and see what is going on. I'll be back at you by Friday.
BP
|
|
|
Post by roadkingrandy on Oct 10, 2018 17:40:42 GMT -8
The only power connections to the Watchdog are coming from the GPIO 1 & 6 pins on the Pi (which is off) so the Watchdog is doing nothing. With the SunAirPlus power switch on, I removed the connection from Dog1 out to USB PowerControl TP3 and the system immediately booted. So some interaction between the USB PowerControl and the Watchdog is preventing the system from starting. That's my point. I understand the watchdog is only powering off when it is not patted anymore, in a normal situation when the script stopped because it detected a low battery. So far, so good... The system is down, the sun is hopefully charging the battery up to a level it can power the system again... But then... What decides to tell the power controller to switch the stuff on again? In my experience, nothing happens until i briefly disconnect TP3 from Dog1, so as quoted apparently "So some interaction between the USB PowerControl and the Watchdog is preventing the system from starting." The USB PowerControl gets the battery voltage with the LIPOBATIN line. If it detects the voltage drops below ~3.3V it will turn off the power to the USB connection. Once the voltage increases to ~3.8V, it will turn the USB port back on. We're supposed turn off the Pi when power hits ~3.5V - BEFORE the USB power gets cut by the USB PowerControl board. That way we have a nice orderly shutdown. Note that until the power drops to ~3.3V, all the boards are still getting power - the Pi and the Watchdog. The Pi will not reboot until power is shut off. There's no power button for the Pi - it needs to have power shut off and turned back on for it to boot (or you connect two GPIO pins - which we can't do). That's why we need to shut the power off using the Watchdog - when the Dog timer hits, it will tell the USB PowerControl to turn off the power now. Under perfect conditions, the battery voltage will continue to drop because the boards are still all on and draining it, but if the battery starts charging again before it hits 3.8V, the power will never get cut off and the Pi won't reboot. I guess that could happen on a cloudy/rainy day where the solar panels aren't working well. Worst case, I would expect the power to drop low enough overnight to make it shut off. Then it will reboot the next day when the battery charges up again. Mine will just be out in the yard so if I had to manually start it once in awhile, it's not a dealbreaker.
|
|
|
Post by triggerfish on Oct 10, 2018 22:30:00 GMT -8
OK, so with just the power controller, that will shut of power when battery gets below 3,3V and switch power on when battery gets above 3,8V To protect the sd card on the pi, we detect the battery power and "pat the dog" as long as we think that is ok. When the software detects 2,5V, it will issue a shutdown, stopping the pi. That will be idle then, but powered on since we have no way to power it down. BUT then the dog is not patted anymore and after that timeout, the watchdog tells the power controller to kill the power (which it does to my annoyance  I'll have to make a little script to pat the dog while I am working on the pi without the software running  ) Now the system is powerless, making charging the battery again, more efficient and provide the possibility to power on the pi and actually starting the software again. When the battery hits 3,8V the power controller should switch the power on again, starting the cycle from above. That last step is failing somehow, until just briefly disconnect the wire... Lets hope friday will bring a solution for this, because I will not be able to disconnect the cable everytime the battery gets recharged again.
|
|
|
Post by roadkingrandy on Oct 11, 2018 6:49:15 GMT -8
OK, so with just the power controller, that will shut of power when battery gets below 3,3V and switch power on when battery gets above 3,8V To protect the sd card on the pi, we detect the battery power and "pat the dog" as long as we think that is ok. When the software detects 2,5V, it will issue a shutdown, stopping the pi. That will be idle then, but powered on since we have no way to power it down. BUT then the dog is not patted anymore and after that timeout, the watchdog tells the power controller to kill the power (which it does to my annoyance  I'll have to make a little script to pat the dog while I am working on the pi without the software running  ) Now the system is powerless, making charging the battery again, more efficient and provide the possibility to power on the pi and actually starting the software again. When the battery hits 3,8V the power controller should switch the power on again, starting the cycle from above. That last step is failing somehow, until just briefly disconnect the wire... Lets hope friday will bring a solution for this, because I will not be able to disconnect the cable everytime the battery gets recharged again. You got it. The other thing to do is just not connect the Watchdog for now (unplug the line going to TP3). Most of the time it should be ok, but if you have a brownout, you'll need to manually start the Pi again.
|
|
|
Post by triggerfish on Oct 11, 2018 8:46:44 GMT -8
I come from the electronic dark ages, so this solution may not be to practical, but what if all else fails, I put a small 5V relay on the TP3 wire which is off by default and kept on by power from the Pi... So when the Pi is on, the connection is there and it can be used to cut power as intended... Then the relay switches open, breaking the connection. When the battery is charged above the required value and the power controller want to go on again, it is not stopped by the TP3 as right now, because the relay is open, so it actually will power on the Pi... And when that is powered on, the relay will close again, restoring the communication between the power controller and the watchdog. There may be a more modern way using transistors and consuming less power, but in basic, would this work?
|
|
|
Post by roadkingrandy on Oct 11, 2018 16:27:52 GMT -8
I come from the electronic dark ages, so this solution may not be to practical, but what if all else fails, I put a small 5V relay on the TP3 wire which is off by default and kept on by power from the Pi... So when the Pi is on, the connection is there and it can be used to cut power as intended... Then the relay switches open, breaking the connection. When the battery is charged above the required value and the power controller want to go on again, it is not stopped by the TP3 as right now, because the relay is open, so it actually will power on the Pi... And when that is powered on, the relay will close again, restoring the communication between the power controller and the watchdog. There may be a more modern way using transistors and consuming less power, but in basic, would this work? I got no clue - I'm a 54 year old computer engineer with little understanding of basic electronics, lol. I'm learning as fast as I can read...
|
|
|
Post by triggerfish on Oct 11, 2018 21:43:20 GMT -8
]I got no clue - I'm a 54 year old computer engineer with little understanding of basic electronics, lol. I'm learning as fast as I can read...  53 year, computer engineer, with what electronics knowledge I have fading away since high school 
|
|
|
Post by triggerfish on Oct 16, 2018 3:30:52 GMT -8
I'm going to have to dig into this design (John did the GWP design) and see what is going on. I'll be back at you by Friday. BP Is there any news on this?
|
|
|
Post by SDL on Oct 16, 2018 9:16:46 GMT -8
Peter, It got lost in translation.  I'll get on it. BP
|
|