Welcome! Log In Create A New Profile

Advanced

Zyxel NSA 320 wake on lan

Posted by wacek 
Zyxel NSA 320 wake on lan
July 14, 2013 09:49AM
Hi all,
I installed debian successfully on the nsa320 thanks to the information I found here. Thanks for that. Now I tried to activate the wake on lan feature with ethtool. I get the following error:

root@nsa-320:~# ethtool -s eth0 wol g
Cannot get current wake-on-lan settings: Operation not supported
not setting wol
root@nsa-320:~#

I tried the kernel 3.3 and the 3.8.11 with the same result. If somebody has activated wake on lan, can he give me a hint how?

Thanks in advance,

wacek
Re: Zyxel NSA 320 wake on lan
July 14, 2013 03:18PM
I use Zyxel NSA 320 wake on lan without doing anything to activate it.

-syong
Re: Zyxel NSA 320 wake on lan
July 14, 2013 05:04PM
Hi, thanks for your answer, I tried to set it up as written here:http://wiki.debian.org/WakeOnLan. After I have shut down the nas I tried to wake it up with the wakeonlan command, but nothing happened. How do you wake it up?
Re: Zyxel NSA 320 wake on lan
July 14, 2013 09:21PM
I use wakeonlan too and it works for me.

wakeonlan -i 192.168.0.255 fc:f5:28:08:a8:a4

-syong
Re: Zyxel NSA 320 wake on lan
July 15, 2013 12:25AM
I did not supply the -i parameter, but if I do it or not, it does not work for me.

root@laptok:~# wakeonlan -i 192.168.220.255 b0:b2:dc:ee:d4:b3
Sending magic packet to 192.168.220.255:9 with b0:b2:dc:ee:d4:b3
root@laptok:~# wakeonlan b0:b2:dc:ee:d4:b3
Sending magic packet to 255.255.255.255:9 with b0:b2:dc:ee:d4:b3

I installed debian using davys instructions: http://forum.doozan.com/read.php?2,7806. The only thing I did different is that it runs from an usb stick. Did you install it the same way? Which kernel are you using?
Re: Zyxel NSA 320 wake on lan
July 15, 2013 10:04AM
I guess the uboot is the only thing matters as wol should only react to it.

I use the davy's instructions. Both hdd and usb with bodhi's 3.8.11 kernel work great for me.

-syong
Re: Zyxel NSA 320 wake on lan
July 15, 2013 10:35AM
Hi Syong,

which uboot are you using on your nsa320, the stock uboot or davys version??

I just posted in bodhi's linux kernel thread, that I also had problems with gigabit ethernet
and cured them temporaily by setting the phy of eth0 to Speed: 1000Mb/s and Duplex: Full
hard coded in the nsa320-setup.c routine,..

now of course autonegotiation is lost, but I had this problem also with 3.3 and 3.5 kernels and ARCH patches,
it seems to depend on the uboot version,..

best wishes pbg4
Re: Zyxel NSA 320 wake on lan
July 15, 2013 12:51PM
If uboot is the thing, I use davys version as the stock one refused to boot from usb. I found something interesting here: http://permalink.gmane.org/gmane.linux.network/261626 there seems to be some patch that is now included in kernel 3.10.
@pbg4: I have no problems with gigabit ethernet, and I also use the 3.8.11 kernel from bodhi. Autonegotiation seems to work, with my laptop with an intel card and with a gigabit switch from tplink.
Re: Zyxel NSA 320 wake on lan
July 15, 2013 01:40PM
I forgot to mention that I connect NSA320 to a 100M switch, which might be the reason for the difference.

I use uboot from davy:

U-Boot 2011.12 (May 03 2012 - 17:04:23)
ZyXEL NSA320 2-Bay Power Media Server
arm-none-linux-gnueabi-gcc (Sourcery G++ Lite 2009q3-67) 4.4.1
GNU ld (Sourcery G++ Lite 2009q3-67) 2.19.51.20090709
Hit any key to stop autoboot:  8 

 0 
NSA320>

I did find two strange quirks of NSA320:

  1. Whenever I connect its serial port, I can not power it off using halt; it always reboot.
  2. Its temp sensor works at the beginning, but jumps to 102C after a while.

Does yours have the quirks too?

-syong
Re: Zyxel NSA 320 wake on lan
July 15, 2013 01:44PM
Hi wacek,

just did a quick test, I got also the same info as you had in your first post:

root@debian:~# ethtool -s eth0 wol g
Cannot get current wake-on-lan settings: Operation not supported
not setting wol

but if I shutdown the nsa320 with shutdown -P -h now and than issue a

wakeonlan -i 192.168.0.255 c8:6c:87:95:f9:1e on another machine,

the nsa320 wakes up and boots as requested,..

I'll have to look into the patch, it adds two service routines to mv643xx_eth.c
for set_wol and get_wol and than does a lot of register settings in the marvell phy,..

but with the stock uboot I seem to have other problems,..

best wishes pbg4

p.s a quick look in the config of bodhi's 3.8.11-kirkwood-tld-3 kernel revealed that
marvell phy is not!! included in the kernel,..

#
# MII PHY device drivers
#
CONFIG_AT803X_PHY=m
# CONFIG_AMD_PHY is not set
# CONFIG_MARVELL_PHY is not set



Edited 2 time(s). Last edit at 07/15/2013 01:59PM by pbg4.
Re: Zyxel NSA 320 wake on lan
July 15, 2013 03:13PM
Thanks for your answers.
@syong: we should have the same uboot then, but I get a slightly different output when I boot:

U-Boot 2011.12 (May 03 2012 - 17:04:23)
ZyXEL NSA320 2-Bay Power Media Server

SoC:   Kirkwood 88F6281_A1
DRAM:  512 MiB
WARNING: Caches not enabled
NAND:  128 MiB
In:    serial
Out:   serial
Err:   serial
Net:   egiga0
MV88E1318 PHY initialized on egiga0
Using egiga0 device
ping failed; host 192.168.220.50 is not alive
Hit any key to stop autoboot:  0 
NSA320>

To the quirks. Halt with connected serial cable shuts down, does not reboot. I rebooted it again, but the temerature seems to stay at around 47 - 48 °C. Tomorrow I woll leave it powered on when I go to work and check the temp again and let you know.

Can you post your printenv result please? Maybe there is a difference. I'll also try to connect my notebook directly to the nas and then try to wake it up.

this is my printenv:
NSA320> printenv
arcNumber=3956
baudrate=115200
boot_sata1=mw 0x800000 0 1; setenv bootargs console=ttyS0,115200 root=/dev/sda1 rootdelay=10 $mtdparts; ide reset; ext2load ide 0:1 0x800000 /boot/uImage; ext2load ide 0:1 0x011000
boot_sata2=mw 0x800000 0 1; setenv bootargs console=ttyS0,115200 root=/dev/sdb1 rootdelay=10 $mtdparts; ide reset; ext2load ide 1:1 0x800000 /boot/uImage; ext2load ide 1:1 0x011000
bootcmd=run bootcmd_usb; usb stop; run boot_sata1; run boot_sata2; run bootcmd_rescue; reset
bootcmd_usb=run usb_init; run usb_load_uimage; run set_bootargs_usb; run usb_boot;
bootdelay=3
console=ttyS0,115200
ethact=egiga0
ethaddr=B0:B2:DC:EE:D4:B3
if_netconsole=ping $serverip
ipaddr=192.168.220.3
mainlineLinux=yes
mtdids=nand0=orion_nand
mtdparts=mtdparts=orion_nand:1M(u-boot),512K(uboot_env),512K(key_store),512K(info),10M(etc),10M(kernel_1),48896K(rootfs1),10M(kernel_2),-(rootfs2)
netmask=255.255.255.0
partition=nand0,2
preboot=run if_netconsole start_netconsole
serverip=192.168.220.50
set_bootargs_usb=setenv bootargs console=$console root=$usb_root rootdelay=$usb_rootdelay rootfstype=$usb_rootfstype $mtdparts
start_netconsole=setenv ncip $serverip; setenv bootdelay 10; setenv stdin nc; setenv stdout nc; setenv stderr nc; version;
stderr=serial
stdin=serial
stdout=serial
usb_boot=if ext2load usb $usb_device 0x1100000 /boot/uInitrd; then bootm 0x800000 0x1100000;else bootm 0x800000;fi;
usb_device=0:1
usb_init=usb start
usb_load_uimage=mw 0x800000 0 1; ext2load usb $usb_device 0x800000 /boot/uImage
usb_root=LABEL=USBROOT
usb_rootdelay=10
usb_rootfstype=ext3

