LowPowerLab Forum

Hardware support => ATXRaspi => Topic started by: Cybergei on September 12, 2014, 01:15:01 PM

Title: System does not power down [solved]
Post by: Cybergei on September 12, 2014, 01:15:01 PM
Using the instruction from the ATX page, it sates to connect the ATX to GPIO 7 & 8. Those are pins 24 & 26 respectively.

From an Off state, when pressing the momentary switch, the Pi does come on.  Using htop, we can also see that /etc/shutdowncheck is running.

When pressing the momentary switch for 4 seconds, the PI does nothing.  It never enters the shutdown or poweroff sequence.

When holding the switch for 6 seconds, the PI does a forced shutdown.

Can anyone either see any mistake that I have done or have you experienced and solved this?
Title: Re: System does not power down
Post by: Felix on September 12, 2014, 01:20:26 PM
Hello Cybergei, Thanks for joining the forum.

You confirmed shutdowncheck is running, so I assume everything is fine on that end.
Can you please double check that the wires are not installed backwards (ie switched).

ATXRaspi has a red LED (older models are amber) next to the shutdown signal on the PCB itself, that should come ON once the button is held for around 3 seconds, which also asserts the signal going into the Pi.

Does that LED come ON as described above?
Title: Re: System does not power down
Post by: Cybergei on September 12, 2014, 01:55:38 PM
I have version 2.4  It is of course possible that the wires are switched, I will try to attach a pic.  No LED comes on, on the ATX.  When ON, there are still no LEDs on the ATX on.
Title: Re: System does not power down
Post by: Felix on September 12, 2014, 02:54:02 PM
Do you see this message at the end of boot:

Code: [Select]
ATXRaspi shutdown script starting…
Asserting pins (7=in,low; 8=out,high)

After this script starts, you should see a GREEN LED turn ON on ATXRaspi (on the boot arrow). If not, your script is not running correctly or wiring is not as expected although in the picture it looks right.

Otherwise assuming the ATXRaspi board is good (all are tested) and it wasn't zapped in shipping or handling, the only remaining thing is the script install. If the INPUT to ATXRaspi is not asserted, then ATXRaspi will not issue a shutdown (because it's waiting for INPUT=high to know that Pi has booted and shutdowncheck is running).

