Welcome! Log In Create A New Profile

Advanced

Debian on Zyxel NAS326

Posted by Kirsch 
Re: Zyxel NAS326 - Debian / Boot from USB?
September 28, 2019 05:51PM
ahorner,


> The main issue I encountered was that things
> stored on the flash filesystem would get erased
> each boot, so I couldn't really install anything
> easily,

See the installation instruction here:

https://forum.doozan.com/read.php?2,88619

The flash reset problem was overcome by setting some u-boot envs like I described in the instruction.

Post more questions if you don't understand some of the info there.

-bodhi
===========================
Forum Wiki
bodhi's corner (buy bodhi a beer)
Re: Debian on Zyxel NAS326
October 06, 2019 04:51AM
Hi Bohdi,
first of all - thank you very much for your great work!
I think I found a solution for the WOL Problem.
I searched in the orignal rcS2 in /etc on the original RootFS and found this:

###### setup WOL ######
if [ -e ${CONF_PATH}/wol.status ]; then
	/sbin/i2cset -y 0x0 0xa 0xa 0x0006 w
else
	/sbin/i2cset -y 0x0 0xa 0xa 0x0306 w
fi

If I put:

/usr/sbin/i2cset -y 0x0 0xa 0xa 0x0006 w


in my /etc/rc.local WOL works for me.

Tested with 5.1.7-mvebu-tld-1.

In the same rcS2 I found:

###### set auto power-on ######
if [ -e ${CONF_PATH}/storage/pwron.status ]; then
	pwrmode=`${CAT} ${CONF_PATH}/storage/pwron.status`
	#zyshclient -p 150 -e "pwron ${pwrmode}"
	if [ $pwrmode = 'always' ]; then
		/sbin/i2cset -y 0x0 0x0a 0x0a 0x0107 w
	else
		/sbin/i2cset -y 0x0 0x0a 0x0a 0x0007 w
	fi
else
	#zyshclient -p 150 -e "pwron former"
	/sbin/i2cset -y 0x0 0x0a 0x0a 0x0107 w
fi


Maybe someone needs this too, like me.
Hope I could help!

====
bodhi edit: added code tags to highlight scripts/logs.



Edited 1 time(s). Last edit at 10/07/2019 03:16AM by bodhi.
Re: Debian on Zyxel NAS326
October 06, 2019 05:26AM
030theo,

Quote

> I think I found a solution for the WOL Problem.
> I searched in the orignal rcS2 in /etc on the
> original RootFS and found this:
>
> ###### setup WOL ######
> if [ -e ${CONF_PATH}/wol.status ]; then
> /sbin/i2cset -y 0x0 0xa 0xa 0x0006 w
> else
> /sbin/i2cset -y 0x0 0xa 0xa 0x0306 w
> fi

Ah, that was pretty good detective works :)

Zyxel seems to like to do everything through i2c. The fan speed and CPU temperature readout is also through i2cget!


Quote

> If I put:
>
> /usr/sbin/i2cset -y 0x0 0xa 0xa 0x0006 w
>
> in my /etc/rc.local WOL works for me.
>
> Tested with 5.1.7-mvebu-tld-1.

Cool!

I will try this WOL and post back later.

-bodhi
===========================
Forum Wiki
bodhi's corner (buy bodhi a beer)
Re: Debian on Zyxel NAS326
October 07, 2019 12:30AM
030theo,

/usr/sbin/i2cset -y 0x0 0xa 0xa 0x0006 w

It works great on my box!

So the efftect of that i2cset command is also that the WOL status is turned on in the network chip. Before running this i2cset command, the status was "Wake-on: d".


When you look at the eth0 status using ethtool (after running the i2csetc command):

root@Nas326:~# ethtool eth0