Environment size: 1722/131068 bytes
NSA320>

@pbg4: I figured out that the patch was applied in the official 3.10 kernel source. I wanted to try to compile it, but now that you say that it works for you out of the box, it does not seem to be a kernel issue. Maybe it is the switch. I try to connect to my 100 mbit router
Re: Zyxel NSA 320 wake on lan
July 15, 2013 04:05PM
@wacek,

The uboot is the same. Your output is from serial console while mine is from netconsole.

My printenv:
NSA320> printenv
printenv
arcNumber=3956
baudrate=115200
boot_sata1=mw 0x800000 0 1; setenv bootargs console=ttyS0,115200 root=/dev/sda1 rootdelay=10 $mtdparts; ide reset; ext2load ide 0:1 0x800000 /boot/uImage; ext2load ide 0:1 0x01100000 /boot/uInitrd; bootm 0x00800000 0x01100000
boot_sata2=mw 0x800000 0 1; setenv bootargs console=ttyS0,115200 root=/dev/sdb1 rootdelay=10 $mtdparts; ide reset; ext2load ide 1:1 0x800000 /boot/uImage; ext2load ide 1:1 0x01100000 /boot/uInitrd; bootm 0x00800000 0x01100000
bootcmd=run boot_sata1; run boot_sata2; run bootcmd_usb; usb stop; run bootcmd_rescue; reset
bootcmd_usb=run usb_init; run usb_load_uimage; run set_bootargs_usb; run usb_boot;
bootdelay=10
console=ttyS0,115200
ethact=egiga0
ethaddr=fc:f5:28:08:a8:a4
if_netconsole=ping $serverip
ipaddr=192.168.0.78
mainlineLinux=yes
mtdids=nand0=orion_nand
mtdparts=mtdparts=orion_nand:1M(u-boot),512K(uboot_env),512K(key_store),512K(info),10M(etc),10M(kernel_1),48896K(rootfs1),10M(kernel_2),-(rootfs2)
ncip=192.168.0.66
netmask=255.255.255.0
partition=nand0,2
preboot=run if_netconsole start_netconsole
serverip=192.168.0.66
set_bootargs_usb=setenv bootargs console=$console root=$usb_root rootdelay=$usb_rootdelay rootfstype=$usb_rootfstype $mtdparts
start_netconsole=setenv ncip $serverip; setenv bootdelay 10; setenv stdin nc; setenv stdout nc; setenv stderr nc; version;
stderr=nc
stdin=nc
stdout=nc
usb_boot=if ext2load usb $usb_device 0x1100000 /boot/uInitrd; then bootm 0x800000 0x1100000;else bootm 0x800000;fi;
usb_device=0:1
usb_init=usb start
usb_load_uimage=mw 0x800000 0 1; ext2load usb $usb_device 0x800000 /boot/uImage
usb_root=LABEL=USBROOT
usb_rootdelay=10

Environment size: 1706/131068 bytes

-syong



Edited 1 time(s). Last edit at 07/15/2013 04:07PM by syong.
Re: Zyxel NSA 320 wake on lan
July 16, 2013 02:12PM
@ syong: I checked the temp, it seems to stall at 50.3 °C. Even if i stress the cpu no change is shown, I do not think it is working correctly. I tried to connect the nas to my laptop directly and to the 100mbit router I have, but the wake on lan did not work. I give up. Thank you all for your help.
Re: Zyxel NSA 320 wake on lan
February 03, 2014 02:44PM
Just wanted to post the solusion for my problem, if somebody will be in the same situation.
Today I installed the new 3.13 kernel to give the wake on lan a try. I didn't expect it to work, but it did. But after I put the laptop back on the docking station the nsa320 didn't wake again. The problem was that the docking station is permamently connected to the box with the serial cable. After I took the laptop from the docking station the wake on lan feature works as it should, but won't if the serial cable is attached and powered. It has nothing to do with the kernel or anything else. It was just the serial cable :-)
Re: Zyxel NSA 320 wake on lan
February 04, 2014 11:10AM
I know for a fact that the serial is tied to the same electrical sources as the ethernet PHY, because the having serial connected will prevent you from seeing the issue where-in the ethernet does not properly initialize on cold-boot.
Eike
Re: Zyxel NSA 320 wake on lan
August 21, 2014 08:19AM
Hi there,
I'm currently also facing a problem with WoL, but on the NSA325.
I'm using Debian with bodhi's 3.16 Kernel and 3.14 rootfs and stock u-boot.

My Nas will not wake up regardless what I'm doing!
I set up WoL with ethtool on interface eth0 and it's activated because it's confirmed by ethtool:

root@debian:~# ethtool eth0
Settings for eth0:
	Supported ports: [ TP MII ]
	Supported link modes:   10baseT/Half 10baseT/Full 
	                        100baseT/Half 100baseT/Full 
	                        1000baseT/Full 
	Supported pause frame use: No
	Supports auto-negotiation: Yes
	Advertised link modes:  10baseT/Half 10baseT/Full 
	                        100baseT/Half 100baseT/Full 
	                        1000baseT/Full 
	Advertised pause frame use: No
	Advertised auto-negotiation: Yes
	Speed: 1000Mb/s
	Duplex: Full
	Port: MII
	PHYAD: 1
	Transceiver: external
	Auto-negotiation: on
	Supports Wake-on: g
	Wake-on: g
	Link detected: yes

I also changed in /etc/init.d/halt:
NETDOWN=no

In /etc/network/interface i didn't change anything:
root@debian:~# cat /etc/network/interfaces 
auto lo eth0
iface lo inet loopback
iface eth0 inet dhcp

When I'm now send my NSA to sleep with either shutdown -h -P now or shutdown -h now or simply halt, the system goes off (fan is not spinning, but ethernet LEDs are blinking).

But no MagicPacket is waking it up!
I tried etherwake 00:50:43:00:02:02, wakeonlan -i 192.168.178.255 00:50:43:00:02:02, and wakeonlan -i 192.168.178.255 00:50:43:00:02:02 and I also change to IP to the NAS latest IP (.35).
None it worked. I also tried two different computers to awake the NAS...no success!

I don't have any ideas how to proceed!
Can someone please help me?

PS: Here is my bootlog made with the serial connection: http://x4343.org/debian_boot.txt
And here some u-boot commands: http://x4343.org/uboot_cmds.txt

Thanks!
Re: Zyxel NSA 320 wake on lan
August 22, 2014 03:12AM
Eike,

It does work for me with NSA325v2. Have you tried to use static IP? I wonder if it could be something to do with your router. If it's a static IP the MAC address should be correct all the time. And do you have bridge somewhere in your network?

-bodhi
===========================
Forum Wiki
bodhi's corner (buy bodhi a beer)
Re: Zyxel NSA 320 wake on lan
August 22, 2014 03:46AM
Hi bodhi,

it's not working with static IP either.
This is what I set up:

cat /etc/network/interfaces 
auto lo eth0
iface lo inet loopback
#iface eth0 inet dhcp
iface eth0 inet static
address 192.168.178.35
netmask 255.255.255.0
gateway 192.168.178.1
pre-down ethtool -s eth0 wol g

Can you tell me what you tried out exactly?
Did you modify the /etc/init.d/halt -> netdown=no ?
Which shutdown command and which wakeonlan command did you use exactly?
Or anything else?
Kernel 3.16 and stock uboot? Otherwise I'm also willing to update my uboot, because you're also looking for volunteers with NSA3xx boxes. But I need some kind of guideline to not brick my device ;)

Thanks!
Re: Zyxel NSA 320 wake on lan
August 22, 2014 03:50AM
bodhi Wrote:
-------------------------------------------------------
> I wonder if it could be
> something to do with your router. If it's a static
> IP the MAC address should be correct all the time.
> And do you have bridge somewhere in your network?

No bridge.
My network:
NSA(eth0) --> Fritzbox (GBit Port, but also tried 100M)
RPi (eth0) --> Fritzbox (100M)
Dell XPS (wlan0) --> Fritzbox
Android (wlan0) --> Fritzbox

I used all clients including the Fritzbox's own 'wakeonlan' function.
Re: Zyxel NSA 320 wake on lan
August 22, 2014 04:42AM
Eike,

I listed what I have done below. It is almost the same as you did.
root@Nsa325:~# ethtool eth0
Settings for eth0:
	Supported ports: [ TP MII ]
	Supported link modes:   10baseT/Half 10baseT/Full 
	                        100baseT/Half 100baseT/Full 
	                        1000baseT/Full 
	Supported pause frame use: No
	Supports auto-negotiation: Yes
	Advertised link modes:  10baseT/Half 10baseT/Full 
	                        100baseT/Half 100baseT/Full 
	                        1000baseT/Full 
	Advertised pause frame use: No
	Advertised auto-negotiation: Yes
	Speed: 1000Mb/s
	Duplex: Full
	Port: MII
	PHYAD: 1
	Transceiver: external
	Auto-negotiation: on
	Supports Wake-on: g
	Wake-on: g
	Link detected: yes
root@Nsa325:~# cat /etc/network/interfaces 
auto lo eth0
iface lo inet loopback
#iface eth0 inet dhcp
iface eth0 inet static
        address 192.168.0.247
        netmask 255.255.255.0
        gateway 192.168.0.1
root@Nsa325:~# grep -i netdown /etc/init.d/halt
#NETDOWN=yes
NETDOWN=no
	netdown="-i"
	if [ "$NETDOWN" = "no" ]; then
		netdown=""
	logger -s -i "Shutdown with Netdown = " $NETDOWN
	halt -d -f $netdown $poweroff $hddown
Kernel 3.16.0 and u-boot-2013.10 for NSA325.
shutdown -h now
WOL with etherwake <macaddr>

Please try booting with UART version I uploaded in this post to verify you have a recovery mechanism :) I will upload the NAND version soon. But I would not think stock U-Boot has some how affected the WOL (I thought WOL works in stock FW, does it? I never tried so I'm not sure).

-bodhi
===========================
Forum Wiki
bodhi's corner (buy bodhi a beer)



Edited 1 time(s). Last edit at 08/22/2014 04:46AM by bodhi.
Re: Zyxel NSA 320 wake on lan
August 22, 2014 05:01AM
Ah! I've just realized that this Mac address you used does not look right! What is the real MAC address that you got on the box? try that one.
etherwake 00:50:43:00:02:02

-bodhi
===========================
Forum Wiki
bodhi's corner (buy bodhi a beer)
Re: Zyxel NSA 320 wake on lan
August 22, 2014 05:29AM
That's exactly the MAC I used. Where do you see that I used another?
Re: Zyxel NSA 320 wake on lan
August 22, 2014 05:42AM
Look in your log, if you have saved it, when you boot with stock kernel. If you don't have the log, then look for the MAC addr on the NSA325 case itself, or on the product carboard box.

-bodhi
===========================
Forum Wiki
bodhi's corner (buy bodhi a beer)
Re: Zyxel NSA 320 wake on lan
August 22, 2014 07:42AM
Ok, I'll give it a try after my huge rsync backup job is done :)
My NSA don't have an extra sticker with the MAC, but I'm pretty sure that 00:50:43:00:02:02 is the right one since it's in the uboot variable ethaddr, arp -a is detecting it and ifconfig also shows it. And that's the Mac I tried out the whole time.

I'm somehow confused why these 'easy' tasks didn't work out on my box...
Yesterday I also installed acpid to make use of the Power button as described here but it also didn't work.
Re: Zyxel NSA 320 wake on lan
August 22, 2014 03:59PM
Your MAC address was probably set by Marvell U-boot (with the prefix 00:50:43). I'm guessing stock U-Boot set it, or some other process did. However, the orginal MAC addr should be prefix 10:7B:EF, which is Zyxel.

So if you can find the orginal one that looks like 10:7B:EF:xx:xx:xx, then use that one for WOL.

This is interesting, why it was changed to Marvell's MAC addr, and not keeping the Zyxel one!

And for the power button, check Buzzy's instruction in the 1st post of this thread: http://forum.doozan.com/read.php?2,14351,page=1

-bodhi
===========================
Forum Wiki
bodhi's corner (buy bodhi a beer)



Edited 3 time(s). Last edit at 08/22/2014 04:23PM by bodhi.
Re: Zyxel NSA 320 wake on lan
August 30, 2014 01:39PM
You are right. The NSA has somehow two mac addresses. The one you got with ifconfig and which is listed in several other env vars is actually not the one, you have to use for WoL.
It actually worked with the one, which is printed on the case bottom (on the first sight, it looked like some serial number, and I didn't paid attention to it.). But I have not found it in the boot log while booting to stock firmware. That's the most confusing thing, because the Zyxel Webinterface is also showing the "wrong" MAC address....I have not found out who's changing it but it must be done while sending the nsa to sleep.

So for everyone who's also having problems with WakeOnLan, look out for the right MAC address, as bodhi already mentioned patiently a few times :)
sunfire
Re: Zyxel NSA 320 wake on lan
September 24, 2014 06:45AM
Hi bodhi,

thanks for this great advice.

Can i set the correct MAC address in the u-boot enviroment and replace the old 00:50:43.... ?

-sunfire
Re: Zyxel NSA 320 wake on lan
September 24, 2014 08:23AM
Try it out and let us know :)
But don't forget to write down the original value.

I'm sure it's safe to change it in u-boot.
Re: Zyxel NSA 320 wake on lan
September 24, 2014 11:12AM
sunfire Wrote:
-------------------------------------------------------
> Hi bodhi,
>
> thanks for this great advice.
>
> Can i set the correct MAC address in the u-boot
> enviroment and replace the old 00:50:43.... ?
>
> -sunfire

Yes. I set it to the original value.

-bodhi
===========================
Forum Wiki
bodhi's corner (buy bodhi a beer)
Re: Zyxel NSA 320 wake on lan
October 20, 2014 06:46AM
@bodhi

Did you change it before in debian?

After changing, debian didn't found the network adapter.
Author:

Your Email:


Subject:


Spam prevention:
Please, enter the code that you see below in the input field. This is for blocking bots that try to post this form automatically. If the code is hard to read, then just try to guess it right. If you enter the wrong code, a new image is created and you get another chance to enter it right.
Message: