NesPi Case Power Problems
-
@riverstorm First of all, I don't have the Nespi case, YET. I want one, but I will almost surely modify it, as I cannot have the power button literally cutting the power like it does. That just won't fly for sharing with friends who don't understand the risk.
The Mausberry circuit is basically just a power switch add-on some guy made and sells. There are several versions of it. Basically, it has USB power input on one side, USB power output on the other, a switch (or solder pads for one), and pins for GPIO in and out. What you do is plug your power adapter to it, then plug it into the Pi, and connect two GPIO wires. Push the switch/button, the Pi gets power. Push it again, and the circuit sends a signal on a GPIO, and then starts "listening" on the other GPIO for it to go LOW. When that happens, it assumes the Pi has powered down, so it it cuts power.
The key to making the circuit work is a simple script that launches at startup and does two things. Number one, the script sets a GPIO pin to HIGH. The point of this is so that when the circuit starts its shutdown routine the Pi will eventually go off, and when that happens, this pin will go back to LOW and the circuit will see that and cut power. Number two, the script sets up a polling loop, watching the other GPIO for a signal from the mausberry circuit (which the circuit sends when you push the power button). When the script sees this signal, it breaks out of the loop and executes a shutdown command.
I will admit, all of the recent activity around the script has been really confusing. I won't start another, but I will summarize the main things those threads achieved.
- The recommended script from Mausberry is simply a BASH script. It is not proprietary. It is just a simple BASH script that sets one pin HIGH and starts looping watching the other which is LOW. This is not very efficient, as your Pi will have this eternal BASH script looping in memory and using CPU. How much? I dunno. How inefficient is BASH? I dunno. But a Python script would be better, or so I have read, because it can use edge-detection and interrupts instead of constantly checking the state of GPIO. So, one goal for me from some of the threads was to get a Python version of the script.
- The script was written to simply shutdown. It has no regard for emulators, saving Emulation Station metadata (like last played, or favorites, etc.. It just initiates a power down. This is safe, certainly, but can be frustrating if you also want it to preserve ES data. So, a major revision to the script included emulator detection and closure plus graceful exit of ES to save metadata--and THEN do a shutdown. Meleu was able to do something really cool and that was to setup a 'service' such that any shutdown request kicks-off the ES detection and closure of running emulators. This is nice because it separates the retropie-specfic shutdown innovations from the script that interacts with mausberry and GPIO pins, effectively making graceful exit and metadata preservation generic and usable with any shutdown mechanism. For example, if you had a game running and simultaneously SSH into the Pi and initiate a shutdown command, Meleu's service would find the emulator and quit, then close ES.
- Finally, and this part is really Mausberry-specific, a few of us worked on an additional tidbit to use a third GPIO to trigger a mosfet/opto-coupler relay or a transistor to electrically press the power button during a soft shutdown. This is to solve a small problem (or rather, an incomplete solution) with the design of the Mausberry. If you are using a Mausberry curcuit with the script running as-is, and you request a shutdown via software (such as through the Emulation Station menu) the Pi starts the shutdown routine, but at the end, the Mausberry circuit does NOT cut power. Why? Because it is not "listening" to that first GPIO pin to go LOW until it detects someone has pushed its power button. There are various reasons for why it was designed this way, but point is that Mausberry gets stuck in powered-on mode if you decide to shutdown in software. You need to use the button in order for it to power down. And if you try after the fact, it won't always work. SO. . . I hooked up a transistor to a GPIO, and I made an additional call in Meleu's service that tells my GPIO->Transistor to "PUSH" the power button, like tapping Mausberry on the shoulder and waking it up to watch it's own GPIO pin for the Pi to power down. This works, but we lose software reboots (because the service does not know the difference between a reboot and a shutdown).
-
Wow! Ok thanks for that summary. I was reading along in the other threads but I didn't quite understand the complexities but writing it out as one explanation makes sense. I could live without the reboot feature.
I'll keep an eye out as you continue development. I would like to get the case too. The idea of leaving it plugged in and using a switch for power and shutdown would be a nice change. Being able to do that makes it seem more like a "real" mini console.
-
@riverstorm Agreed. Everything that has been learned/developed to date makes me very confident in using that case for a nice console system. I know others are way ahead of me, but my focus has always been the arcade. This will be a different direction, and the Nespi seems like a good place to land.
I really don't mind soft reboot either. Any shutdown/restart through software ends up being a complete shutdown on my system and I am just fine with that. It works nicely, it is safe, and I will do the same thing with the Nespi. The addition of a reset button is nice, as I will wire this up to a separate GPIO as others have and simply use it to close out of emulators. In that sense, it is not exactly how Reset worked on the NES, but it will be nice to have a dedicated exit for folks who might not remember the hotkeys.
-
@caver01 said in NesPi Case Power Problems:
I will wire this up to a separate GPIO as others have and simply use it to close out of emulators. In that sense, it is not exactly how Reset worked on the NES, but it will be nice to have a dedicated exit for folks who might not remember the hotkeys.
I read that somewhere and thought that's a nice optional use of the reset button. I agree I mainly focus on the old arcade games. :)
-
@caver01 Hehe ;) Good explaination sir.
I worked on the NESPi hack and I'm able to perform prober software shutdowns but you have to modify
/opt/retropie/emulationstation/emulationstation.sh
file.There is a line that removes
/tmp/es-shutdown
file - I added a&&
and create annother file to/dev/shm
and check this with meleus script and then I'm able to differ between reboots and shutdowns ;)
As the shm-partition is a RAM-drive we do not care about file cleanups ;)The modification with a simple diode, instead if transistors works like a charm. But I think this will only be usefull if you use the Mausberry switch.
Regards
cyperghost -
@cyperghost I was using the es-shutdown as a trigger at one point, but wont that get overwritten during updates?
Also, can you point me to where you wired just a diode? That seems a lot easier that all of the careful soldering of a transistor!
-
@caver01 Yes... that's the only caveeat but you can rebuild it from time to time... afaik it will only be overwritten if you update ES only.
We talked about this issue and if you can live with a missing reboot option it's okay. But personally I need a proper reboot option for testing purposes and with just one line you can solve this ;)The diode is connected to
Pie GPIO output o------------------->|--------------o Mausberry power switch ground
This simulates a buttonpress and saves the Pie from backpowering!You asked me in this topic, too so you see I stick to my outfindings ;)
-
@cyperghost Ha ha ha. Yes. I remember now. I may have to give this a try. Seems so simple.
-
my power light is on faintly when its actully off and even when its unplugged , very odd
-
@caver01 disconect hdmi cable ;)
-
-
@xflesk said in NesPi Case Power Problems:
@caver01 disconect hdmi cable ;)
yup thats was it, never thought the HDMI was giving it some power but obviously it was
thanks
-
I wanted to add some findings to the power issues on this case. I followed @iggy 's solution in another thread and it was super successful.
I had both a Canakit adapter 2.5a and a Pi Hut 2.5a power supply. I don't know if some of it is just bad luck or manufacturing, but I had power issues even scrolling through my game list ( which is a video preview list, not just screenshots/box art).
I decided to solder new larger 22 awg pos & neg input power wires (the ones from the power input/buttons board on the case that runs to the other board which sits under the usb/ethernet circuit board). Replacing these wires cured my lightning bolt issues. It seems that the other wires are fine for voltage but as many speculated, the main power input wires were not thick enough and too much current/voltage was lost after running through the power/reset button board. All seem so be well and am even playing N64 games without any voltage issues. This is with a gampade and a keyboard plugged in, with wifi on, and a third wireless input (ps3 controller ) all being active at once.
Hope this helps.
-
Still having the issue where a power down followed by pressing the power button the light stays on just dim, of course unplugging the HDMI kills the light but why do I have to unplugg the HDMI cable everytime to make the light turn off after shutting off the NESPI case
-
@valhalla_pi that is normal in power down mode. The Pi is just sleeping. Unless you are using a mausberry circuit or similar hardware that truly cuts the power, this low power hibernation is as good as you can get.
-
Have you tried another screen/cable?
I have seen this behavior as well with my NESPi case, but it only occurred on an HP monitor I was using that also has powered speakers attached to the monitor. I was using a DVI-HDMI cable and had the same strange (dim power light) issue when I powered off. I believe that at times, if I simply powered off my monitor it would kill the dim light, but removing the HDMI cable always did the trick.
When I switched to my TV (Sony - regular HDMI cable) and powered off, the light went right out (like I think it should).
I also saw the lightning bolt icon when connected to that monitor (after using it to setup the system. I probably used that monitor for about 3 hours on and off (different days), but it was only after a couple of days that the lightning bolt started appearing.
I haven't used the TV enough yet to see it there, but I'm wondering if the somewhat "powered" HDMI connection on the monitor was contributing to that issue as well. I'll report back if I see any other details.
-
@caver01 Indeed it is a simple Methode to power off and power on the Pie. But as you said the power cutoff just be eine by a circuit called
Mausberry PowerBlock AtxPie .... -
@caver01 thanks for the reply must be my monitor than, because the dim light stays on if I unplug the micro usb power and leave the HDMI plugged in
Im using a Asus MG28UQ
-
@drake999 said in NesPi Case Power Problems:
Well I've suffered for the community yet again and through testing several adapters I found a working solution. I purchased the adapter below and no under-voltage issues whatsoever, with a 1350 Mhz overclock and the 5V fan attached to the NesPi case fan pins. I tortured all four cores for 30 minutes with sysbench and not one under-voltage warning. Temps remained below 65 degrees (because of my heatsinks and fan). For those who are interested, here is the adapter I used.
@drake999 Just wanted to upvote and thank you for this suggestion. I ordered this power supply and believe to have fixed my low voltage warning issue with the NESPi case as well. I've been using it for over a month. I was previously using a 5v CanaKit power adapter. Thanks for your research! I appreciated not having to solder new wires in there.
I had also bought a second NESPi case about a few weeks after my first, and that one has NOT shown any low voltage warnings to my knowledge (also using CanaKit 5v PS). Thinking either some variance between different builds or perhaps an improvement on newer production.
-
Hey guys iv been playing with issue for a little bit and was thing how was the power getting to the pies motherboard and think its getting its power from the usb port and the 5v fan pins.
This had me thinking a long time back I connected a usb powered hub to one and found that the pie stayed on even if I disconnected the power from the pies micro usb port, but the under voltage symbol work come on and the machine would start to run very slow.
So what iv done is solder to wires from the nespi case power and reset switch circuit board( theres 3 pairs positive + and negative - wires coming on and off it)
I used the middle + and - to run a wire to the pies board (had to solder wires to board) positive + PP2 and negative - PP5 points on the underside of the motherboard near the micro usb port.
This seems to have fixed the problem so I tested the pie by running 007 golden eye for the n64 (had the left dpad stuck down so the character would spin around over and over) for and hour and then tried Mario kart 64 (did the same thing with the buttons) for an hour then tried G-police 2 for the ps1 (same again with the buttons) for an hour I dident get under voltage fault.
So I hope this will help im going to buy a few more nespi cases and try with them to se if it works with them too.
Hope this helps
Contributions to the project are always appreciated, so if you would like to support us with a donation you can do so here.
Hosting provided by Mythic-Beasts. See the Hosting Information page for more information.