Settings for eth0:
	Supported ports: [ TP MII FIBRE ]
	Supported link modes:   10baseT/Half 10baseT/Full 
	                        100baseT/Half 100baseT/Full 
	                        1000baseT/Full 
	Supported pause frame use: Symmetric
	Supports auto-negotiation: Yes
	Supported FEC modes: Not reported
	Advertised link modes:  10baseT/Half 10baseT/Full 
	                        100baseT/Half 100baseT/Full 
	                        1000baseT/Full 
	Advertised pause frame use: Symmetric
	Advertised auto-negotiation: Yes
	Advertised FEC modes: Not reported
	Link partner advertised link modes:  10baseT/Half 10baseT/Full 
	                                     100baseT/Half 100baseT/Full 
	                                     1000baseT/Full 
	Link partner advertised pause frame use: Symmetric
	Link partner advertised auto-negotiation: Yes
	Link partner advertised FEC modes: Not reported
	Speed: 1000Mb/s
	Duplex: Full
	Port: MII
	PHYAD: 1
	Transceiver: internal
	Auto-negotiation: on
	Supports Wake-on: g
	Wake-on: g
	Link detected: yes

And it is sticky. Meaning the i2c bus is hooked up so some status register that turns this on permanently. You don't have to add that to /etc/rc.local. It will survive shutdown and reboot.

============

This has caused me to think that perhaps the boot source could be force set the same way when we want to test UART booting (the Sample on Reset register is static).

From your finding, we know that these are for WOL and PowerOff

/sbin/i2cset -y 0x0 0xa 0xa 0x0006 w 
/sbin/i2cset -y 0x0 0xa 0xa 0x0306 w 
/sbin/i2cset -y 0x0 0xa 0xa 0x0107 w 
/sbin/i2cset -y 0x0 0xa 0xa 0x0007 w


The hard part is figuring out what are possible values that can be written to the memory at that 32-bit mask!

/sbin/i2cset -y 0x0 0xa 0xa <some 32 bit mask> w

Perhaps more searching in stock OS would turn up some more clues :) Have you looked at other init scripts that run during halt ?

Thanks!

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



Edited 1 time(s). Last edit at 10/07/2019 12:49AM by bodhi.
Re: Debian on Zyxel NAS326
October 07, 2019 12:01PM
Hi Bohdi,
I searched, but except of the known fanspeed and cpu-temp readings, there were no other occurences of ic2read or ic2write in the RootFS.
Re: Debian on Zyxel NAS326
October 07, 2019 06:19PM
030theo,

> I searched, but except of the known fanspeed and
> cpu-temp readings, there were no other occurences
> of ic2read or ic2write in the RootFS.

Thanks for doing the research!

I've modified the Installation instruction to point to your post for WOL.

Quote

A3. Normal Operation

The USB rootfs should be plugged in permanently, and the serial console module should be removed.

1. Whenever the NAS326 is rebooted or cold started, to boot without manual intervention, the serial console module must be unplugged from the NAS326. If the serial console module is plugged in, then step 1 in the installation instruction A2 must be executed (so that the NAS326 will continue booting when it detected the serial console present). Note that reboot in some instance will work with serial console plugged in.

2. If you want to boot back to stock OS in NAND, just shutdown the box, unplug the USB and power up the box. It will boot the kernel 1 in NAND and then if not successful, it will try kernel 2.

This also serves as a rescue system. Whenever the rootfs on USB has problem and cannot boot (the effect is just like the USB drive is not plugged in), the NAS326 will fall back to booting the kernel 1 or 2 in NAND. When this occurs, the u-boot envs in step 4 must be reentered at serial console again to allow booting back to USB rootfs.

3. Setup WOL. Please see this post for how to activate WOL:

-bodhi
===========================
Forum Wiki
bodhi's corner (buy bodhi a beer)
Re: Debian on Zyxel NAS326
October 09, 2019 04:24AM
030theo,

It was not sticky as I thought it was!

There is some instance where I shutdown the box and could not wake it up (I only ran i2cset once, and after that it survived many reboots and shutdowns).

So, that i2cset command is really needed to be added to /etc/rc.local to ensure it can be woken up always.
/usr/sbin/i2cset -y 0x0 0xa 0xa 0x0006 w

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



Edited 2 time(s). Last edit at 10/09/2019 05:13AM by bodhi.
Re: Debian on Zyxel NAS326
October 12, 2019 09:06AM
Hey bodhi,