Can you take a multimeter and check if the input from PI and into ATXRaspi is coming HIGH after booting?
Title: Re: System does not power down
Post by: Felix on September 12, 2014, 04:07:52 PM
I have actually just updated the installation guide yet again. The changes can be seen on the ATXRaspi page (http://lowpowerlab.com/atxraspi)
Most notably you only need to download one bash setup script that will do everything for you. No more dependency on WiringPi.
If you want to try this please first delete the entry in /etc/rc.local for the old script (using sudo nano /etc/rc.local).
Writeup is here (http://lowpowerlab.com/blog/2014/09/09/atxraspi-code-update/).
Title: Re: System does not power down
Post by: Cybergei on September 13, 2014, 07:10:56 AM
Update:  I have found that first: wiringPi was installed in a different location then the scripts requested /home/pi/wiringPi path.  I have made the adjustments.

Now the green led comes on after the ATXRaspi shutdown script.

Now when holding the power button down for 3-4 seconds, the led pulses but there is no other response.  The shutdown script. never actually executes.

If I continue to hold down the power button for 6-8 seconds, then there is a forced shutdown.

What ya think?
Title: Re: System does not power down
Post by: Cybergei on September 13, 2014, 09:08:24 AM
More tests, while the unit is ON, GPIO 7 reads low and 8 reads high.  When holding the power button for 3-4 seconds, the LED pulses, but the Amber LED on the ATX does not come on.
Title: Re: System does not power down
Post by: Felix on September 13, 2014, 04:35:42 PM
GPIO 7 should go HIGH once the button LED starts pulsing. The pulsing means GPIO8 is HIGH to signal that Pi has booted and script is running. Once shutdown has begun the SHUTDOWN LED on ATXRaspi should be ON and the script should detect that on GPIO7 as a HIGH and issue a sudo poweroff.
Title: Re: System does not power down
Post by: Cybergei on September 13, 2014, 10:35:57 PM
Ok, but that does not happen, even with your new install. Could it be an owner permission issue? What user should own the script? Is 755 still good permissions? User pi is not a sudo user and normally can not perform a shutdown without an edit to the Sudoers file.

Just ideas.

Or perhaps is the signal from the pin not being sent?
Title: Re: System does not power down
Post by: Felix on September 14, 2014, 03:58:21 PM
This script has aways been 755. You could chmod it to 777 to avoid any permission issues. The rc.local script is run by the system so I would not expect trouble there. I could not find any issues with the new script.
Title: Re: System does not power down
Post by: Cybergei on September 14, 2014, 10:37:47 PM
Morning. The forced shutdown issue has corrupted the SD Card Superblock now, so I will need to reimage and start over. Perhaps that will fix any mods previously made. I need to get this working so that I can order 100 more..
Title: Re: System does not power down
Post by: Felix on September 15, 2014, 07:54:30 AM
Forced shutdowns are not really meant to be used, they are just there so you can do it if you really really have to. But you can always log-in and do sudo halt instead to avoid file system corruption.

By the way the OS I used is Raspbian (latest 6-20-14).
You should just wire ATXRaspi to your Pi as explaned here (http://www.lowpowerlab.com/atxraspi), then turn it on using ATXRaspi (first time).
Then to activate the ATXRaspi functionality you need to install the script:

Code: [Select]
$ sudo wget https://raw.githubusercontent.com/LowPowerLab/ATX-Raspi/master/shutdownchecksetup.sh
$ sudo bash shutdownchecksetup.sh
$ sudo rm shutdownchecksetup.sh
$ sudo reboot

Let us know how your new image install goes.
Title: Re: System does not power down
Post by: Felix on September 16, 2014, 08:02:26 PM
Hi Cybergei, did you make any progress, any updates on this?
Title: Re: System does not power down
Post by: Cybergei on September 21, 2014, 12:06:06 AM
Sorry, day job pushed this priority back a few days.  I have rebuilt the system from scratch and have the exact same results.  What if there is no ACPI driver in the kernel?  Or what if it is deactivated somewhere like you can do in Grub.  Since Pi does not use Grub, I will search for it elsewhere, but at the moment, ACPI is what I am chasing since everything else seems correct.  It has to be the Pi OS.
Title: Re: System does not power down
Post by: Cybergei on September 21, 2014, 01:06:46 AM
Still no love.  I had to switch the pins to GPIO7 -> 23  & GPIO8 ->24  because another script was using 7.  Still when pressing the power ON, 23 remains low until ATXRaspi comes on, then goes high.  When pressing the poweroff, 24 still does not go high. 23 remains the same.  ATX is affecting the Pi since it is sending 23 high. I am all out of ideas now.
Title: Re: System does not power down
Post by: Cybergei on September 21, 2014, 01:38:36 AM
Shutdown script question here.  Your script is checking for the value of /sys/class/gpio/gpio$SHUTDOWN/value which is set to 0, far as I can tell, always.

Then it is testing for a change to anything other than 0.  How does pushing your power button change it from 0 to anything?  Far as I can tell, the script issues a shutdown command if the value is != 0 but there is never a change.  Is there a line of code missing?
Title: Re: System does not power down
Post by: Felix on September 21, 2014, 02:31:50 PM
ATXRaspi will pull a pin UP when the shutdown condition is met (the button held for 3sec and BOOTOK signal from PI==HIGH). That will read HIGH (or 1) on the Pi side and the script will detect that and start a sudo poweroff.
The default pin assignments are:
SHUTDOWN=7
BOOT=8

To verify you have a good ATXRaspi please completely disconnect it from your Pi. You can test it by itself. Just turn it ON using the button as normally. At that point the output side will have 5V. Simulate a Pi boot OK by connecting the BOOTOK to the 5V output (with a jumper wire) - the LED next to BOOTOK will turn ON. Now hold the button for 3 seconds. That should assert the SHUTDOWN signal and turn the LED next to it, also the LED connected (if any)  to your button will start pulsing. Give it a few seconds and then disconnect the BOOTOK signal from 5V. At that point the BOOTOK LED turns off and the pulsing will be faster on the button LED. After another few seconds power will be cut off.
Title: Re: System does not power down
Post by: Cybergei on September 21, 2014, 09:56:54 PM
Great post on testing the ATX Raspi.  After connecting 5v to BOOTOK the green LED does come on.  While the Green LED is on, I have held the button for 3-4 seconds until the LED starts pulsing.  after around 2 seconds I disconnected the BOOTOK.  No other LED ever comes on and the Green LED goes off.  The poser LED does pulse for a few seconds and the unit does cut power after a few more seconds.  But no other LED other than that Green one ever comes on.

What ya think?
Title: Re: System does not power down
Post by: Felix on September 21, 2014, 10:23:12 PM
That would indicate the SHUTDOWN signal does not get turned HIGH. Sounds like a board with some missing/bad functionality.
They do all get tested with that same sequence I've described but the human factor, shipping, and user handling can still introduce an error or perhaps zapping the chip (very unlikely but not unheard of). To put this all aside, please contact me directly for getting a replacement out to you.
Title: Re: System does not power down
Post by: Cybergei on September 21, 2014, 10:28:41 PM
The error in the board is no problem.  What matters most is the support after the sale.  You have done a fantastic job.  I will buy another board as the damage certainly could have come from me during soldering or anything else.  I appreciate your focus with finding this issue with me.
Title: Re: System does not power down
Post by: Felix on September 22, 2014, 08:47:46 AM
Thanks, I guess I'm glad you can say that after it taking so long. It's partly my fault assuming the board was good the whole time, but it appears it is not, that's a bummer. Next time I will make sure to have the user test the board before chasing rabbits in wonderland. Maybe because I've seen this same type of issue so many times before where the script or wiring was not done as expected, or some OS access rights etc.
Title: Re: System does not power down
Post by: Cybergei on September 22, 2014, 02:26:13 PM
Nah, come on.  It is trouble shooting process.  You are faced with dudes that are beginners and have no idea what step one is.  It is hard to provide support via anything remote. You did absolutely fine, and that is what adds worth to your project.  I sincerely appreciate your attention and thought that you gifted to me.

It is kinda like when you are providing computer support.  You know that you have to ask if the plugged the computer in.  You do not want to ask, but if you don't, that will be the problem.  It is a process.  Best part is that now the entire process has been exposed for everyone to read about.  So it simply adds that much more to it.

Anyone says otherwise, they have not ever developed a product and put it on the market before.
Title: Re: System does not power down
Post by: Felix on September 22, 2014, 02:29:31 PM
You are spot on. I'm still learning how to best respond to user issues and be most efficient for both parties. The forum has really helped reduce my support time and having to repeat the same answer over and over. So thanks for your patience.
Unfortunately I'm not a big company to afford a direct line where someone can pick up the phone and walk through everything live. But I'm trying my best to help people and provide whatever support I can for my few products.
Title: Re: System does not power down
Post by: Cybergei on September 22, 2014, 03:35:24 PM
Thanks guy.  I will order soon.  I have a bit more work to do on my main unit but I think I will need at least 3.  I am building prototypes right now using embedded units so, a power on/off is necessary.
Title: Re: System does not power down
Post by: Felix on September 22, 2014, 04:10:59 PM
Ok just FYI in case you wanted to get some in the next week - I sold quite a few this past week and I'm down to a handful of the last batch right now. I have more PCBs on order but they will take another week or so to get here then some more time until I get to assemble and test them etc.
Title: Re: System does not power down
Post by: Cybergei on September 22, 2014, 09:53:52 PM
Thanks for letting me know. There is no hurry
Title: Re: System does not power down
Post by: Cybergei on October 26, 2014, 10:45:20 AM
UPDATE:  >Got it all working now.  I have hard wired my ATXRaspi to the P5 of my Pi using similar tools and connections to the original video on the LL website.  I am also using the ferrite cylinder along with a fuse inserted in to the board.  For the wiring diagram for the P5 header which I am using, most of the ones that I found were incorrect.  The correct one can be found at http://www.raspberrypi-spy.co.uk/2012/09/raspberry-pi-p5-header/ (http://www.raspberrypi-spy.co.uk/2012/09/raspberry-pi-p5-header/)  Also important is that I used  SHUTDOWN=28 and BOOT=29 in my shutdowncheck.sh script.  Make sure that you wire accordingly using the given diagram.  If anyone wants more details, feel free to ask.
Title: Re: System does not power down
Post by: Felix on October 26, 2014, 09:58:00 PM
Thanks for the update, much appreciated.