Boot order
-
Hello. I am wondering, what is the boot order of retropie? I have my raspberry pi inside of an old xbox case, and I have two LEDs wired up to it, with a python script that is loaded in /etc/rc.local to come on once the pi powers on. The problem now however, is that the LEDs come on really late in the boot sequence. (After ES has started loading).
I am looking to trigger the LEDs to turn on sooner in the sequence, preferably immediately after the kernel has loaded. Is this possible, and if so, where would I put the script at?
The script currently uses wiringpi2 as the python library, and it works, just not at the expected time. Could somebody offer me some insight on where I could put it so that it fires off sooner? I did it a long time ago, like 3 years ago, using an older kernel, but it involved mounting a virtual device or something at bootup so that the gpio command was available. Since wiringpi library is the preferred method now, I'd like to see about using that as soon as possible in the boot sequence.
-
@masteryoer could probably check dmesg and see when it's called. Some libraries obviously need certain things initialised before they will run - we had a few issues with that with the splash screens.
https://www.raspberrypi.org/forums/viewtopic.php?p=680312
From what I remember the stuff in
/etc/init.d/
loads alphabetically so if you start your launch script with an a in that folder it will start sooner than others. To a point obviously as there is underlying kernel stuff that loads first.If you were really ambitious you could compile a custom kernel but I don't know if the effort is worth it for a second or two gain.
-
@herb_fargus I honestly wouldn't mind a second or two, but the script doesn't trigger now, as I said, until the ES loading splash screen comes up, and sometimes even after that (so 15-20 seconds or so). By that time, the system is already booted up. I'd like to trigger it so that it fires off almost as soon as the pi gets power and begins booting, but I am not sure I can get that soon into it without wiring directly into the power supply coming into the pi, and at that point the LEDs would be on even if the PI wasn't on, as long as power was coming in, and that's not ideally how I want it.
-
@masteryoer how is the power button / switch wired up?
-
I have a switch mounted to the back of the original xbox case that connects the xbox's power supply feed lines together to turn the power on to the system (The same thing that happens when you put a paperclip in the two PC PSU connectors to turn the power supply on). From there, I have the pi's micro-usb wired in to the 5v rail on the power supply and the ground on the powersupply, so that when I switch the switch on the back of the xbox, it powers on the pi.
I also have pins 5 and 6 on the pi wired up to a momentary switch on the front of the xbox (the original power button), and a python script that watches for input on pin 5. Once it gets it, it does a 'sudo shutdown -h' to halt the system. From then, when I push the power button it jumps 5 and 6 and forces a system reboot which powers it back on (As long as the main power supply wasn't switched off)
-
and currently, I don't have an /etc/init.d script, as I couldn't quite figure out how to create one. Right now, the script is just inside of /etc/rc.local before the exit 0 call in the script.
I could potentially put it in a /etc/init.d/ script, but I am not sure how much sooner that one loads up then the rest of them, and if python is loaded at the time init.d is ran. If it is, then I could even put it above asplashmessage script, which I believe is the retropie splash message that appears. (Or video if you have it set). That would be ideal, and I will give it a try tomorrow!
-
@masteryoer are the leds only used to show power on the front? I assume so. And since you mention two leds i am assuming its an original xbox. I would wire up the leds to a usb port. When you put it in shutdown mode the usb ports turn off. When you power it back on it takes a few seconds before power is supplied to the usb ports. At that time your leds will kick on. You can solder them to the +5v and ground pins on the bottom side of the usb ports as they wont interfere with a device plugged into the usb port.
-
Yes, I replaced the original two leds on the front of the original Xbox. I am trying to avoid soldering directly to the pi, as I may want to swap out for a pi3 at one point. I suppose I could plug into one of the spare USB ports (I am only using two, one for a flash drive the other for a 4 port powered USB hub for the controllers on the front) on the pi and wire the leds into that, but it would be nice to have them wired into the pie gpio pins, so that I could potentially use them for something else later. (Like turning the leds orange if the temperature on the system reaches a certain threshold, since I already use the gpio to turn on the system fan when it gets over 70C.)
-
@masteryoer if you use bi-color leds like it originally had you could put the main color (green) on usb, then put the secondary color (red) to the same pin as the fan voltage then it would give you orange when the fan kicked on. Ground could get wired to the gpio as well. Or if you wanted red as the main color just reverse that. They make other bi-color leds too. Red and blue ones make purple when both red and blue are triggered. Blue and white ones make sky blue.
-
I was just thinking that. I already have multi color now. I wasn't able to salvage the original green/orange so I replaced it with neon blue. I could wire the secondary color up to the van, this is true but I don't think the gpio pins could push 3.3v to a fan and leds. I'd more than likely just reuse the two sets of gpio pins I am using now and trigger them in the script that triggers the fan to come on.
You've given me great ideas, thanks for making it easier on me! I'll show pictures of my work tomorrow.
-
@masteryoer no problem. The 3.3v probably could handle both. Leds draw so little power. Definitely would love to see what you come up with.
-
@masteryoer i believe i have probably modded more original xbox's than anyone else on the planet. Here are some pics of my own personal one for some inspiration.
A very modified arcade pushbutton and the dvd dongle ir on the right side of the player 4 port. It disables when a controller is plugged into player 4.
An lcd screen that displays info. Great on dvd's. Cant display very well on old camera.
And some bi color controller ports.
-
@edmaul69 yes I will defer to the hardware geniuses for such a thing I have no idea what I'm talking about ;)
-
@herb_fargus im a hardware guy. The software i learn enough to get me what i want but coding and all that is above my head. I have no desire to learn either. When i was doing html i never slept. I didnt want to learn code for that very reason. When i have something in my head i wont stop until im done. And i was losing too much sleep. Troubleshooting is the same for me. I get obsessed with fixing the problem. Thankfully i backup everything i update on the pi, so if something doesnt work i report the issue or ask about it. If no fix is available at the time i have the last version of that program and problem solved. I now get a little bit of sleep these days.
-
Here are some images I took of my system. One day, I will clean up the wiring a bit, as it was one really organized and neat but during iterations of adding to it it's gotten sloppy again.
After wiring the LEDs and the fan up to a USB connector together, I now get the yellow lightning bolt in the upper right corner of my screen, as seen in the video. Not sure why, the power supply is putting out more than enough power. I may disconnect the fan from it, as it's technically a 12v fan that was originally wired directly up to the 12v system. I am not sure I'll ever need the fan anyway, just wanted it as a precaution.
This first image shows the guys of the system. You can see the PI, the usb hub and the original 12v power supply from the original xbox.
This next image shows the custom connectors I made for the back. I cut out three holes for an RCA to RCA splicer, and hot glued an HDMI adapter, the RCA splicer, and a cat5 to cat5 connector to the back of the xbox chassis.
This is the back of the system, with the main power on/off switch, and the hdmi, rca, and ethernet ports.
This picture shows the front connectors. I took out the original ones, and replaced them with USB extension cables. They plug into a 4-port wired USB hub inside the system. (The hub is powered by the power supply). The eject button acts as a hard reset in the case of system freeze (Its connected to the 'Run' jumpers on the PI)
The power button acts as the power on/off to put the system in halt mode, or wake it up from halt mode (jumping pins 5 and 6).
The circle of light around the 'eject' button lights up a neon blue color.
This is the finished product-ish. Still some tweaks to do, but it's for the most part there.
And finally, a video of the boot sequence. I need to adjust some things so that it boots faster, as I don't like the 10-15 second black screen at the start, and the long wait between the boot sequence and the ES loading screen.
https://www.dropbox.com/s/b2d75bl8yy8q0nr/01e1e1e84bb62da7c29341b95d087012a42b0a5d2d.mp4?dl=0
I am also working on a custom theme, which I have a screenshot of here:
ALSO: Please do not pay attention to the stuff all over the coffee table. That's currently my work-space, and glass is very hard to keep clean :\
-
@edmaul69 v.nice mod - I hope you run xbmc4xbox :-)
-
@BuZz xbmc as the main program is the only way to run an xbox. I originally started with evox or avalaunch, but xbmc evolved into something awesome compared to all other launchers
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.