Windows 7 sleep issues with unattended wakeup

I recently built myself a backup NAS drive using Windows-7 professional as the OS. The power profile of this system was simple.

  1. Everyday wakeup at 3:00AM and sync up between the shared-drive and backup-drive. I use the task-scheduler to set this trigger. ‘Synctoy’ is used to sync up between the drives
  2. Enable Wake-On-Lan (WOL) so that the NAS machine can be woken up remotely, say from my PC or IPhone/Ipad. I use this if i have to do any file transfers.
  3. After 30 min of inactivity go back to sleep

I tested this profile and it worked fine. And every now and then i performed maintenance by updating the OS. After that i began noticing that my NAS drive would not stay woken p for too long. Every time i woke it up using WOL or the wakeup timers in the task-scheduler, It stays awake for about 2 mins and then goes back to sleep.

I spent a lot of time trying to debug this. updating device drivers, messing with the BIOS settings etc. No change. I also observed that if the NAS was woken up from sleep using keyboard or mouse, it would stay awake for 30mins just like in the power settings (I used the balanced profile).

Searching on Google, I stumbled on this issue and its solution. It looks like Windows7 when woken up unattended (using timers, WOL) only stays awake for 120seconds by default and then sleeps if there’s no activity. Irrespective of your sleep timer setting.

If you are having the same issue, these links will hopefully help you.

http://www.vistax64.com/tutorials/171042-sleep-return-timeout-unattended-wake-up.html

http://www.sevenforums.com/tutorials/778-power-plan-settings-change.html

http://www.sevenforums.com/tutorials/35767-sleep-return-timeout-unattended-wake-up.html

In a nutshell, you either have to change the registry settings for the unattended wakeup sleep timeout and change it from 120 seconds.

I modified the entries and now my NAS box behaves as intended.

Tagged with: , ,
Posted in Electronics

Hand soldering a 2mmx2mm DFN SMD package chip

For one of my projects i had to use the LTC3526 Boost Switching regulator chip from Linear. It is a great chip. One downside being an extremely small 2mmx2mm DFN package

I never soldered a chip with this fine pitch. But i thought i’d give it a try. Got couple of LTC3526 as samples and the PCB from OSH-Park. Result shown below. Not bad for hand soldering

I usually stayed away from chips with this kind of footprint because i was not sure i could solder them. This gives me a bit more confidence.

One reason the soldering here worked is because the sides of the chip do expose a tiny amount of the pad, albeit flush with the package.

If there are tips to hand solder these packages, I feel that these are important.

  • Get yourself some really fine point soldering tips. Definitely a temperate controlled soldering station. I used the Hakko-936
  • The pads on the PCB have to project at-least 8~10mils outside of the IC package. This way your soldering iron tip can solder the pads and the solder will reach the IC package due to capillary action.
  • Use Flux. Lots of it. Don’t use the no-clean variety. These flux are acid based and cause resistance shorts. Always use rosin flux (liquid or gel)
  • Always clean your solder joints after soldering using rubbing alcohol. I use Q-tips for cleaning the solder. Then inspect the joints using a magnifier.
  • Always keep your soldering tip clean and without oxidation. Use a wet sponge to clean the tip often.
  • Try to use the thinnest soldering wire you can get. That way the solder tip will not pick up much solder. Else you will end up solder bridges.
  • First apply flux to the PCB pads using a toothpick. Place the IC over the pads using a tweezer. I used a toothpick to first correctly orient the IC over the pads. I used a 40x jewelers loupe to confirm that. Then use the toothpick to press down on the package with one hand. Solder with the other. Use rubbing alcohol and Q-tips to clean up the flux residue. Use the loupe to confirm good solder joint. If not, repeat flux and solder.
  • Lots of good lighting around the soldering area.

20131023-160137.jpg

20131022-140913.jpg

20131023-160348.jpg

Tagged with: , , ,
Posted in Electronics

DIY Iphone friendly NAS server with custom built wooden box

I recently finished building a NAS box to suit my media storage needs. Especially photos taken by my SLR and our iphones.  Our backup had been mostly adhoc: Using an external USB disk to store data. While the disk is great and portable, I ran into some issues with the simple external storage.

  • Anytime i needed something from the disk it had to be physically connected to a laptop.
  • Accessing the data from the iphone was very cumbersome.
  • Storing our iphone photos to the disk meant hooking up the iphone and the usb disk to a laptop and transferring data
  • The USB disk could potentially crash and lose all the precious data

Initially i looked at store based NAS solutions. Something that had built in redundancy (like Raid-1). I looked at both Iomega and Buffalo products. These were affordable and allowed you to plug in your own hard disks. But the more i read about them, it seemed like they had lots of issues. And neither had a good solution for syncing photos with the iphones.

I had a dual-atom intel motherboard, a 1TB hard-disk ,a pico-psu power supply and an OEM copy of windows7 professional edition 64-bit lying around. This pushed me to make my own NAS box. The requirements were.

  • Should be quiet. Very important
  • Should be scalable to at-least 4 hard disks
  • Have redundancy so that if one harddisk crashes, other should be re-usable.
  • Run without much supervision for most of the time
  • Periodically back up my google drive to the local hard-disk
  • I should be able to transfer my photos from my iphone directly to the NAS-box
  • Box should be off most of the time, only to be woken up when needed
  • Should be able to act as an itunes server to stream movies to my apple-TV
  • Should be able to access the media on the NAS-Box (photos, music, movies etc) from the iphone/ipad
  • I should not have to jailbreak my iphone or my apple TV for the features needed.

I initially looked into ‘FREENAS’ to see if i could use it instead of  Windows-7. However FREENAS had no support specifically for the iphone sync and the itunes streaming. So i stuck with the Windows-7 solution.

Here’s what i used

  • Hardware
  1. An older mini-ITX Dual Atom intel motherboard (D945GCLF2)
  2. 1.5TB seagate barracuda harddisk for sharing
  3. 2TB seagate barracuda harddisk for backup
  4. PICO-PSU 120watt powersupply with power brick
  5. Sarbent PCI-RAID card
  6. Wireless logitech keyboard, mouse
  7. A 500GB 2.5″ disk for the Windows-7.
  • Software
  1. Windows-7 Professional 64-bit
  2. SyncToy windows app for syncing
  3. PhotoSync companion for windows
  4. itunes software
  • Iphone/Ipad Apps
  1. PhotoSync app for sending photos to NAS-Box
  2. RemoteFiles app for accessing NAS-Box media
  3. mWOL app to wakeup the NAS-Box

So lets start with the hardware. A while ago i purchased a dual atom intel motherboard in a mini-itx formfactor. It was an impulse buy. I also bought a pico-psu to go along with the motherboard. The pico-psu really kept down the power supply footprint. The motherboard had only 2 SATA ports and did not support RAID. It had 1PCI port. So i bought a PCI-SATA board to hook up the additional Sata disks. The Windows 7 was installed on a separate 500gb laptop drive that connected to the motherboard SATA port. The backup harddisks were connected to the PCI-SATA board.

20130826-184332.jpg

Here’s how the system looked before i decided to make a custom wooden case for it.

20130826-184354.jpg

The case was made with pine wood from home-depot as the frame. I used pocket -screw system to build it. Dimensions were 9″x9″x9″ cube. Because i was using wood, the case would be bigger than if it were made of metal. But i wanted something that would blend in with my home entertainment system.

20130826-184406.jpg

The front and base panel added. The panels were 5mm thick luan plywood sheets again from home depot. There spray painted to be walnut mocha color. The base plate shown is going to hold the motherboard

20130826-184419.jpg

The case now populated with the ITX motherboard. I added a 120mm fan on vibration dampers to circulate air. Since wood is a poor conductor of heat, there could be a heat issue during the running time. The hard disks are mounted at the top. The 500gb laptop disk is mounted next to the motherboard. Since i had a mill i cut custom aluminum brackets to hold the drives.

20130826-184436.jpg

Here’s the 120mm fan before being mounted to the case.

20130826-184454.jpg

The backside of the case with the motherboard. To the left are the power socket and the power switch.

20130826-184514.jpg

The finished case with the panels screwed in. The panels are flush to each other as i used a laminate trimmer with flush bit to route the edges flush.

20130826-184523.jpg

The 2 tiny holes at the right are for the power and HDD led lights. The square hole is for the USB connector.

The mocha walnut color blended in well with the existing furniture.

Now for the software part. Initially i wanted to use RAID-1 for the data redundancy. However i read online that having hardware raid has its pros and cons. The pros being that it is fast and that the OS has no clue about the RAID details. The hardware handles the copying of the data simultaneously to the 2 disks. The con was that if the controller failed, the drives are useless as OS has no idea how the data was organized. So some chose software RAID. Windows-7 professional allowed disks to be configured into RAID systems. The advantage here being that you do not need a specialized RAID card to handle the disks. The OS would handle this. Also if the controller failed, just add a new one. Since the OS handled the RAID, we would be okay. The downside here being that configuring the windows-7 RAID is not easy. It was confusing to say the least. Also in case of disk failure, re-imaging the RAID disk to a new disk is painful. I gave it a dry run and the re-imaging took almost a day.

Moreover i figured RAID is useful only if you have mission critical data where any downtime is unacceptable. In my case all i wanted was that my data was safe in an another disk just in case one died. I did not need an exact replica of data in both disks right down to the sectors. So i dropped using RAID. I still had redundancy. But not RAID.

So my system has 3 disks.

  1. A 500GB 2.5″ disk where the OS and all the windows programs are loaded into. I back up this disk to a thumb drive using clonezilla. Just in case the OS disk fails.
  2. A 1.5TB disk that is my storage disk. This disk is shared under windows-7. So all my devices in my home-network can see this disk. It can be mapped as a network drive. Of-course you must provide the login credentials to the machine.
  3. A 2TB hard disk that is my backup disk. This disk is NOT shared on my network. It is unreachable on the network. This serves as my backup disk just in case the shared disk fails.

How is data synced between the shared disk and backup disk ?

My Nas-Box basically operates in SLEEP and NON-SLEEP modes. The PC sleep timers are set to 30mins. The NAS box goes to sleep in 30mins of inactivity. I also enabled the motherboard’s WAKE-ON-LAN feature where the PC can be woken up by an ethernet packet. I also enable the wakeup-timers in the power menu. This enables the Nas-Box to turn ON at specified time as described in the windows scheduler.

I use the windows task scheduler to setup a wakeup task everyday at 3am.  I also use ‘windows synctoy‘ to setup rules for copying data from google-drive to backup drive and data from shared-drive to backup-drive. So everyday at 3am (I never usually am awake at this time), the Nas-Box wakes-up, runs the synctoy with rules that updates the backup drive from the shared-drive. It also copies the updates from the google-drive to the backup-drive. With the current setting i have a 24hr window during which new data can exist in the shared drive but not in the backup-drive, creating a hazard window. In the future i plan to wakeup the Nas-Box 3 times/day instead of just once to reduce this hazard window

synctoy

The ‘echo’ configuration was used to update all contents of E drive (shared drive) to D drive (backup drive)

How can all devices access the shared-drive ?

Since the Nas-Box is OFF most of the time, it needs to be ‘woken-up’ when needed. For the PC’s, i installed the ‘WOL Magic Packet Sender‘. This program sends the magic-packet to to wakeup the Nas-Box.

wol_packet_sender

Host-name is the IP address of the NAS-BOX. It is preferable to setup a static IP address for the nas-box.
MAC address field has the mac address of the ethernet port of the NAS-BOX.

For the Iphone/Ipad app, i use the Mocha-Wol app.

Since the shared-drive is ‘shared’ in windows, it can be accessed by any windows/Linux system on my home network. I am currently not interested in accessing this data from the internet. As for the Iphone and Ipad, i use the ‘remote file browser pro‘ app to access data. This is a paid app. But it opens most media. Pictures, songs and movies. Accessing your shared drive with this app is as easy as it gets.

How to send photos to the NAS-BOX from my Iphone or Ipad ?

My wife and I use our iphones to take a lot of photos.  Taking photos is great. Archiving them is painful. While the photostream is helpful here, it is always better to have a local storage for your photos and videos.

Transferring photos/videos from iphone to a PC is not that hard. There are lot of apps that do that. However most of these apps also require you to manually open a web-browser on the PC side and retrieve the photos from the idevice. I was looking for a solution where i should be able to ‘push’ the photos/videos from the iphone to the PC without having to access the PC. I found the ‘Photo-sync‘ app to be the best app. This app can do a lot. Transferring photos between idevices, from cloud services, from WIFI SD cards. But my favorite was its ability to send the photos from my iphone to my Nas-Box. To achieve this you have to install the app on your iphone and also a companion app on the Nas-Box. The companion app is a windows service that runs always. So when i need to transfer my photos from say my ipad to the Nas-Box, i do

  1. Use the Mocha-Wol app to wakeup the sleeping Nas-Box.
  2. Use the photo-sync app to select the photos i want to send over.
  3. The photo-sync app lists the machines it knows which can receive these photos. In my case, my nas-box is the only one. I select that.
  4. The photos are transferred with the folder name being the name of the ‘idevice’.

So finally i had a good working NAS BOX that did the basic job of backup, but also provided me with other features specific for my smartphone and smartphone centric media. So if you have a NAS requirement like mine, you might not find a store solution that fits your needs or if you, it might cost a lot. But if you are willing to do some DIY, you can make a great NAS machine that fits your needs fully.

Tagged with: , , , , , , , ,
Posted in Electronics

HexTronik 1300Kv Brushless motor rewind

I recently rewound a Hextronik 1300Kv brushless motor (HXM2730-1300), also called “blue wonder”. I rewound it to see if i can make it better. Better thrust, cleaner windings and lower current consumption.

Some specs related to the motor insides…

  1. Number of stator poles : 12
  2. Number of Magnet poles: 16
  3. Motor tube diameter : 8mm
  4. Gauge of wire : 26AWG (0.43mm diameter)
  5. Number of turns per stator tooth : 14~15
  6. Termination : WYE

This motor is a 12N16P motor wound in the ABCABCABC format with a WYE termination. My goal here is just to rewind the motor with a better wire in a cleaner manner. No other modifications done.

A really good link for rewinding is from RcGroups : Link

20130507-101614.jpg

The stator after the rewind. Not pretty.

20130507-101627.jpg

Rather than terminating the wires loose, i decided to terminate them at a solder board. The rubber grommet is just to provide some clearance between the winding and the board.

20130507-101637.jpg

Soldered stator. The black thing you see is the dried ‘liquid tape’. Not needed actually.

20130507-101645.jpg

20130507-101651.jpg

Finished motor with the new termination board.

Tagged with: , ,
Posted in Electronics, r/c

Burning a compiled hex file for Atmega chips using Arduino avrdude command line

For my latest project i wanted to use the famous GRBL firmware that loads into an arduino and helps drive steppers with G-code as input. I had an Arduino-Uno that i wanted to use.

Now the arduino IDE can be used to compile and upload sketches. But what if you had the compiled ‘hex’ file itself? : Like in the case of GRBL. The github page hosts hex files compiled for the Atmega328p.

You can use external programs like Xloader to do the job. However it looks like these programs have their own issues. So why not make use of the Arduino that you already have ?

The arduino IDE does 2 things.

  1. First it compiles your C/C++ sketch for a particular Atmega processor (depending upon the type of the arduino board) and generates a ‘hex’ file or a binary file that the processor can understand. 
  2. Then it uses its own ‘avrdude’ and config file and uploads this hex file.

Here’s a typical output command of the uploading process from arduino.

C:\Users\rkovvuri\Downloads\arduino-1.0.2-windows\arduino-1.0.2\hardware/tools/avr/bin/avrdude -CC:\Users\rkovvuri\Downloads\arduino-1.0.2-windows\arduino-1.0.2\hardware/tools/avr/etc/avrdude.conf -v -v -v -v -patmega328p -carduino -P\\.\COM5 -b115200 -D -Uflash:w:C:\Users\rkovvuri\AppData\Local\Temp\build37.tmp\BlinkWithoutDelay.cpp.hex:i

So for my case, to burn in the GRBL hex file, i did the following

  • cd Users\rkovvuri\Downloads\arduino-1.0.2-windows\arduino-1.0.2\hardware/tools/avr/bin
  • avrdude -CC:\Users\rkovvuri\Downloads\arduino-1.0.2-windows\arduino-1.0.2\hardware/tools/avr/etc/avrdude.conf -v -v -v -v -patmega328p -carduino -P\\.\COM5 -b115200 -D -Uflash:w:C:\Users\rkovvuri\Desktop\grbl.hex:i

Thats it!

Tagged with: , ,
Posted in Electronics

ER9x mixer settings for Parkzone Stryker FQ-27

I recently found a very good deal on the Parkzone Stryker FQ-27 ultramicro flying wing. I am still a newbie at flying R/C. I bought this bird hoping i could fly it one day.

Usually flying wings have only elevons (airelons and elevator). The Stryker however has rudders too along with the elevons. It comes built in with DSM2 receiver.

20130218-155101.jpg

For the TX, my choice was the Turnigy 9x with ER-9X firmware. Below are mixer settings for correct throws on this airplane.

20130218-165906.jpg

Tagged with: , ,
Posted in r/c

From cardboards to castles

Another year, another Princess castle Pinata. This year was my daughter’s 5th birthday and she wanted the same Pinata i made for her the year before. However she reminded me that i need to do a better job in making sure that the candy fell. Last year, the candy release mechanism messed up and we ultimately had to manually tear open the pinata to get the candy to fall. This year i wanted to make sure that the mechanism worked.

 So i started off with 2 cardboard boxes to form the main castle body. Some leftover pool-noodles from last year formed the towers. The tower roofs were made from cardboard stock cut into a circle and made into a cone. The base was the dollar-tree foamboard. I wrapped all the parts of the castle with a pink wrapping paper from dollar tree. Then onto painting using some acrylic paints from hobby-lobby. I wanted the pinata such that it could be re-used. Which meant that the candy and goodies should be released by without the pinata being hit. Like last year, i decided to use the string system. I add a bunch of strings to the castle . Only one string will release the goodies. other simply just come off. For the characters, i simply dug through some of my daughter’s princess sticker books. Stuck the stickers on a cardstock, cut them out and glued them to the castle with a little paper stub. That gives them a 3-D appearance. For grass, i cut green tissue paper into small bits and sprinkled them on the castle surface which was prepped with from white glue. Some pom-poms from dollar tree rounded out the bushes and some flower plants.

20130205-044601.jpg

So here’s the final finished product, being hung from the roof. The purple ribbons at the bottom is where the kids would take turns, guessing which is the right ribbon to pull. Only one of them engages the mechanism that releases the trap-door at the bottom that releases the goodies. The mechanism was given a dry run before hanging up and it worked great!

20130205-044628.jpg

As usual, the top section is not attached and can be lifted, revealing a cutout at the bottom section where the goodies can be added. ‘Aurora’ sits at the top of the castle as that’s my daughters favorite princess.

20130205-044638.jpg

A closeup view

20130205-044645.jpg

Tagged with: , , ,
Posted in Crafts
Archives
Categories
Follow

Get every new post delivered to your Inbox.