Dell Poweredge

  • Subscribe to our RSS feed.
  • Twitter
  • StumbleUpon
  • Reddit
  • Facebook
  • Digg

Saturday, September 21, 2013

Use an ATTiny45 to auto-boot a NAS200 on power up

Posted on 7:14 AM by Unknown
I make no guarantees for the information contained herein, I also cannot be held responsible for data loss as a result of your actions, we make our own decisions.

I needed a way of booting the Linksys NAS200 automatically when powered up. As standard from Linksys the NAS200 just stays off when powered up. The Power button on the back left hand side when looking at the rear of the NAS200 needs to be pressed to start the NAS. I often found that when I tried to connect to the NAS it was powered off usually due to a power outage that occurred through the night. I would then have to go upstairs to power it on and wait for it's disk check to finish before I could actually use it. So I set out to fix this inconvenient feature of the NAS200.  First power off and disconnect the power supply then remove the hard drives so they don't get damaged. I numbered the drives 1 and 2 to match the bay they came out of before removal just to be sure they went back into the correct drive bay.  I proceeded to open up the case of the NAS. This involved removing the silver painted base cover using a screwdriver to lift the plastic sprung pillars out and then slide the cover to the front of the NAS. Four screws included one covered by a warranty sticker ( only proceed if you are happy having no warranty and only if you are confident of success ) are removed. This allowed removal of drive bay 2, be careful of the power wires to PCB and SATA connector. Another four screws are removed to remove drive bay 1, again be careful of SATA and power cables. This will allow the main PCB to be accessed. Four screws are removed and this allows the PCB to be removed. An 8 pin socket was procured, pin 4 was soldered to the rear of one of the PCB mounted USB socket, pin 8 was connected to the 5V pin on the LM7805 voltage regulator see the picture below.

NAS200 ATTiny45 in Socket

Pin 5 is connected to the conductor of the power push button at the rear of the PCB via a flexible insulated wire, I soldered it to the top of the push button.

The ATTiny45 was programmed using an Arduino Uno programmed with the ISP Sketch, it's in the Arduino IDE examples, remember to choose the correct board and serial port in the IDE. See my previous post on how to program the ATTiny45 with the Arduino Uno Board.

The AutoPowerON.ino sketch basically sets up the port pins we are using as inputs this gives us the high impedance state so the pins don't affect the NAS200 power up or switch off function using the button. After 10 seconds (just to be sure the power has settled) from power being applied the pins on the ATTiny45 being used are set as outputs and PB0 PB1 go low and high respectively for half a second. They then return to high impedance state, the NAS200 has begun booting. After this the program in the ATTiny45 is then caught in an infinite loop, this ensures the pins are only pulsed once for each power cycle.
Note* I only use pin 5 this is the active low output, pin 6 can be used for circuits that may need an active high 5V pulse.
Code I used is pasted below I saved it as AutoPowerON.ino :-

/*
NOTE* This Sketch will pulse a Pin low on the ATiny45
This is to auto power up a NAS box to ensure it
is available after a power cut. It normally has to be
turned on by pressing the power button.
If using an Arduino to program these devices you need to
program the ISP Sketch found in the IDE onto the Arduino
first.

So the circuit will pulse a pin low after a
predetermined amount of time say 10 Seconds

This pin will be connected the same part of
the NAS box's push button circuit to simulate
a button press.
We only want to do this procedure once on every power up.
hence the capture while loop at the end of the loop function.

+5V---------------------+
Vcc|
+----------+
PB2 | 8 |PB4
+-----|7 3|----+
PB1 | ATTiny45 |PB3
+-----|6 2|----+
TO PB0 | |PB5
Push Button +-----|5 1|----+
| 4 |
+----------+
GND|
Ground-----------------+

(Wiring Diagram for Auto Power On Circuit)

By Jim Park jim (dot) buzz (at) gmail (dot) com
Coded :- 18/09/13

*/

int PowerPin = 0; // Pin 5 to power up the NAS if it's active Low
int PowerPinInv = 1; // Pin 6 to power up the NAS if it's active High

void setup() {
// declare pins as O/P's or I/P's
pinMode(PowerPin, INPUT); // HI-Z pin
pinMode(PowerPinInv, INPUT); // HI-Z pin
}

