Welcome! Log In Create A New Profile

Advanced

NSA320 reboot-after-power-loss

Posted by Safari Jack 
NSA320 reboot-after-power-loss
October 11, 2020 12:31AM
I've looked around several times in the forum for NSA320 I2C settings for this. I've found the 310 thread which I had hoped would be close enough, but I2C read shows the bits are already set in that register, so it must be somewhere else. No luck elsewhere on Google either.

Does anybody have the magic settings for these by any chance? If so, it would be a handy thing to add to the "wiki."

I've occasionally tried to pull up the original root file system from the MTD partitions to dig out the original Zyxel, but from what I can tell they were yaffs2 and I don't think any of the current kernels have support for this? And yaffs2utils package hasn't been happy with any of the MTD partition dumps I've tried to take. I kwboot'ed back to the stock uboot once, but either the kernel or the initramd images would not verify anymore, so stock FW wasn't able to boot and get me to the point where I could just copy off all the tools to a flash drive. (I still need to try using the backup partitions one of these days, but there is always something else to get done...)
Re: NSA320 reboot-after-power-loss
October 11, 2020 02:23AM
I have an NSA320 with stock firmware and backup as I'm working on an OpenWrt patch as the other Kirkwood ZyXel NAS devices are already supported. What exactly would you like to have from the original firmware?

Ray
Re: NSA320 reboot-after-power-loss
October 11, 2020 03:35AM
Safari Jack,

Quote

I've looked around several times in the forum for NSA320 I2C settings for this. I've found the 310 thread which I had hoped would be close enough, but I2C read shows the bits are already set in that register, so it must be somewhere else. No luck elsewhere on Google either.

Try the Wiki:

Quote
https://forum.doozan.com/read.php?2,23630
Sensors & Fan & WOL

OWFSPlug : 1-Wire File System + Motion Detection Software in a NAND Package
OWFS & Motion Detection (external link)
How to control GPIO in Linux userspace for GPIO-enable fan
Zyxel NSA 310S/320S/325/326 CPU Temperature and Fan Speed reading
Zyxel NAS326 WOL
Zyxel NAS326 Auto-Power Up
Zyxel NAS326 WOL and Auto-Power Up I2C commands

The Zyxel boxes 310s/320s/325/326 all use the same I2C commands.

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



Edited 1 time(s). Last edit at 10/11/2020 03:56PM by bodhi.
Re: NSA320 reboot-after-power-loss
October 11, 2020 10:41AM
No dice, nothing on i2c-0 at that address

# /usr/sbin/i2cdetect -y 0
     0  1  2  3  4  5  6  7  8  9  a  b  c  d  e  f
00:          -- -- -- -- -- -- -- -- -- -- -- -- -- 
10: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 
20: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 
30: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 
40: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 
50: 50 UU -- -- -- -- -- -- -- -- -- -- -- -- -- -- 
60: -- -- -- -- 64 -- -- -- -- -- -- -- -- -- -- -- 
70: -- -- -- -- -- -- -- --

This is an old NSA320, not a 320s.

Ray, I was going to do the disassembly of the default Zyxel apps to try and dig out the settings, a-la https://forum.doozan.com/read.php?3,92579,92769#msg-92769. (Ironically no, safarik from that thread is not me.)
Re: NSA320 reboot-after-power-loss
October 11, 2020 03:58PM
Safari Jack,


> This is an old NSA320, not a 320s.

Ah. My mistake. The old NSA320 use normal sensor control. So try lmsensor to see if it helps.

-bodhi
===========================
Forum Wiki
bodhi's corner (buy bodhi a beer)
Re: NSA320 reboot-after-power-loss
October 11, 2020 09:51PM
Safari Jack,

>(I still need to try
> using the backup partitions one of these days, but
> there is always something else to get done...)

Your best bet is using mtd backup files from someone, ie. Ray's, to restore to stock. And then dig in stock OS to find some scripts that deal with I2C.

-bodhi
===========================
Forum Wiki
bodhi's corner (buy bodhi a beer)
Re: NSA320 reboot-after-power-loss
January 02, 2021 04:20PM
Finally got around to resolving this over the winter holiday. Built a bodhi kernel with yaffs2 ported into it, extracted the gzipped ext image file from the MTD rootfs, disassembled and string'ed out zyshd to get:
# i2cset -y 0x0 0x50 0x06 0x01 b
(One byte before the magic address for the NSA325.) One more bit of data for your Wiki.

Thank you a million times over bodhi for all the work you did to get us here.

--SJ
Re: NSA320 reboot-after-power-loss
January 02, 2021 06:23PM
Safari Jack,

> # i2cset -y 0x0 0x50 0x06 0x01 b

> (One byte before the magic address for the
> NSA325.) One more bit of data for your Wiki.


Let me restate your finding to make it clear.

On NSA320, to make reboot automatic after a power loss (no need to use the Power button):
i2cset -y 0x0 0x50 0x06 0x01 b

This might work on NSA325 also.

Thanks SJ!

-bodhi
===========================
Forum Wiki
bodhi's corner (buy bodhi a beer)
Re: NSA320 reboot-after-power-loss
August 31, 2021 03:04PM
Hmmm... trying to make this work on my NSA-320, which has only a rescue in flash ATM, no hdd.
modprobe i2c-dev
root@rescue-nsa320:~$ i2cset -y 0 0x50 0x6 0x1 b
root@rescue-nsa320:~$ i2cget -y 0 0x50 0x6 b
0x01

For completeness, and FWIW:
root@rescue-nsa320:~$ i2cdetect -y 0
     0  1  2  3  4  5  6  7  8  9  a  b  c  d  e  f
00:          -- -- -- -- -- -- -- -- -- -- -- -- -- 
10: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 
20: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 
30: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 
40: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 
50: 50 UU -- -- -- -- -- -- -- -- -- -- -- -- -- -- 
60: -- -- -- -- 64 -- -- -- -- -- -- -- -- -- -- -- 
70: -- -- -- -- -- -- -- --
and...
i2cdump -y 0 0x50
     0  1  2  3  4  5  6  7  8  9  a  b  c  d  e  f    0123456789abcdef
00: c8 6c 87 ef df a8 01 ff ff ff ff ff ff ff ff ff    ?l?????.........
10: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff    ................
20: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff    ................
and maybe a clue... does the board/i2c chip need power from the on-board battery? [ red herring : I replaced the battery w/ a known good unit - no change]
dmesg
[    3.676436] rtc-pcf8563 0-0051: low voltage detected, date/time is not reliable.


Unplug, plug back in... I see the giga enet orange LED flicker a bit, but no Auto-Power-On. Am I missing something obvious here?

@Safari_Jack : is there another poke or prod that needs to be done in order for this to work?

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



Edited 4 time(s). Last edit at 08/31/2021 06:58PM by davygravy.
Author:

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: