> It could be the case that since the fan is auto-control, Zyxel does not see the benefit of adding the fan control i2c command to the script. Exactly, that is my impression.by safarik - uBoot
bodhi, are you sure it can be done? It seems to me from all the information that fan speen cannot be controlled on NSA325. Tomasby safarik - uBoot
The fan seems to be self regulating its rotations somehow so I did not think of it as an issue.... But I undestand that if it can be controlled it is nice to know how to do that just for the possibility itself :) Tomasby safarik - uBoot
Hello Koen, I took a quick search but did not find anything about fans there. And from what Mijzelf wrote here https://forum.openwrt.org/t/zyxel-nsa325-power-on-after-power-failure/48176/6 it seems there is no fan control at all. Why do you even want to control the fan do you have some problem with them? Tomasby safarik - uBoot
Just for sure - I am not interested in this any more as I managed to solve it with current firmware. https://forum.doozan.com/read.php?3,92579,92769#msg-92769by safarik - uBoot
I got it working! TL;DR : The magic is this: # i2cset -y 0x0 0x50 0x7 0x01 b After setting this the device alwas powers on after cable reconnecting no matter if it was on of or before. Exactly as I wanted! Before the value was 0x00 # i2cget -y 0x0 0x50 0x7 b 0x00 And now it is 0x01 # i2cget -y 0x0 0x50 0x7 b 0x01 I guessed it from folowwing code that I disassembleby safarik - uBoot
I see... unfortunatelly i2cset -y 0x0 0x0a 0x0a 0x0007 w did not change the Power on behavior. But I also see setting values to both chips on address 0x0a and 0x50. I do not know if it is save to randomly trying to set some values in the chips... Tomasby safarik - uBoot
Is it known what I2C chip are there on NSA325 and what they do? 0 1 2 3 4 5 6 7 8 9 a b c d e f 00: -- -- -- -- -- -- -- 0a -- -- -- -- -- 10: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 20: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 30: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 40: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 50: 50 UU --by safarik - uBoot
bodhi, can you please explain me how did come to this command? Thanks, Tomasby safarik - uBoot
I will install i2c-tools on my current openwrt installation tomorrow and try these command directly. Definitely will let you know the results. Tomasby safarik - uBoot
After some looking around it seems to me that zyshclient is used for communicating with zyshd that actualy does the work. Looking into zyshd I can see: \x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00/etc/zyxel/storage/pwron.status\x00\x01\x02LIST;\x03\x0a\x00\x00\x00status: %s\x0a\x00\x04\x0a\x00\x00status: former\x0a\x00former\x00\x00Disable Auto Power-On Setting: %s\x00\x00\x00FAILED\x00\by safarik - uBoot
Bodhi, yes I checked it and it is dynamically linked binary: $ file zyshclient zyshclient: ELF 32-bit LSB executable, ARM, EABI5 version 1 (SYSV), dynamically linked, interpreter /lib/ld-linux.so.3, for GNU/Linux 2.6.16, stripped I have two ideas: 1) dissasemble - but do not have enough knowledge and tools to do it 2) run it in the original evironment - do you know if I could beby safarik - uBoot
bodhi, when I have both zImage and filesystem do you think it would be somehow possile to temporary run it on the device to be able to execute the "zyshclient" utility to set the Power on ? Thanks, Tomasby safarik - uBoot
In etc/init.d/rcS2 I found: ###### set auto power-on if [ -e /etc/zyxel/storage/pwron.status ]; then pwrmode=`cat /etc/zyxel/storage/pwron.status` zyshclient -p 150 -e "pwron ${pwrmode}" else zyshclient -p 150 -e "pwron former" fi What is zyshclient? UPDATE: Some binary in sbin/ Any idea what it does or how to find what it does? UPDATE: $ strings zyby safarik - uBoot
OK, I was able to extract both zImage and filesystem following the article. $ dd if=481AALS1C0.bin skip=318 count=5796168 bs=1 of=uimage.bin $ dd if=481AALS1C0.bin skip=5796486 count=44384940 bs=1 of=filesystem.bin So I am going to search if I can find what sets this. Any idea what I am looking for? :)by safarik - uBoot
I found this article how to extract data from Zyxel firmware and I am trying to follow it. https://www.pentestpartners.com/security-blog/using-hexdump-analysis-for-firmware-extraction-a-how-to/ But so far I am not successfull as I do not undestand how to count the lenght of data to extract by dd.by safarik - uBoot
Thank you very much. I will try to investigate it myself, but I am total newbie to this. $ binwalk 481AALS1C0.bin DECIMAL HEXADECIMAL DESCRIPTION -------------------------------------------------------------------------------- 318 0x13E uImage header, header size: 64 bytes, header CRC: 0xF3523079, created: 2017-06-23 03:04:04, image size: 5796104 bytes, Daby safarik - uBoot
I thought that you might have some experience with the original firmware formats :) https://www.zyxel.com/support/SupportLandingSR.shtml?c=gb&l=en&kbid=M-01820&md=NSA325%20v2 Tomasby safarik - uBoot
Bodhi, is there a way to unpack/mount the stock firmware 481AALS1C0.bin on my computer to search for the script that might be configuring "Power on after power failure"? Tomasby safarik - uBoot
bodhi, I am afraid not or I lost it. It is quite some time - first I experimented with Arch (alarm), then your Debian, then stock Debian (with my kernel to boot directly from raid) and I ended up on LEDE/OpenWrt (which seems most suitable for me as it is most lightweight and performs well). Can I some how extract it from the stock firmware? Sorry for creating another topic - I thought thby safarik - uBoot
Hello, I am currently using OpenWrt on my NSA325 but I would like to run the stock firmware ( V4.81(AALS.1)C0 which is available from official page https://www.zyxel.com/support/SupportLandingSR.shtml?c=gb&l=en&kbid=M-01820&md=NSA325%20v2 ) to try to set Power On After Power Failure ( https://forum.doozan.com/read.php?3,92579 ). But I have no clue how to corectly reflash it. Doeby safarik - uBoot
I have no idea what part of device might be responsible for such feature and how to configure it. uboot maybe? (This is why placed the question in this part of forum.) Tomasby safarik - uBoot
Hello Bodhi, thanks for the suggestion but this is not what I am looking for (altough it is a nice alternative). I am convinced the device is capable of this because the manual NSA325_V4.70 Ed4.pdf explicitly mentions that on page 326 and 327: QuotePower On After Power Failure Select an option to set whether or not the NSA restarts when the power is restored after a power failure. Noby safarik - uBoot
Hello, does anyone please know how to configure automatic power on/off after power failure behavior of Zyxel NSA 325? I cannot find any information about how to set this. My only idea now is to temporarily boot into stock and try to set it there to try if it persists. But I am not sure if booting stock is possible after u-boot upgrade. Thanks for any ideas or hints, Tomasby safarik - uBoot
@bodhi, sorry for posting unrelated stuff to this thread. But as I managed to solve the problem (I was missing built-in SCSI support) and I don't want to open new thread just for one post. To sum up: - loading kernel image from RAID parition works (superblock version 0.90 + ext4) - autodetection and assemble of RAID1 device works at boot time without initrd (superblock version 0.by safarik - Debian
@davidedg My .config is based on bodhis but main difference is that bodhis kernel has also initrd. And I don't use initrd at all. So if there is something compiled as module (=m) it is not available for me. Tomasby safarik - Debian
Still no luck, but I have a feeling that my kernel is missing something that may be compiled as module in bodhis and my SATA disks are not fully initialized. Bacuse in bodhis boot I can see: [ 5.494017] ata1: SATA link up 3.0 Gbps (SStatus 123 SControl F300) [ 5.534043] ata1.00: ATA-9: ST3000DM001-1CH166, CC27, max UDMA/133 [ 5.540250] ata1.00: 5860533168 sectors, multi 0: LBA48by safarik - Debian
And the md autodetection does not work as davidbg mentioned :) [ 2.270045] md: Waiting for all devices to be available before autodetect [ 2.276914] md: If you don't use raid, use raid=noautodetect [ 2.283243] md: Autodetecting RAID arrays. [ 2.287361] md: Scanned 0 and added 0 devices. [ 2.291814] md: autorun ... [ 2.294656] md: ... autorun DONE. My next step wby safarik - Debian
bodhi Wrote: ------------------------------------------------------- > It has to be embedded manually after built (not > automatically). That was the missing piece. Now it boots. cat dts/kirkwood-nsa325.dtb >> zImage mkimage -A arm -O linux -T kernel -C none -a 0x00008000 -e 0x00008000 -n "Linux kernel" -d zImage uImage Thanksby safarik - Debian
@bodhi DTB has the time when I compiled the kernel. If I understand it correctly DTB is included in the uImage. safarik@ts-n:~/00zyxel/vanilla/linux-3.18.5/arch/arm/boot/dts$ ls -la kirkwood-nsa325* -rw-r--r-- 1 root root 14262 bře 19 14:37 kirkwood-nsa325.dtb -rw-r--r-- 1 root root 6768 bře 19 11:02 kirkwood-nsa325.dtsby safarik - Debian