Installing and Configuring ZyXEL WSM20

Considering the multiple topics regarding installation and configuration of ZyXEL WSM20 that have popped in the past few weeks, and with the idea of keeping "clean" the development topic for further aspects we are currently discussing, I would like to open this specific thread for those who are willing to ask for your issues while installing and/or configuring your ZyXEL WSM20 from scratch

Currently, we have the Wiki section with some simple instructions

Moreover, there is this article in Swedish can be easily translated.

Please don't hesitate to ask here any issues you have before or after you install the firmware following the previous method.

Frequently Asked Questions:

Is LuCI included in the firmware?

If you use any snapshot firmware (you will see the word snapshot in the URL where you download it), then it will not come with LuCI by default, you will need to access the router via SSH and then configure the network and install LuCI via opkg.

If you happen to install a Release Candidate (you will see the word RC in the file), or we are in the future where there is a final release of the OpenWrt firmware, (you won't see the snapshot word in the URL where you download the firmware file), then it will come with LuCI by default.

You can also create an snapshot image including LuCI with the firmware selector tool

I have flashed the firmware, how can I access now the device?

If you did install LuCI following the previous question (via firmware selector tool), then you can simply access now the web interface through http://192.168.1.1

If you didn't, you will need to access via SSH. First configure your PC network adapter to the 192.168.1.0/24 network and plug your PC to one of the LAN ports of the WSM20. Then you can log in to the router at the 192.168.1.1 (default port 22) with SSH.

Have you tried configuring your PC networkd adapter to the 192.168.1.0/24 network and plugin your PC to one of the LAN ports of WSM20? You will find it at 192.168.1.1 with SSH.

Why have you plugged into the WAN port? The WAN port is for the outside world and should not be exposing SSH/LUCI. You need to be plugged into a LAN port so that you can access the admin interfaces.

For a new/inexperienced user I’d recommend leaving the network configuration setup on the PC to DHCP. The router’s DHCP server will be enabled by default on the LAN ports and it leaves fewer mistakes for users to make.

1 Like

solved - was as you suggested - thanks

Thank you @SirLouen, I will post my questions here from now on.

I have 2 questions:

a) I have set up a wifi network by enabling "Isolate Clients". My understanding is that this option will avoid 2 devices connected to the same SSID to see each other, but if I create another SSID, devices from different SSIDs will see each other, unless I make the firewall prevent that. If I follow the procedure for the Guest Wifi https://openwrt.org/docs/guide-user/network/wifi/guestwifi/configuration_webinterface#guest_wi-fi_using_luci , the devices from the 2 SSIDs will not see each other. Is that correct? Is that the easiest way to achieve the target?

  1. the WSM20 has 2 physical buttons. Is it possible to program them to turn on or off the router? I understand that the possibilities of the buttons depend on hardware, but not knowing what is inside the WSM20 ...

Thank you in advance

1 Like
  1. Yes that is an option

  2. This is very complex

Check the three buttons that have been binded to this router (not two, the big one is also a button)