I have only just got the change to mess with this now, and I have reached B2. Installation in the guide, however the command fw_printenv just returns command not found. Any ideas whats done wrong?

Thanks,

AHorner
Re: Debian on Zyxel NAS326
October 12, 2019 05:39PM
AHorner,

Are you inside stock OS?

Please post the log of what you did so far (don't describe it, just copy/paste whatever on the terminal).

-bodhi
===========================
Forum Wiki
bodhi's corner (buy bodhi a beer)
Dave
Re: Debian on Zyxel NAS326
November 24, 2019 03:27PM
Hi, is there a solution to regulate/control the fan speed in NAS326 with some script? Currently, there´s a pulsating sound comming from the fan in my box, every 3sec or so :(
Re: Debian on Zyxel NAS326
November 24, 2019 04:31PM
Dave,

> Hi, is there a solution to regulate/control the
> fan speed in NAS326 with some script? Currently,
> there´s a pulsating sound comming from the fan in
> my box, every 3sec or so :(

Not at the moment. See here for the discussion about NSA325 (which is identical to this box re fan and temperature control).

Read a few post before this and a few after:

https://forum.doozan.com/read.php?3,92579,92834#msg-92834

In the meantime, you could put a heavy book on top of the case or tie a large rubber band around the case, to dampen the vibration. That's the noise you hear humming was casued by the fan vibration.

-bodhi
===========================
Forum Wiki
bodhi's corner (buy bodhi a beer)
Re: Debian on Zyxel NAS326
January 12, 2020 10:45AM
Got me NAS326. Nothing from instructions works.
No serial connection(prevents boot), no usb boot.
Nothing.
Tried ext3 on usb, then ext2(edited fstab).
Everything failed.

CASset=max
CONTRY_TYPE=FF
FEATURE_BIT=00
MALLOC_len=5
MODEL_ID=B303
MPmode=SMP
PRODUCT_NAME=STG-328
VENDOR_NAME=MitraStar Technology Corp.
autoload=no
baudrate=115200
boot_order=hd_scr usb_scr mmc_scr hd_img usb_img mmc_img pxe net_img net_scr
bootargs=console=ttyS0,115200 root=LABEL=rootfs rootdelay=10 mtdparts=armada-nand:2m(u-boot),2m(env),2m(config),15m(kernel1),110m(rootfs1),15m(kernel2),-(rootfs2) earlyprintk=serial
bootargs_dflt=$console $nandEcc $mtdparts $bootargs_root nfsroot=$serverip:$rootpath ip=$ipaddr:$serverip$bootargs_end $mvNetConfig video=dovefb:lcd0:$lcd0_params clcd.lcd0_enable=$lcd0_enable clcd.lcd_panel=$lcd_panel
bootargs_end=:10.4.50.254:255.255.255.0:Armada38x:eth0:none
bootargs_root=root=/dev/nfs rw
bootcmd=nand read 0x2000000 0x08700000 0xF00000 && bootz 0x2000000
bootcmd_auto=stage_boot $boot_order
bootcmd_custom=if run usb_bootcmd; then; else if run bootcmd_stock_1; then; else run bootcmd_stock_2; reset; fi; fi
bootcmd_fdt=tftpboot 0x2000000 $image_name;tftpboot $fdtaddr $fdtfile;setenv bootargs $console $nandEcc $mtdparts $bootargs_root nfsroot=$serverip:$rootpath ip=$ipaddr:$serverip$bootargs_end $mvNetConfig video=dovefb:lcd0:$lcd0_params clcd.lcd0_enable=$lcd0_enable clcd.lcd_panel=$lcd_panel; bootz 0x2000000 - $fdtaddr;
bootcmd_fdt_boot=tftpboot 0x2000000 $image_name; setenv bootargs $console $nandEcc $mtdparts $bootargs_root nfsroot=$serverip:$rootpath ip=$ipaddr:$serverip$bootargs_end $mvNetConfig video=dovefb:lcd0:$lcd0_params clcd.lcd0_enable=$lcd0_enable clcd.lcd_panel=$lcd_panel; bootz 0x2000000 - $fdtaddr;
bootcmd_fdt_edit=tftpboot $fdtaddr $fdtfile; fdt addr $fdtaddr; setenv bootcmd $bootcmd_fdt_boot
bootcmd_lgcy=tftpboot 0x2000000 $image_name; setenv bootargs $bootargs_dflt; bootm 0x2000000;
bootcmd_stock_1=run set_bootargs_stock; echo Booting from NAND kernel 1 ...; nand read 0x2000000 0x00E00000 0xF00000 && bootz 0x2000000
bootcmd_stock_2=run set_bootargs_stock; echo Booting from NAND kernel 2 ...; nand read 0x2000000 0x08700000 0xF00000 && bootz 0x2000000
bootdelay=10
cacheShare=no
console=console=ttyS0,115200
core_checksum_1=ef8a9629888e1ceec7460982d09cb77b
core_checksum_2=ef8a9629888e1ceec7460982d09cb77b
curr_bootfrom=2
device_partition=0:1
disaMvPnp=no
eeeEnable=no
enaClockGating=no
enaCpuStream=no
enaFPU=yes
enaMonExt=no
enaWrAllo=no
eth1addr=00:50:43:38:32:25
eth1mtu=1500
eth2addr=00:50:43:38:a6:25
eth2mtu=1500
eth3addr=00:50:43:32:a6:38
eth3mtu=1500
ethact=egiga0
ethaddr=98:0D:67:4D:4C:44
ethmtu=1500
ethprime=egiga0
fdt_addr=2040000
fdt_skip_update=yes
fdtaddr=0x1000000
fdtfile=armada-38x-modular.dtb
fwversion_1=V5.21(AAZF.4)
fwversion_2=V5.21(AAZF.4)
ide_path=/
image_name=uImage
img_checksum_1=4f8482d456f3aa06b3d7a4769916fa45
img_checksum_2=4f8482d456f3aa06b3d7a4769916fa45
initrd_name=uInitrd
ipaddr=10.4.50.170
kernel_addr=${kernel_addr_1}
kernel_addr_1=0x00000000; run bootcmd_custom; 
kernel_addr_2=0x08700000
kernel_addr_r=2080000
kernel_mtd_1=3
kernel_mtd_2=5
lcd0_enable=0
lcd0_params=640x480-16@60
lcd_panel=0
load_dtb_addr=0x1000000
load_image_addr=0x02000000
load_initrd_addr=0x2900000
loadaddr=0x02000000
loads_echo=0
modelid_1=B303
modelid_2=B303
mtdids=nand0=armada-nand
mtdparts=mtdparts=armada-nand:2m(u-boot),2m(env),2m(config),15m(kernel1),110m(rootfs1),15m(kernel2),-(rootfs2)
mvNetConfig=mv_net_config=4,(00:50:43:11:11:11,0:1:2:3),mtu=1500
mv_pon_addr=00:50:43:25:a6:38
nandEcc=nfcConfig=4bitecc
netbsd_en=no
netmask=255.255.255.0
netretry=no
next_bootfrom=2
pcieTune=no
pexMode=RC
pxe_files_load=:default.arm-armadaxp-db:default.arm-armadaxp:default.arm
pxefile_addr_r=3100000
ramdisk_addr_r=2880000
revision_1=51163
revision_2=51163
romfile_checksum_1=55FA
romfile_checksum_2=55FA
rootpath=/srv/nfs/
sata_delay_reset=0
sata_dma_mode=yes
script_addr_r=3000000
script_name=boot.scr
serial_number=S190Y30120562
serverip=10.4.50.38
set_bootargs_stock=setenv bootargs "console=ttyS0,115200 ubi.mtd=4,2048 rootfstype=ubifs root=ubi0:rootfs1 rw rootdelay=2"
standalone=fsload 0x2000000 $image_name;setenv bootargs $console $nandEcc $mtdparts root=/dev/mtdblock0 rw ip=$ipaddr:$serverip$bootargs_end; bootm 0x2000000;
stderr=serial
stdin=serial
stdout=serial
sysimg_mtd_1=4
sysimg_mtd_2=6
usb0Mode=host
usbActive=1
usbType=2
usb_bootcmd=echo Booting from USB ...; setenv fdt_skip_update yes; run usb_init; ext2load usb 0:1 $load_image_addr /boot/zImage; ext2load usb 0:1 $load_dtb_addr /boot/dts/armada-380-zyxel-nas326.dtb; ext2load usb 0:1 $load_initrd_addr /boot/uInitrd; run usb_set_bootargs; bootz $load_image_addr $load_initrd_addr $load_dtb_addr
usb_init=mw.l f1018100 20420000; mw.l f1018140 003E8800; sleep 3; usb start
usb_set_bootargs=setenv bootargs "console=ttyS0,115200 root=LABEL=rootfs rootdelay=10 $mtdparts earlyprintk=serial"
vxworks_en=no
yuk_ethaddr=00:00:00:EE:51:81
zld_checksum_1=fb6f99502a16990e237befde4540abd0
zld_checksum_2=fb6f99502a16990e237befde4540abd0
change_boot_part=0


If anybody can help I'll be happy.
Thanks.

Changed change_boot_part=0 to change_boot_part=1
printed env
rebooted

------
moderator edit: added code tag



Edited 1 time(s). Last edit at 01/12/2020 10:16PM by bodhi.
Re: Debian on Zyxel NAS326
January 12, 2020 10:17PM
vadim,

Do you have serial console? can you boot with it and post the boot log here?

-bodhi
===========================
Forum Wiki
bodhi's corner (buy bodhi a beer)
Re: Debian on Zyxel NAS326
January 12, 2020 10:55PM
Yes, I connected serial adapter, Prolific 2303(as I recall, writing from work). I successfully installed debian on Stora, Iomega with this adapter. I use screen on Debian Buster. Unit doesn't boot with adapter in USB slot. I disconnected it, boot proceeds. Then I quickly connect it and see some scrawls like word fragments.
I tried with kwboot from u-boot package from Debian. I received only HHD1 power up message and unit was booted into stock system.
So, no success.
Then I prepared rootfs on 2 usb sticks. Everything right to instruction from September 2019. Untar, concatenate Armada kernel text, then build Image with mkimage. Then turned on ssh in web-console and issued commands fw_setenv like in instruction. sync&sync&/sbin/reboot. Boot stucks on usb and freezes. Disconnect USB then power up. Stock system with web-console again.
So, this magic feeling -- nowhere to go.
I got arm box like Netgear Stora with Debian stretch. Can start again on Stora. Does it make a difference?
Re: Debian on Zyxel NAS326
January 13, 2020 12:26AM
vadim,

1. Sept 2019 is the wrong rootfs to use.

You need to follow the installation instruction exactly
https://forum.doozan.com/read.php?2,88619

Quote

For 1st time installation, please use the instruction below.

The correct rootfs is Debian-4.9.0-mvebu-tld-12-rootfs-bodhi.tar.bz2.

After that you can upgrade kernel (I will write a few envs for you when you do that).

2. To boot with serial console attached, the installation instruction said in step 1:

Start kwboot on the serial console host

kwboot -t -B 115200 /dev/ttyUSB0 -d

----
edited: typo

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



Edited 1 time(s). Last edit at 01/13/2020 03:37AM by bodhi.
Re: Debian on Zyxel NAS326
January 13, 2020 12:48PM
1 stage.
sudo kwboot -t -B 115200 /dev/ttyUSB0 -d
[sudo] password for vadim:
Sending debug message. Please reboot the target...|
2 red leds.
Eternity follows.
Unplugged adapter.

2 stage.
usb partition label rootfs ext3 1.5Gb
as root tar -xjf Debian-4.9.0-mvebu-tld-12-rootfs-bodhi.tar.bz2
cd /media/vadim/rootfs/boot
-rw-r--r-- 1 root root 150531 Feb 1 2017 config-4.9.0-mvebu-tld-12
drwxr-xr-x 2 root root 4096 Jan 19 2017 dts
-rw-r--r-- 1 root root 6210439 Feb 4 2017 initrd.img-4.9.0-mvebu-tld-12
-rw------- 1 root root 2845228 Feb 1 2017 System.map-4.9.0-mvebu-tld-12
-rw-r--r-- 1 root root 3904464 Feb 4 2017 uImage
-rw-r--r-- 1 root root 6210503 Feb 4 2017 uInitrd
-rw------- 1 root root 3904400 Feb 1 2017 vmlinuz-4.9.0-mvebu-tld-12
-rwxr-xr-x 1 root root 3904400 Feb 1 2017 zImage
-rwxr-xr-x 1 root root 3904400 Feb 1 2017 zImage-4.9.0-mvebu-tld-12
cp -a zImage-4.9.0-mvebu-tld-12 zImage
/dev/root / ext3 noatime,errors=remount-ro 0 1
Stock Os
BusyBox v1.19.4 (2019-04-23 17:31:43 CST) built-in shell (ash)
Enter 'help' for a list of built-in commands.

~ # whoami
root

fw_setenv change_boot_part 1
/sbin/reboot

Loads into Stock Os.

Maybe I need to unplug the HDD?



Edited 1 time(s). Last edit at 01/13/2020 11:45PM by vadim.
Re: Debian on Zyxel NAS326
January 13, 2020 11:13PM
Maybe there is a way to downgrade firmware? Maybe Zyxel closed all possible doors in newest revisions?
Re: Debian on Zyxel NAS326
January 13, 2020 11:48PM
vadim,

1. You did not follow the instruction.

https://forum.doozan.com/read.php?2,32146

Quote

Installation Instruction for specific boxes:

Zyxel NAS326 (Armada 380) Installation, see this thread.
WD My Cloud EX2100 (Armada 385) Installation: see this thread.
GlobalScale Technologies Mirabox (Armada 370) Installation, see this thread
Thecus N2350 (Armada 385) Installation: see this thread.
Synolgy RS816 (Armada 385) Installation: see Installation with USB rootfs (Section I). In the near future, there will be 3 more sections for other installation methods, but they are not ready yet.

https://forum.doozan.com/read.php?2,88619

Quote

Installation for NAS326 box can be done with serial console connected (section A), or inside stock OS and without serial console (section B for USB rootfs, section C for SATA rootfs). Note: for section A and B, the USB rootfs must be inserted to the front USB port (USB 2.0).

So you need to do section A or section B.

2. Your serial console is not working properly.

Quote

Yes, I connected serial adapter, Prolific 2303(as I recall, writing from work). I successfully installed debian on Stora, Iomega with this adapter. I use screen on Debian Buster. Unit doesn't boot with adapter in USB slot. I disconnected it, boot proceeds. Then I quickly connect it and see some scrawls like word fragments.

If it did work, then you should see clearly the boot progress.

-bodhi
===========================
Forum Wiki
bodhi's corner (buy bodhi a beer)
Re: Debian on Zyxel NAS326
January 14, 2020 12:14AM
I did section A to no success.
What time does it take
kwboot -t -B 115200 /dev/ttyUSB0 -d
10 mins?
1 hour?
I surely waited for 20 mins minimum. Only spinnin wheel.
Plugged serial to NetGear Stora -- WORKS like a charm.
I use kwboot from Debian Buster u-boot package.
If it's wrong where can I get patched one?


I plugged out serial and did section B.
Still no success.

Following instructions absolutely.
I got PL2303 USB UART adapter.
Maybe I will try FT232 USB UART? I can buy it nearby.



Edited 1 time(s). Last edit at 01/14/2020 12:22AM by vadim.
Re: Debian on Zyxel NAS326
January 14, 2020 02:29AM
vadim,


> I did section A to no success.
> What time does it take
> kwboot -t -B 115200 /dev/ttyUSB0 -d
> 10 mins?
> 1 hour?

About 30 seconds or less.

> I surely waited for 20 mins minimum. Only spinnin
> wheel.

As I said, your serial console is not working on this box! The garbage chars output is a tell that the serial console is not grounded properly.

> Plugged serial to NetGear Stora -- WORKS like a
> charm.
> I use kwboot from Debian Buster u-boot package.
> If it's wrong where can I get patched one?


kwboot on Buster should work fine.

>
> I plugged out serial and did section B.
> Still no success.
>
> Following instructions absolutely.

I need to see the log of what you did to double check it for you.

-bodhi
===========================
Forum Wiki
bodhi's corner (buy bodhi a beer)
Re: Debian on Zyxel NAS326
January 14, 2020 10:52PM
I successfully booted from USB.
Bought another serial adapter CP2102 USB UART Board.
kwboot still didn't work. Endless loop.
But I replugged adapter in screen and somehow was able to interrupt boot process
Then setenv, savenv and reset.
Works like a charm, dmesg without flaws.
Old adapter PL2303 still connects to Netgear Stora and I examined RX and TX with oscilloscope.
Signals from PL2303 are garbled and front is somewhat sloppy.
CP2102 shows clear signals.
Main cause of my fails was I think fake chinese adapter.
Use genuine parts, friends.
Thanks for help, bodhi.
Keep up the good work!
Re: Debian on Zyxel NAS326
January 14, 2020 11:24PM
Cool! Glad to hear it works well.

-bodhi
===========================
Forum Wiki
bodhi's corner (buy bodhi a beer)
Re: Debian on Zyxel NAS326
January 21, 2020 05:32AM
I got some trouble with Debian-4.9.0-mvebu-tld-12-rootfs-bodhi.tar.bz2.
Everything works at home with Zyxel router as default gateway.
Then travelled to work place.
Network is unreachable with TP-Link TL-MR3420 router.
There are about 20 hosts here. All connect without problem by wi-fi dhcp or manual ip through cable.
The stock OS on Zyxel 326 connects by cable well too.

But Debian from USB can't see carier or line or something.
Pings localhost, manually set ip pings too.
No dhcp service.
I connected 326 to my work computer by cross cable. Connects allright.

So, network problem with TP-Link TL-MR3420 router only.
Here I got serial cable and I can perform any operations.
Thanks for reply, sorry to waste your time, bodhi and folks.
Pls help.
Re: Debian on Zyxel NAS326
January 21, 2020 06:35AM
vadim,

> Network is unreachable with TP-Link TL-MR3420
> router.
> There are about 20 hosts here. All connect without
> problem by wi-fi dhcp or manual ip through cable.
> The stock OS on Zyxel 326 connects by cable well
> too.
>
> But Debian from USB can't see carier or line or
> something.

> Pings localhost, manually set ip pings too.
> No dhcp service.
> I connected 326 to my work computer by cross
> cable. Connects allright.
>
> So, network problem with TP-Link TL-MR3420 router
> only.
> Here I got serial cable and I can perform any
> operations.

I think it might have something to do with the MAC address.

There was some problem (in a few versions between kernel versions 4.9.0-mvebu-tld-12 to linux-5.3.5-mvebu-tld-1) with using the real (persistent) MAC address when the kernel parses the DTB. And that results in a randomly generated MAC address. Some router take a very long time to assign IP when the MAC address changes between boots.

Look in your dmesg for that. And also check ifconfig to see if the MAC address is the persistent one

ifconfig
fw_printenv ethaddr

I can take a look if you post this after you've logged into Debian using serial console:
fw_printenv
dmesg

If indeed the MAC address was randomly generated, then the quickest solution is to hardcode the MAC address in /etc/network/interfaces to make it persistent:

hwaddress ether xx:xx:xx:xx:xx:xx

where xx:xx:xx:xx:xx:xx is your box MAC addresss (u-boot env ethaddr)

-bodhi
===========================
Forum Wiki
bodhi's corner (buy bodhi a beer)
Re: Debian on Zyxel NAS326
January 21, 2020 07:16AM
fw_printenv ethaddr 98:0D:67:4D:4C:44

ifconfig HWaddr ee:88:de:f6:9d:5a

No luck with dhcp
Then manual
auto lo eth0
iface lo inet loopback
#iface eth0 inet dhcp
auto eth0
iface eth0 inet static
address 192.168.1.25
netmask 255.255.255.0
gateway 192.168.1.1
hwaddress ether 98:0D:67:4D:4C:44

Still no luck with network.

eth0 Link encap:Ethernet HWaddr 98:0d:67:4d:4c:44
inet addr:192.168.1.25 Bcast:192.168.1.255 Mask:255.255.255.0
Attachments:
open | download - dmesg.txt (20.2 KB)
open | download - fw_printenv.txt (4.8 KB)
Re: Debian on Zyxel NAS326
January 21, 2020 03:42PM
vadim,

Use this the setting for /etc/network/interfaces

auto lo eth0
iface lo inet loopback
#iface eth0 inet dhcp
iface eth0 inet static
        address 192.168.1.25
         netmask 255.255.255.0
         gateway 192.168.1.1

Reboot with serial console and in Debian

ifdown eth0
ifconfig -v eth0 hw ether 98:0d:67:4d:4c:44
ifup eth0

Start pinging 192.168.1.1

ping 192.168.1.1

You should get network connection right away. If not, wait for a few minutes. If still not getting network connection after 10 minutes, please post

dmesg
ifconfig -a

Note: If you could log into the router web interface at work, you can check to see if the MAC address was reset correctly.

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



Edited 1 time(s). Last edit at 01/21/2020 03:44PM by bodhi.
Re: Debian on Zyxel NAS326
January 21, 2020 11:23PM
Still no connect to network.

There is no 25th host in router's admin page.
Only macs of those who is on dhcp.
I can bind mac of 326 to ip though if you'd instruct so.

Files in attachment.
Attachments:
open | download - dmesg.txt (20.2 KB)
open | download - ifconfig.txt (1.5 KB)
Re: Debian on Zyxel NAS326
January 22, 2020 03:22AM
vadim,

Can you see the router's system log if it has any error or rejecting the NAS326?

Another possibility is that IPV6 is not supported by the router, while the rootfs has IPV6 enabled by default.

inet6 addr: fe80::9a0d:67ff:fe4d:4c44/64 Scope:Link

Try adding the ipv6 disable parameter to the end of bootargs. In serial console:

setenv usb_set_bootargs 'setenv bootargs "console=ttyS0,115200 root=LABEL=rootfs rootdelay=10 $mtdparts earlyprintk=serial ipv6.disable=1"'

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



Edited 1 time(s). Last edit at 01/22/2020 03:23AM by bodhi.
Re: Debian on Zyxel NAS326
January 22, 2020 04:17AM
Changed env, still no ping from any 192.168.1 address
eth0      Link encap:Ethernet  HWaddr 98:0d:67:4d:4c:44  
          inet addr:192.168.1.25  Bcast:192.168.1.255  Mask:255.255.255.0
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:0 errors:0 dropped:0 overruns:0 frame:0
          TX packets:68 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:532 
          RX bytes:0 (0.0 B)  TX bytes:5025 (4.9 KiB)
          Interrupt:36

root@debian:~# arp 192.168.1.1 
Address                  HWtype  HWaddress           Flags Mask            Iface
192.168.1.1                      (incomplete)                              eth0


Maybe proceed with linux-4.9.0-mvebu-tld-12-bodhi.tar.bz2?
Maybe smthing will be changed?

--------
bodhi edited: please use code tag to post log



Edited 1 time(s). Last edit at 01/22/2020 04:41AM by bodhi.
Re: Debian on Zyxel NAS326
January 22, 2020 04:39AM
vadim,

To summarize: at home network works OK, but at work with this TP-Link router it does not?

Could it be a IP address block restriction in the router setting?

I guess we should try the latest kernel to see if any difference. I will come back and post the env change to boot linux-5.3.5-mvebu-tld-1-bodhi.tar.bz2

-bodhi
===========================
Forum Wiki
bodhi's corner (buy bodhi a beer)
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: