What is this page about?
When the NSLU2 first gets power from the external power supply, it remains switched off. The following content is for people who want to change this behaviour so that the NSLU2 automatically boots when power is supplied. This might be useful if you have power failures every now and then, or if you want to power off your NSLU2 using an external timer.
As with any hardware modification, use at your own risk, and don't take any issues up with Linksys. It certainly voids your warranty.
Five solutions are offered below:
(There is insufficient evidence to show if the current two solutions are equally effective.)
Note that this only reboots when a power failure occurs. If you also want to reboot on a kernel panic, have a look at AutoRebootOnPanic
Alternative 1 (MCP120-450DI/TO)
As Edi suggests below, the Microchip MCP120-450DI/TO is a cheap, easy to implement and reliable solution. The part can be bought from Mouser electronics for $0.35 plus shipping or from Digikey for $0.43 plus shipping. For US shipment from Mouser the cheapest option is first class mail which always ends up cheaper than the estimate they give. The Mouser electronics part number is 579-MCP120-450DI/TO and the Digikey part number is MCP120-450DI/TO-ND. You can get sample quantities of the MCP120-450DI/TO from the Microchip sample program. You may request up to 5 part numbers.
I found the power to U15 (74HC74) glitches when the slug attempts to power down either via software or from pushing the power button. This trips the MCP120 and causes the power to not shutdown properly. I mounted the MCP120 to pick up power from the power supply jack and then ran one wire from the RST pin to R94. Connect the RST pin to the end of R94 that is also connected to U15 - pin 4 (74HC74). Here is a picture of my solution.
My slug starts up at power-on every time. And the front button still functions properly for shutdown or restart. This is much simpler to implement than the circuit board with the 74HC123A and a bunch of discrete components.
Note: The MCP120-450xx/TO-92 ships in four different "bondouts". Mark's solution works with the D type. If you use other packages than this (F, G or H type) Vdd, Vss and RST are on different leads! More information can be found here. I used the H type which you can order here. The picture shows the layout.
Replace the tree components with a reset controller. I used the MCP120-450DI.
This device will tie down the Preset of the D-flip-flop for about 350ms after power on. Should work in all conditions of power down/up.
This is a nicely packaged version of an approach that was tried & turned out not to be reliable. I found that forcing the preset input of this flip-flop when power is applied would appear to work some or most of the time. But the CPU did not reset properly -- the issue wasn't getting power on, but getting power on and getting the CPU to reset. Many time constants, including in the 150-750 msec range delivered by this part were tried. Thus, after spending quite some time instrumenting the board and analyzing the issues, I went to the 123/PCB approach, which has worked for many units over many months. The key difference is that it allows the 5V supply to become stable before turning the 3.3V supply on. It is harder to build; my focus was on rock simple, easily available components.
If someone can explain why this implemention is different from previous attempts in this family and how it allows the CPU reset to happen correctly, I'd be happy to abandon the 123 approach and endorse this one. It is not obvious to me that it does. However, while it remains empirically-based, I'm sticking with the 123/PCB solution (Alternative 2).
To follow up on tlhackque's comment - What is the exact behaviour of the slug with this part soldered on? What happens when the slug is shut down with the power button or through a shutdown shell command - does the slug reboot (successfully of unsuccessfully) or stay off till there is a power interruption or it is manually turned on?
PS: Thanks to hase for his excellent response - for the record, this solution works perfectly with my NSLU2 as he describes below.
Michael: with the MCP120, the behavior is usually that the slug powers on automatically when power is applied. Apart from that, the behavior is the same as for the unmodified slug, e.g. the power button still works fine.
Problem is: I modified 20 slugs so far, Success count is 15, so one out of 5 does not automagically come on when power is applied. I am a bit lost why this is the case, so maybe someone can elaborate on the power circuit of the slug a bit; This would same me the time to reverse-engineer it :-)
For 15 slugs I see the mod to work really fine: every time that power is restored, the slug comes on and boots. The other 5 show the Power LED come one for a short time, then go off again. What timer is defying me here?
The MCP120 didn't worked on my slug. So I replaced it with another one and tried again: it worked perfectly. I guess the manufacturing process doesn't give out predicatble results.
The MCP120 worked fine in my slug, at least in regard to the power-on. It boots fine every time power is applied but the power button does not work correctly anymore. It still shuts down when the power button is pressed (e.g. the slug is no longer responds to pings and the disk activity ceases), but all the lights remain on. It will not fully power down unless it is unplugged. It doesn't appear to be a big deal, but you might want to be aware of the potential problem.
A brief description of how this works would be useful, I think I know from looking at the datasheet, but confirmation would be good - what would be the effect of changing the 450 (which operates the power button when vdd falls below 4.50v) with other types - e.g. the 475 (which operates at 4.75v) - the 475 is a lot easier for me to get hold of.
I hace successfully used a MCP120/475HI. works great.
For what it's worth, I have used a Dallas Semiconductor DS1233
We've also been successful with a Dallas DS1233-10. It was easier to find here in France than the MCP120, from Radiospares who delivered the chips in 1 business day. Please note that the pinout of the DS1233-10 is slightly different from the MCP120.
The trick here is to find a part with an open-drain output whose power-on time is longer than the rather loosely specified 140-500msec provided by the TS809 (see PowerSwitchingSchematic). I would recommend the DS1233M part which runs 300msec - 1 second, its chances of lasting longer than the TS809 are higher.
Tried nspon suggestion about using a DS1233M-5+ part, and it works perfectly, with the added bouns of the straight forward pinout comparing it to the DS1233-10 one. Thanks nspon!
Alternative 2 (74HC123 monoflop)
The NSLU2 power-on sequence is more complicated than it appears. There are several hardware and software timers.
The key to the power switch, as others have noted, is a 7474 flip-flop which uses the always-on 5V supply to turn on the rest of the power and trip the voltage supervisor, which ensures a proper reset for the processor. As provided by Linksys, the flip-flop powers up in the reset (cleared) state. The power switch sets it. The power switch is also readable by software, which also has a path to clear the flip-flop.
Most previous attempts to cause power to automatically turn on have attempted to assert the (otherwise unused) asynchronous preset pin of the flop longer than the existing circuitry holds the asynchronous clear pin. Various time constants have been tried. The results have been intermittent because this defeats the reset sequencer.
This version allows the normal reset sequence to occur, then electronically pushes the power-on button. It does this by detecting always-on 5V power, waiting about 2 seconds for power to stabilize and reset to occur, then using a short pulse to set the 7474 flip-flop.
This has been implemented successfully as a hand-wired circuit, as well as on a small PCB. Hand-wiring is not for the faint of heart -- or, in my case, if you have more than one unit to modify!
The only limitation is that power does have to stay off long enough for the timer to reset; if you test by unplugging the DC power cord, this can take a while. In real life, this hasn't been a problem.
Now for the details:
You could add a mechanical switch in series with the output to restore the normal behavior, i.e. no auto power-on. If you try the switch approach, don't remove the existing pull-up resistor.
In any case, I have no need for selecting a manual controlled power-on mode, so I haven't pursued it.
Printed Circuit Board implementation
The Power-on Enhancement Module (PEM) PCB installed
The thick black wire is ground. The red wire picks up 5V from the 7474, and the white wire is the output to the preset pin.
The PEM PCB is inverted and glued upside-down onto the NSLU2 PCB. You'll want to trim a couple of component leads, and be careful not to introduce any unexpected connections. The height of the large capacitor is the critical dimension. If it is marginal, a mechanical shim between the case and the other side of the board may help to align the case.
If you want to build the Printed Circuit Boards, here are the Gerber files that I used (in .zip archives).
Alternative 3 (Single chip variant of Alternative 2)
This is a variant of Alternative 2 that uses a single chip only. And no PCB.
The trick is to use a microcontroller and program it to show a similar behavior as the oneshot-solution (Alternative 2). I used an Atmel ATtiny13 which costs about €1.60 in single quantities and quickly hacked together the program (Basic - bäh - but Bascom is free in the demo version and I am lazy) to wait 2500 ms, then pull a pin low for 100 ms, release it again and then loop endless.
I used the simple programming adapter which draws power for the chip from the LPT. Sadly this does not work with every PC parallel port (Asus A8V does not, ancient Asus P2B works, your mileage may vary).
One drawback is that this simple hack does not power on the slug if power is lost for a short time only. The Vcc for the μC must fall below about 1.8V before the power-on reset logic will trip and such trigger the power-on pulse again. You are welcome to use the chips analogue input to detect such brownouts :-)
This works for me on the slugs that will not work with Alternative 1.
Then AVR tiny13 has 3 "brown-out detection level" Fuses:
4.3V, 2.7V and 1.8V
Could it be that the wrong fuse was blown?
Would it be possible to post the source code and make (batch) file? The code is not very complecate but for someone with no knowledge abut AVR and Bascom it would give a starting point.
I've used an ATtiny11, which is even cheaper than the ATtiny13 (about €0.60). Here's the assembler source code. If you're not interested in source, you can download the hex file, which can be programmed directly using AVRStudio or avrdude.
You can also use a Microchip pic12f200. it's a 6 pins tssop so it's kinda difficult to sodler but it take virtually no space. And it costs nothing thank to Microship sample program
Alternative 4 (basic components)
Works like circuit No.2 or 3, needs:
2 Transistors, 5 Resistors, 2 Capicators, 2 Diodes
Works like: After Power On wait for two seconds and then send a short impulse to the D-Flipflop (U15/Pin4) on the Slug's motherboard.
Alternative 5 (without hardware modification)
I connected a 2.5'' external HDD case to port 1 of the NSLU. To establish a stable power supply to the HDD case (even though not necessary for the used HDD), I used a separate USB-to-DC cable, connecting the power plug of the HDD case with a free USB port of an external USB hub. To my surprise, the NSLU started and booted even though I hadn't pressed its power button. By now, there are no problems or restrictions in functionality of the NSLU or of the HDD. Shutdown of the NSLU works fine, but the box doesn't switch off (the on/off-button stays lit all the time). For me, this seems to be a very simple-to-install and very practical solution, as I want to switch the NSLU by using a remote controlled power supply.
I find this approach almost too effective. The NSLU2 stays on all the time...there seems to be no way to turn it off!!! The off button doesn't work, so you've got to unplug the USB hub and the NSLU2. But otherwise, I've been using this approach for a few months without a glitch.
Here is a image of my slug running with the power supply from the hub. This is working great and there is no need of an extra power supply for the slug, which means you can save some energy too.
Hey this method works nice, only the hub and the slug are getting really hot. is this normal?
Unfortunately this method didn’t work for me. Only the power button light on the SLUG comes on and the SLUG doesn’t start itself up.
-- lor If you're going to use a 1-wire network (via a 1-wire USB adaptor) with your slug note that any method that provides power directly to the usb port will give you 1-wire network errors. None of your devices will work. Doesn't seem to damage them, as they'll come back to life once the usb power is removed.
Alternative 6 (without hardware modification)
This method is similar to alternative 5, but involves either constructing your own cable or somehow providing +5V to the USB ports. See more HowTo.AutoPowerSlugViaUSB. Note that it is unknown how this actually works and you could possibly fry your slug and everything connected on it if you manage to supply more than +5v
Alternative 7 (a simple wire)
There is a vartiaion of method 6, but needs minor hardware modification. Open the slug, place a wire between the power jack (+5V is the closest to U16) and any +5V of the USB ports, the easiest place is the unfitted F1 fuse (either end). Works fine, the drawbacks are that you can not power it off with the button, but it restarts at least in Debian. Also you can supply up to 2A on the USB port, but this maybe is not a real drawback.
This has worked fine for me. Power previously was a problem because of frequent power outages.
Alternative 8 (a simple USB power cable)
This is method 7, but you don't need to open the case. You need a "USB power cable"; mine came with a 4 port PCMCIA usb adaptor: one end is a USB plug, the other is a simple DC jack, about 2mm diameter, with + on the inside, - on the outside.
Cut off a small section of the slug's power lead's insulation on the + wire, which has a grey stripe on it - just enough to expose the bare wire.
Unfold a paperclip and wind it round the power lead so that it makes contact with the exposed wire (pliers help here). Use some insulating tape to tidy up and secure everything, so that just one end of the paperclip remains exposed, and use a pair of pliers to make a bit of a kink in it. Now you can slot it inside the USB power cord's jack, and they will hold firm.
Now just plug the normal power supply and the USB end of the USB power cord into the slug, and you'll be doing the same as in Method 7.
- Tom SW
Alternative 9 (a simple capacitor)
This method keeps the power switch fully functional. The only small drawback is that the power needs to be down for 5-10 seconds to turn the slug on.
The only component needed is a 100µF electrolytic capacitor that is connected between ground and R94. Connect + connection of the capacitor to the end of R94 that is also connected to U15 - pin 4 (74HC74). The cap can be mounted on top of the hole in the pcb that is next to the power jack.
This works on both of my slugs.
I made some photos showing the idea of the author above.
I confirm it did work with the recommended 100uF electrolytic capacitor. I soldered it directly to pins 4(+) and 7(-) of U15. The capacitor was laying flat with its end almost at the edge of the circuit board (opposite the reset button). Two soldered leads that were protruding through the board had to be cut short so that it could lay flat. The capacitor lying on its side was still too tall to fit back in the case, so I deformed the case by using heat and a tool to push from the inside. I used a heat gun and the tool was the cylindrical end of an old computer microphone (about as big around as a dime). (p.s. Using a 10uF ceramic capacitor will not work; I tried.)
Pictures for alternative 9
alternative 9 works also on my slug. I found some pictures explaining how to do the hacking.
(2008-10-09: the picture says 1µF cap, that would be an error, then)
Alternative 10 (a simple capacitor + diode)
This method is an enhancement of method 9. It keeps the power switch fully functional and eliminates the small drawback of the method 9 (that the power needs to be down for 5-10 seconds to turn the slug on). Now the NSLU2 always restarts.
I've added a diode in parallel of R94. When power fails the 100uF capacitor discharge itself immediatly trought the diode.
Now an "ascii art" electrical scheme, in the future I'll upload some images.
| | | | --- |diode 1N4001 or equiv. |R| === |9| / \ +-------- |4| --- | --- | | | | 4| U15 +---+-----+ | | 74HC74 +| | === |________ === 100uF | |
I've tested it successfully on my slug.
- 10-12-2008 gdelama
Alternative 11 (a transistor and resistor)
I've used some of the USB power suggestions on this page to force a remote controller based on the NSLU2 to power up after power outages etc. The suggestions are easy to implement, but they suffer from a problem that might be significant for some applications.
The problem is that, by connecting the power supply to the system through the USB ports, the NSLU2's power supervision circuitry is bypassed or sidelined. Imagine what might happen after a mains power failure, when, as often happens, power comes back in an electrically "dirty" way, with missing half-cycles, brownouts and so on. Since the NSLU2's power supply is now connected directly to the system and the USB ports, the power they receive may not be quite right -- it might be a bit low for a while at the start, or it might be a bit slow rising to its nominal voltage. These imperfections could cause the NSLU2 itself or USB peripherals to power up incorrectly. If the NSLU2's power supervision circuitry had not been bypassed, power would only be applied to the system and to the USB ports after it was good enough to satisfy the NSLU's power supervision circuitry.
The NSLU2 has a microprocessor power supply supervisor chip, a TS809 (Q11 -- see PowerSwitchingSchematic). Whenever the power supply fails to satisfy the TS809's criteria -- such as when the power is stabilizing after power-up -- the TS809 puts a latch in a 74HC74 (U15) into the reset or zero state (via pin 1 of U15). This in turn keeps power off in the rest of the system and the USB ports. Once the power supply is good enough, the TS809 stops holding the latch in reset, but the latch remains in the zero state -- and the rest of the system remains unpowered -- until the latch is set high (i.e. to 1) by the pressing of the power-on button.
However, one can use the inverse of the TS809's output to set the latch high through the latch's preset input (U15, pin 4). To form the inverse, I'm constructing an open-collector inverter from a transistor and resistor as shown below.
I picked a generally-available NPN bipolar transistor and a 10k resistor.
With this modification, if the TS809 is unhappy with the quality of the power supply, it keeps power off in the rest of the system, including the USB ports, just as nature intended. However, if the TS809 is happy, the modification causes it to set the latch, turning on power to the rest of the system, just as if the power-on button had been pressed.
One bonus is this: when you execute the Linux "poweroff" command, the NSLU2 shuts down as normal, and then turns off the power for an instant before power is reapplied and the machine restarts. So, you get a short but real power-cycling of the machine, including any bus-powered USB devices. I guess that the length of the power-off time is equal to the "Reset Active Timeout Period" of the TS809, nominally 100 mS to 380 mS.
So far, the modification has worked flawlessly. As ever, test and use at your own risk.
- Mike Brady, 2009-01-15
Alternative 12 (a USB Y cable)
For those who only use one of the USB port of the NSLU, you can provide power via a normal USB Y-cable on the secnd USB port. I use a standard USB Y-cable which came with my portable external harddisk. One end of the cable (the one with 2 connectors) being plugged in the power source (in my case a PC standing next to the NLSU). The other end of the cable (with one USB connector) in the NLSU.
--- I have fried a slug with this method. Use with caution. KB
Alternative 13 (an Uninterruptable Power Supply -UPS)
If the NSLU is stationary, just plug it into a UPS. No more outage-related power interruptions.
Alternative 14 (One resistor...)
Looking at the Circuit diagram, to turn the slug on you need to turn on Q10, this is normally done from the output of U15 = 1 (NB I think the diagram is wrong as I think this should be driven from the Q output rather than Q-bar). So we need a convenient output that goes to 1 when the power is stable, which is exactly what the output of Q11 does. So just add a resistor (around the same value as R95) between the output of Q11 and the base of Q10 so whenever the output of Q11 is high the slug is on. NB this does mean that even if the slug is powered off by software (which resets Q11) it will come straight back on again - the power and other LEDs? go off and come back on again - this may be a feature or a bug depending on your perspective!
Here is a very bad picture - I managed to trash R91 by trying to solder to it rather than Q11 but it still seems to work!
Having looked at the chip details holding the PR input of U15 active (low) during startup turns the slug on even before Q11 has reset - if both CLR and PR are active then both the outputs of U15 are high and so the slug is on... This may be why some of those solutions sometimes fail to boot, although my slug would intermittently fail to start up even before I started hacking it
All of the previous attempts are not recommended for use. If you wish to view them then they are available on the history for this page.
view · edit · print · history · Last edited by player61784.
Based on work by player61784, DavidM, KB, ray, Ken, Arnaud, Mike Brady, gdelama, mwester, garpinc, Ralph Finch, syrou, err, Colin, lavileric, NSpon, Netamego, Michael K, Michael, Phil Endecott, kirk, Darek, forrestv, Tom SW, Viruseb, fcarolo, Olivier Guilyardi, mhx, robby, lorenz117, jiauka, if, MichaelWei, theklone, exe, Chas, G de Zwart, TimSmall, jpcalvin, michael, Patrick Schneider, carsten, eFfeM, tio, tman, kinsa, dwery, Peter, hase, blaster8, Michael-Luke Jones, cStyle, tlhackque, mathieu_xwave, Mark Smith, nslu2illimitablecom, ByronT, Edi, Kaijuu, PyXpert, gerti, rwhitby, and kai.
Originally by rwhitby.
Page last modified on March 27, 2011, at 12:02 AM