OpenWrt for Zyxel WSM20 (Multy M1) development discussion

it seemed to me that I had to find

1 - a solution to start openwrt from OEM u-boot
if not possible
compile a new u-boot or use another one
2 - see if the sysupgrade will work & if lan & wan are in good order
3 - the leds and buttons are only at the end of the tests

my leds in dts

   leds {
                compatible = "gpio-leds";

                ether {
                        gpios = <0x17 0x04 0x01>;
                        label = "ether:red";
                        default-state = "off";
                };

                status {
                        gpios = <0x17 0x03 0x01>;
                        label = "status:white";
                        default-state = "off";
                };

                wlan {
                        gpios = <0x17 0x08 0x01>;
                        label = "wlan:green";
                        default-state = "off";
                };
        };


boot power on green
openwrt boot white blink
openwrt network good white fixed
after you can program the 3 colors red white green as you want

I will go with the standard options


Lake green: white - green - white - green - whie


Red: off - red - off - off -off


Green: off - green - off - green - off


Yellow (confirmed): off - yellow - off -off -off


Pink: off - off - off - off - pink

Given the @andyboeh proposal I will config all 5 colors without specific assignment, green lake for Power On and Yellow for Sysupgrade

Now it's time to investigate the GPIO for the buttons.

3 buttons:

  1. One for WPS mode activation
  2. Reset device
  3. LEDs on and off

I wonder how can I debug this 3 GPIO

1 Like

we do not use wps at all. reset i told you is 6 and for leds on off we need look at original DTS.and that should be easy too.

I don't need the OG DTS, I already have all the pins and Annick also has them

Why 6?

because we tested and @Annick said that is working.

Yes I see that Annick found that reset is 6 and WPS is 12

keys {
                compatible = "gpio-keys";

                reset {
                        label = "reset";
                        gpios = <&gpio 6 GPIO_ACTIVE_LOW>;
                        linux,code = <KEY_RESTART>;
                };

                wps {
                        label = "wps";
                        gpios = <&gpio 12 GPIO_ACTIVE_LOW>;
                        linux,code = <KEY_WPS_BUTTON>;
                };
        };

So I'm just missing the on & off leds button

that's on off leds gpio 10

fn1 {
			gpios = <0xf 0x10 0x1>;
			label = "fn1";
			linux,code = <0x1d2>;
		};

if you will use fn1 buton ( on-off leds ) requiert a special script

etc/rc.button/fn1 -> use oem binary: zyxel_led_ctrl

#!/bin/sh
# echo "[${BUTTON} button] ${ACTION} button" > /dev/console
# if [ "${ACTION}" = "pressed" ]; then
# fi
# if [ "${ACTION}" = "released" ]; then
# fi
/sbin/zyxel_led_ctrl BrightnessStepSW

leds all off`

#!/bin/sh
for p in `find /sys/devices/platform/leds/leds -name trigger`
do
echo none > $p
done
for p in `find /sys/devices/platform/leds/leds -name brightness`
do
echo 0 > $p
done

leds all on

#!/bin/sh
for p in `find /sys/devices/platform/leds/leds -name trigger`
do
echo none > $p
done
for p in `find /sys/devices/platform/leds/leds -name brightness`
do
echo 1 > $p
done

so to do:

you have to test the button fn1 pressed
you have to test the active leds & save leds statut
you must turn off the active leds

you must test the released fn1 button
you must restore the old status of leds

1 Like

that is overkill ,joking, anyway i would paint the leds white,so no leds at all.

1 Like

for the night when I sleep or for the sake of energy saving no leds:

sh leds_off

yes that's right

SirLoen wants to cut hair in 4 with leds when he still hasn't managed to put openwrt

some infos for leds:

1 Like

in other words that is just that. who care about that. if you want the leds, just say that in DTS if you do not like cut off, i prefer second option.

my hair are very long almost 60 cm so alot time needed to cut in 4

I see a fun option for the fn1 button

first press - PSYCHEDELIC leds mode, random lighting
button off this returns to the initial state
second press on everything leds turns off for energy saving mode
button off this returns to the initial state

Next step is flashing it into ROM. I'm going to try to do a sysupgrade from initramfs to see if sticks. Otherwise I will need to build a factory build but the problem here is that I'm not sure which parameters should be passed to the kernel to build such optimally. I don't have references moreover this device seems to be pretty unique in many aspects despite of using many popular components.

if you can't find it you should contact ptp52
and tell it what are the settings in original dts

the price has doubled at amazon !!!

That router is completely different
Where have you seen that WSM20 has two slots?
or atds atna commands on U-Boot?
Who is ptp52?

opkg zyxel ...

test:
zyxel-bootconfig /dev/mtdx get-status
Active Image: 1
Image 0 Status: none
Image 1 Status: invalid

tftp -> 2 upgrade firmware
tftp -> 7 upgrade mtkfirmware

in U-boot tftp
key -> 0
help -> list of commands

bootnum - MSTC write bootnum into persist ( 0 or 1 )

  1. Startup system (Default)
     2. Upgrade firmware
     3. Upgrade bootloader
     4. Upgrade bootloader (advanced mode)
     5. Load image
     6. Upgrade mtkfirmware
     0. U-Boot console


  Press UP/DOWN to move, ENTER to select
=> help
?       - alias for 'help'
base    - print or set address offset
bdinfo  - print Board Info structure
boot    - boot default, i.e., run 'bootcmd'
bootd   - boot default, i.e., run 'bootcmd'
bootm   - boot application image from memory
bootmenu- ANSI terminal bootmenu
bootnum - MSTC write bootnum into persist

bootp   - boot image via network using BOOTP/TFTP protocol
chpart  - change active partition
cmp     - memory compare
coninfo - print console devices and information
cp      - memory copy
crc32   - checksum calculation
echo    - echo args to console
editenv - edit environment variable
env     - environment handling commands
fdt     - flattened device tree utility commands
go      - start application at address 'addr'
gpio    - query and control gpio pins
help    - print command description/usage
iminfo  - print header information for application image
itest   - return true/false on integer compare
loadb   - load binary file over serial line (kermit mode)
loads   - load S-Record file over serial line
loadx   - load binary file over serial line (xmodem mode)
loady   - load binary file over serial line (ymodem mode)
loop    - infinite loop on address range
md      - memory display
mm      - memory modify (auto-incrementing address)
mstc_bootnum- MSTC DUAL image boot and check bootnum

mstc_img_chk- MSTC DUAL image boot and check image

mtdparts- define flash/nand partitions
mtkautoboot- Display MediaTek bootmenu
mtkboardboot- Boot MT7621 firmware
mtkload - MTK image loading utility
mtkupgrade- MTK firmware/bootloader upgrading utility
mw      - memory write (fill)
nand    - NAND sub-system
nboot   - boot from NAND device
nm      - memory modify (constant address)
printenv- print environment variables
reset   - Perform RESET of the CPU
run     - run commands in an environment variable
saveenv - save environment variables to persistent storage
setenv  - set environment variables
setexpr - set environment variable as the result of eval expression
sleep   - delay execution for some time
source  - run script from memory
tftpboot- boot image via network using TFTP protocol
version - print monitor, compiler and linker version
=>



Nothing special
You are running a command that doesn't make sense because there is no Image 0 because this router doesn't have slots.

I'm not going to upgrade the firmware throught the U-Boot, I don't know how it will behave.
You are the one that likes playing with fire upgrading bootloaders