void loop() {
// Now delay for 10 Seconds
delay(10000); // 10 second delay to be sure power is stable
pinMode(PowerPin, OUTPUT); // Remove HI-Z state from pin
pinMode(PowerPinInv, OUTPUT); // Remove HI-Z state from pin
digitalWrite(PowerPin, LOW); // Active Low on Pin 5
digitalWrite(PowerPinInv, HIGH); // Active High on Pin 6
delay(500); // Half a second delay
pinMode(PowerPin, INPUT); // Back into HI-Z state
pinMode(PowerPinInv, INPUT); // Back into HI-Z state
while(true){} // Capture for ever......and..ever.........
}


The programmed ATTiny45 is inserted into the socket carefully ensuring that pin 1 on the ATTiny45 goes into pin 1 on the Socket ( see the photo above ). The unit was tested by plugging in the power to the NAS, after 10 seconds the familiar boot beep with the flashing leds occurred. After the full boot the NAS was available on the network all without having to press the power button. :)
Read More
Posted in | No comments

Thursday, September 5, 2013

Programming ATTiny45 using an Arduino Uno

Posted on 3:41 AM by Unknown
Wiring of the Programmer
The Arduino is programmed using the Arduino IDE and USB with the ArduinoISP sketch from the File Menu located in examples. Remember to choose the correct board and Serial port from the Tools menu, I was using an Uno. You have to set up the Arduino software to be able to program devices like the ATTiny45, I used the http://hlt.media.mit.edu/?p=1695 site to add the support. It was then just a matter of wiring up the Arduino as shown, putting an ATTiny45 in the 8 pin socket selecting the new board ATTiny45 (Internal 1MHz Clock) and programming the device with a sketch I wrote for this particular device.

Read More
Posted in | No comments

Wednesday, September 4, 2013

Wi-Spy DBx2 USB Repair

Posted on 12:13 PM by Unknown
Be careful when soldering and wear eye protection. I am not responsible for any omissions or errors on this Blog YMMV.

Broken USB Connector


The USB connector had been ripped off the board ( it wasn't me :) ) so I cleaned and removed the broken lugs from the PCB. I also cleaned the PCB pads left on the USB connector.
Pulled Out Contact
I straightened one of the contacts that had been pulled out of the connector and pushed it back in. I then Fast-Set Epoxied the connector to the PCB and clamped it using a sprung plastic clamp until the glue cured. I then soldered the ground connection and the remaining connections using thin tinned copper wire to bridge the ripped up tracks on the PCB. I finally soldered the corners of the connector to the PCB lug holes to provide extra mechanical strength to the assembly.
Connections Soldered
Proof it Works!
Job Done :).
Read More
Posted in | No comments

Thursday, April 4, 2013

Raspberry PI Enterprise Wifi

Posted on 7:33 AM by Unknown
The dongle I used was the Farnell WiPi this was identified by the PI using
the command lsusb as a
Bus 001 Device 005: ID 148f:5370 Ralink Technology, Corp. RT5370 Wireless Adapter

I put the required certificate in the /etc/cert directory.
The wpa_supplicant.conf file was edited as follows:-
ctrl_interface=DIR=/var/run/wpa_supplicant GROUP=netdev
ctrl_interface_group=root
update_config=1
network={
ssid="myAP"
key_mgmt=WPA-EAP
eap=PEAP
identity="myuser"
password="mypassword"
ca_cert="/etc/cert/cacert.crt"
phase2="auth=MSCHAPV2"
priority=0
}

The file /etc/network/interfaces was edited as follows :-
auto lo
iface lo inet loopback
iface eth0 inet dhcp
allow-hotplug wlan0
iface wlan0 inet manual
wpa-roam /etc/wpa_supplicant.conf
iface default inet dhcp
gateway 192.168.1.1
up route add default gw 192.168.1.1

Read More
Posted in | No comments

Raspberry PI Kiosk

Posted on 7:25 AM by Unknown
Do the usual things after installing an image on the SD card and booting the Pi
for the first time run
sudo raspi-config
then set boot desktop in boot_behaviour

sudo apt-get install chromium x11-xserver-utils unclutter

Edit /etc/xdg/lxsession/LXDE/autostart file and comment out screensaver line, add lines below
@xset s off
@xset -dpms
@xset s noblank
@chromium --kiosk --incognito http://www.google.com # your URL here



Read More
Posted in | No comments

Monday, March 25, 2013

Repairing a Windows Installation After Installing a New Motherboard.

Posted on 9:35 AM by Unknown

The usual warnings about backing up data before you proceed apply here, you have been warned.

I needed to do this after the motherboard's hard drive controller died and I didn't just want to do a re-install and lose all my settings and accounts with a motherboard change, I did have a backup but I wanted a challenge. I rebooted with the new motherboard installed and just got the BOD then a restart. The Windows recovery came up during this reboot but in the end it said the installation couldn't be recovered.

Most of the forums I came across recommended a re-install, this I thought was a bit defeatist so a bit more research came up with a useful article:-
How To Repair a Windows Install After Replacing Motherboard
I followed this pages description and got the drivers I needed for my new motherboard. I put them on a USB memory stick then booted the new machine with the Windows 7 install DVD as described in the article, the important command is :-
dism /image:d:\ /add-driver /Driver:f:\ /recurse
This copies the various drivers for the new motherboard chipset, vga, harddrive controller and audio etc from the USB memory stick to the Windows installation on the hard drive. This means when Windows restarts it'll have all the correct drivers for the new motherboard. It did reboot and appeared to work, no BOD, it rebooted again after the initial boot. Fantastic it only took about half a hour and it works flawlessly.

Update:You may need to re-validate your copy of Windows with Microsoft as the hardware has changed significantly. I had to use Microsoft's automated UK 0800 telephone re-validation system, this was pretty painless, just enter a few blocks of numbers provided by your installation via the phone keypad. You then enter the automated-voice blocks of numbers returned by Microsoft's system into the blank boxes on your installation. All legal again :).
Thanks for reading. Best Wishes.

.........
Read More
Posted in | No comments
Newer Posts Older Posts Home
Subscribe to: Comments (Atom)

Popular Posts

  • Ubuntu Enterprise Cloud
    Hadoop Cluster I had problems with ssh passwordless logins taking ages on the hadoop Ubuntu cluster I was working on. This was fixed by addi...
  • Programming ATTiny45 using an Arduino Uno
    Wiring of the Programmer The Arduino is programmed using the Arduino IDE and USB with the ArduinoISP sketch from the File Menu located in ex...
  • Raspberry PI Enterprise Wifi
    The dongle I used was the Farnell WiPi this was identified by the PI using the command lsusb as a Bus 001 Device 005: ID 148f:5370 Ralink T...
  • Raspberry PI Kiosk
    Do the usual things after installing an image on the SD card and booting the Pi for the first time run sudo raspi-config then set boot deskt...
  • PXE Boot a Dban image from an Ubuntu Server
     Dhcp Offers from Ubuntu Server to Compute Nodes ****Note**** exercise extreme care with these notes I have made as you can boot and wipe an...
  • Remove CentOS Xen
    Install Standard Kernel yum install kernel Remove Xen Kernel yum remove xen kernel-xen Edit Grub to Select Correct Kernel /boot/grub/grub.co...
  • IPTables Lost After Reboot of Head Node
    IPTables Lost After Reboot of Head Node The iptables were lost every time the machine was rebooted so I found I needed to save the iptabels ...
  • SSH Connection Problems
    Ssh-agent Problem When I attempted to use the command 'ssh-agent' then the command 'ssh-add' to enter my rsa passphrase ...
  • VirtualBox
    Create a VM VBoxManage –help VBoxManage createvm --name "MyvmServer" --register VBoxManage modifyvm "MyvmServer" --memor...
  • Create a Video Using DeVeDe
    DeVeDe is a CD/DVD creator package for Linux. In Ubuntu sudo apt-get install devede , this will install the package. Run the program in Gno...

Categories

  • Cluster Login Problem
  • Hadoop Cluster Passwordless SSH login
  • Open-SSH Installation
  • Software Update Command Line

Blog Archive

  • ▼  2013 (6)
    • ▼  September (3)
      • Use an ATTiny45 to auto-boot a NAS200 on power up
      • Programming ATTiny45 using an Arduino Uno
      • Wi-Spy DBx2 USB Repair
    • ►  April (2)
      • Raspberry PI Enterprise Wifi
      • Raspberry PI Kiosk
    • ►  March (1)
      • Repairing a Windows Installation After Installing ...
  • ►  2012 (16)
    • ►  November (1)
    • ►  October (1)
    • ►  July (2)
    • ►  June (3)
    • ►  May (1)
    • ►  April (1)
    • ►  March (3)
    • ►  February (3)
    • ►  January (1)
  • ►  2011 (17)
    • ►  December (1)
    • ►  November (3)
    • ►  August (4)
    • ►  July (1)
    • ►  June (2)
    • ►  May (2)
    • ►  March (2)
    • ►  February (1)
    • ►  January (1)
  • ►  2010 (18)
    • ►  December (2)
    • ►  September (2)
    • ►  August (2)
    • ►  July (4)
    • ►  June (7)
    • ►  May (1)
Powered by Blogger.

About Me

Unknown
View my complete profile