keys {
		compatible = "gpio-keys";

		led {
			label = "led";
			gpios = <&gpio 16 GPIO_ACTIVE_LOW>;
			linux,code = <BTN_0>;
		};

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

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

There is a rule in OpenWrt, to leave buttons untouched so people could config them to their pleasure

Here there is a little guide on how, by using the button codes led (the big one), reset & wps, you can map whatever you need to them

You only need to use the command poweroff or halt

Example

uci add system button
uci set system.@button[-1].button="led"
uci set system.@button[-1].action="pressed"
uci set system.@button[-1].handler="poweroff"
uci commit system

Remember to install kmod-button-hotplug but I would read the whole guide

1 Like

Thank you @SirLouen for your reply

  1. Is that the easiest way for a newbie? If yes, I will follow that guide (which I like it since I can use Luci :slight_smile: )

  2. I thought that the reset button would not count ... I mean, that is better to keep it as reset button, and focus on the WPS or LED buttons ... Or perhaps you asked me to check the 3 of them because OpenWRT does not use it as reset button unless it is mapped for that

OK, I will check as you suggested. Thank you for the answer and the link

I can turn off the system light by running "echo 0 > /sys/class/leds/white:system/brightness".
However, I was unable to control the big button:

opkg install kmod-button-hotplug
uci add system button
uci set system.@button[-1].button="led"
uci set system.@button[-1].action="pressed"
uci set system.@button[-1].handler="echo 1 > /sys/class/leds/white:system/brightness"
uci add system button
uci set system.@button[-1].button="led"
uci set system.@button[-1].action="released"
uci set system.@button[-1].handler="echo 0 > /sys/class/leds/white:system/brightness"
uci commit system

Did I miss anything?

I'm not even sure if the button is correctly binded in the DTS. Have you tried the same, but with any of the two other buttons?

Same issue with the wps button.

Hi @passy05

Does it mean that the big rear button or the front WPS button can only used to control the led, and nothing more? So, no hope to turn the unit on/off?

Thank you in advance

Last time I checked, all buttons were working fine. I will try it on my spare device these days.

1 Like

Hi @SirLouen

What would be the other options?
I am asking just to understand if they would be easir than following the procedure in https://openwrt.org/docs/guide-user/network/wifi/guestwifi/configuration_webinterface#guest_wi-fi_using_luci . I am afraid that trying to create VLANs would be more complex for me...

I have an additional question regarding the configuration of the WSM20: is it possible to configure it as a wireless bridge by following this guide: https://openwrt.org/docs/guide-user/network/wifi/connect_client_wifi#connect_to_client_wi-fi_network ? Or, is it too early, I should wait for a released version of OpenWRT before proceeeding?

Thank you in advance

All "standard" OpenWrt features are working as well as for other devices, the WSM20 is just an additional DTS and the logic to generate the image - no device-specific code has been developed.

So I checked the button handling:

Yes. You need to add the button handling script to /etc/hotplug.d/button/00-button as described here. Also, the name of the button is "lights_toggle" and not "led". This works for me in /etc/config/system:

config button
	option button 'lights_toggle'
	option action 'pressed'
	option handler 'logger "LED pressed"'

config button
	option button 'lights_toggle'
	option action 'released'
	option handler 'logger "LED released"'

How do you check the name of the button? With this little script:

cat << "EOF" > /etc/hotplug.d/button/buttons
logger "the button was ${BUTTON} and the action was ${ACTION}"
EOF

Tested on OpenWrt 23.05 RC2, fresh install without any additional packages (so you don't even ned kmod-button-hotplug.

Hi @andyboeh

Interesting. I will try as soon as I have the time.

Do you think that it could be customized to turn the unit on and off? I always have a doubt there...if the unit is on, it may be possible to tell it to switch off, but if it is off, would the unit "listen" to the button and switch on?

My purpose would be to have 2 buttons with the same function (on/off), just for convenience, depending how the unit is orientated: the big button on the rear and the WPS button on the front. Would it be an issue?

Thank you in advance

No. These devices are not designed to be turned on or off, they are designed as always-on devices. While you can "shutdown" OpenWrt, it does not cut power because the circuitry is missing. And then you have exactly the problem you just discovered: There is no circuitry to turn it back on. However, you can turn WiFi on/off and/or routing functions on/off and so on.

But fear not, there is an easy solution: Use a power strip with a switch :wink:

1 Like

Why lights_toggle I'm missing something?

Because it's mapped to the Linux Key Code "KEY_LIGHTS_TOGGLE" in line 69. And if you check the Wiki page, you can see in the table that KEY_LIGHTS_TOGGLE is mapped to the event "lights_toggle" by procd. I wasn't aware of this either and learned something new by researching the question.

Interesting, I did not know that there were default kernel codes.

Would it be possible to rebind them? For example the wps to reboot ?

Something like, after adding the button handling

uci add system button
uci set system.@button[-1].button="wps"
uci set system.@button[-1].action="pressed"
uci set system.@button[-1].handler="reboot"
uci commit system