Further advice on updating Zyxel GS1900-8HP v2 to Openwrt 24.10.0

Hi there, I’m looking into updating my Zyxel GS1900-8HP v2 to Openwrt 24.10.0. I’ve noted the update notes of “Users of Zyxel GS1900 series switches running OpenWrt 23.05 or earlier have to perform a new factory install with the initramfs image due to a changed partition layout.”
Reviewing various bits of info, it appears the steps I’m going to have to go through are:

  1. Revert to the factory/stock firmware, of which there should be a backup version still on bootpartition 1 – instructions shown at https://openwrt.org/toh/zyxel/gs1900-8hp_v1#return_to_factorystock_firmware
  2. Then use either the OEM easy installation or TFTP options which are included further up that same page and start by flashing the new 24.10.0 intramfs image to the correct partition
  3. Boot into the new Openwrt intramfs environment and then sysupgrade using a new 24.10.0 sysupgrade image. Q. will this mean that there will no longer be a stock image saved on a backup partition because the partitions are merged, and so will that mean that the device can no longer be reverted so easily?

I’ve not used serial port access on that Zyxel switch (or on anything else in about 20yrs really) so just want to check a few extra things.

  1. Reading the device wiki - https://openwrt.org/toh/zyxel/gs1900-8hp_v1 - have I got the right idea about where the connectors are:

  2. If I want to connect to that serial from a Windows 11 machine would the following cable be appropriate - https://www.amazon.co.uk/dp/B0CZHVRX2W - or does anyone have a better suggestion of device to use?

  3. And from reviewing the image below have I got my cable order correct?

How I think I'll need to connect the cables:

  • VCC (top) – Red pin
  • SOUT – Green pin (TXD right?)
  • SIN – White pin (RXD right?)
  • GND (bottom) – Black pin

Thank you to anyone who's good enough to help me out.

Happy :slight_smile:

Extra images included below in case they assist anyone else who's as easily confused as me:

1 Like

About that cable, that is a 5V TTL cable. In most cases a 3.3V is needed. The wiki doesn't tell which is the case here, but if you have a multimeter you can measure between GND and VCC. If that is 5V, you need a 5V cable.
Note: You should not connect the VCC, only GND, RX and TX.

I'd expect SOUT to be TXD, which means you connect the RXD from the cable. (The switch transmits, the cable receives). But nothing breaks if you connect it wrongly. You just won't see any data.

Correct.

Legend, thank you for the response

To confirm, the VCC connection isn't required? Is that because the unit is already powered through its own power supply, and the VCC is just there if you want to power the board via the serial cable? If that's the case would I be better off getting a 3.3v cable that is compatible with most devices in the unlikely event that I need to plug in the VCC.

All understood re the other connections, I'll go ahead and see how I get on. The website is slow at the moment (victim of its own success) but I guess I just use something like putty and use whatever baud rates/other settings that are mentioned on the toh wiki page for that device?

Thank you again.
Happy

Correct.

I don't think the board can be powered through that VCC. AFAIK the VCC is used by some Serial cables as reference voltage, or as power supply. I have a multivoltage cable here, which can use VCC to switch to the right mode. And of course all USB-TTL cable are already powered from USB.

I upgraded a GS1900-8.......I didn't revert to the OEM stock firmware in bootpartition 0, I just flashed the intramfs image, rebooted then flashed the sysupgrade image without keeping any settings then manually reconfigured the switch.

Good question boot partition 1 though not sure if the OEM firmware is still there although "fw_printsys" says it's still there

2 Likes

Did the same on my two GS1900-10HP. There is no need to revert to OEM firmware. You just have to boot into an updated initramfs before sysupgrading. And the easiest way to do that is by flashing the initramfs

2 Likes

Ah cool, I've ordered a "Waveshare FT232 USB-C to UART Module, USB to TTL (UART), Supports 3.3V/5V Logic Level, Compatible with Mac OS/Linux/Android/WinCE/Windows 7/8/8.1/10/11" for next to nothing anyway so I guess I can use that to get me into the backup partition if I soft brick it along the way. Thanks all x

That's a good option to have anyway. In particular for these switches which come with the console header installed

1 Like

The gs1900 series requires 3.3V, 5V would damage it.

1 Like

So, I followed the advice on here, uploaded the 24.10 intramfs image without reverting to the OEM partition (so just using the Luci >> System >> Backup / Flash Image page, and selecting the force sysupgrade option). I changed my local IP address manually to be on the 192.168.1 subnet, and was able to access the Zyxel switch at 192.168.1.1. Then I flashed my own 24.10.0 sysupgrade (including a selection of packages and some etc/config files) and the switch came up a beauty. It's running a few VLANs and seems to be solid for now. In case it's of interest I've copied below the comparison of partition sizes.

Pre upgrade (on 23.05.5 that I'd faffed around with on various occassions)

root@OpenWrt:~# df -hT
Filesystem           Type            Size      Used Available Use% Mounted on
/dev/root            squashfs        2.8M      2.8M         0 100% /rom
tmpfs                tmpfs          59.5M    928.0K     58.6M   2% /tmp
/dev/mtdblock8       jffs2         960.0K    388.0K    572.0K  40% /overlay
overlayfs:/overlay   overlay       960.0K    388.0K    572.0K  40% /
tmpfs                tmpfs         512.0K         0    512.0K   0% /dev

Post upgrade:

root@OpenWrt:~# df -hT
Filesystem           Type            Size      Used Available Use% Mounted on
/dev/root            squashfs        2.5M      2.5M         0 100% /rom
tmpfs                tmpfs          59.1M      1.2M     57.9M   2% /tmp
tmpfs                tmpfs          59.1M     48.0K     59.0M   0% /tmp/root
tmpfs                tmpfs         512.0K         0    512.0K   0% /dev
/dev/mtdblock8       jffs2           7.6M    352.0K      7.3M   5% /overlay
overlayfs:/overlay   overlay         7.6M    352.0K      7.3M   5% /
root@OpenWrt:~# fw_printsys
resetdefault=0
mac_start=E4:##:##:##:##:##
mac_end=E4:##:##:##:##:##
sn=S###############
dualfname0=initramfs-kernel.bin

In case anyone is on their own learning journey, copied below are the commands I used on my wsl instance running the local image builder to create my own image for this device:

# Install the zstd tool which allows the new package format to be unpacked
sudo apt-get install zstd
unzstd openwrt-imagebuilder-*.tar.xz.zst
tar -x -f openwrt-imagebuilder-*.tar.xz


cd openwrt-imagebuilder-*

# create the files directories to hold the settings files I wanted to copy over to my own sysupgrade image
mkdir -p files/etc/config
mkdir files/etc/crontabs
mkdir files/etc/dropbear

# Use SCP to copy the specific config files I wanted to copy across. 
## NB. I had to run "opkg update && opkg install openssh-sftp-server on the router before the commands below would work

scp root@[IP ADDRESS of switch - eg. 192.168.1.1]:/etc/config/dhcp files/etc/config/
scp root@192.168.1.1:/etc/config/dropbear files/etc/config/
scp root@192.168.1.1:/etc/config/firewall files/etc/config/
scp root@192.168.1.1:/etc/config/luci files/etc/config/
scp root@192.168.1.1:/etc/config/network files/etc/config/
scp root@192.168.1.1:/etc/config/uhttpd files/etc/config/
scp root@192.168.1.1:/etc/uhttpd* files/etc/
scp root@192.168.1.1:/etc/crontabs/* files/etc/crontabs/
scp root@192.168.1.1:/etc/dropbear/* files/etc/dropbear/
scp root@192.168.1.1:/etc/passwd files/etc/
scp root@192.168.1.1:/etc/shadow files/etc/

# then the command below built my image for me
# -j10 below I think gets wsl to use more cores?
# NB. I removed the mbedtls library and installed the wolfssl library instead because I'm running wolfssl on all my other routers. The reason for this is it appears I get better wireless overall with wolfssl

make image -j10 \
PROFILE="zyxel_gs1900-8hp-v2" \
PACKAGES="-libustream-mbedtls base-files ca-bundle dropbear ethtool firewall4 fstools kmod-gpio-button-hotplug libc libgcc libustream-wolfssl logd mtd netifd odhcp6c opkg procd-ujail uboot-envtools uci uclient-fetch urandom-seed urngd luci" \
FILES="files" \
DISABLED_SERVICES="dnsmasq firewall odhcpd"

One last question - because I'm not running the firewall from this device would there be any concerns about adding -firewall4 to my packages list to save even more space on the image?

Thanks to all who replied, and again thanks to the devs/testers/contributors :slight_smile:

1 Like

If I recall the reason firewall4 is still installed is that it is a dependency of some other package that is required.

1 Like

@happydashery @bmork Would you mind checking your log file for errors after re-boot please? I've got a few errors but I'm pretty sure they were there on the previous version too. Everything seems to be working ok.

Wed Feb 12 14:45:46 2025 kern.err kernel: [    0.839270] OF: Bad cell count for /soc/spi@1200/flash@0/partitions
Wed Feb 12 14:45:46 2025 kern.err kernel: [    0.846457] OF: Bad cell count for /soc/spi@1200/flash@0/partitions

Wed Feb 12 14:45:46 2025 kern.err kernel: [   10.081400] rtl83xx_fib_event_work_do: FIB4 default rule failed
Wed Feb 12 14:45:46 2025 kern.err kernel: [   10.088322] rtl83xx_fib_event_work_do: FIB4 default rule failed

Wed Feb 12 14:45:46 2025 kern.err kernel: [   23.215747] rtl83xx_fib4_del: no such gateway: 0.0.0.0
Wed Feb 12 14:45:46 2025 kern.err kernel: [   23.221574] rtl83xx_fib4_del: no such gateway: 0.0.0.0
Wed Feb 12 14:45:46 2025 kern.err kernel: [   23.227633] rtl83xx_fib4_del: no such gateway: 0.0.0.0

I can confirm that I have those messages as well. And many more :slight_smile:

The DSA driver is so noisy that I've just assumed those messages are debugging noise. I had to silence a few other messages just to get a usable console. But there are plenty more left.

Don't know about the cell count message. It looks like some data is missing or wrong in the DTS. Haven't noticed any resulting problems, but that doesn't prove anything of course.

EDIT: FWIW, I get the same error message on unrelated devices and targets like the MT7621 based U6 Lite:

root@u6-1:~#  dmesg|grep cell
[    1.475820] OF: Bad cell count for /palmbus@1e000000/spi@b00/flash@0/partitions
[    1.483159] OF: Bad cell count for /palmbus@1e000000/spi@b00/flash@0/partitions
[    1.515413] OF: Bad cell count for /palmbus@1e000000/spi@b00/flash@0/partitions
[    1.529412] OF: Bad cell count for /palmbus@1e000000/spi@b00/flash@0/partitions

So nothing to worry about in the realtek target context.

2 Likes

I'm pretty sure I've seen the bad cell count ones but not sure about the rest. I'll take a look when I get a chance (might not be till Wednesday) and will let you know. I've noted @bmork reply and I've also got a unified U6 LR and a couple of other devices so will check those as well.

Could be wrong...

But I suspect it's related to the nvmem patches exporting and using of_device_make_bus_id(), which calls of_translate_address(). This might end up printing that error message and return OF_BAD_ADDR, which is handled just fine by the caller.

I.e., the message level is wrong for the current usage. It's a debug message at best

1 Like

Ok thanks.

Can I do the following?
Take a backup on OpenWrt 23.05.5
Flash the 24.10 intramfs through the openwrt upgrade then sysupgrade
load a backup and restore the config

I'm pretty sure that would work but not tested it myself. The only potential issue that might arise is one of the other config files that gets backed up being incompatible with the switch from 23.05 to 24.10. Thinking out loud I wonder if fstab is included and if that might cause problems?

Looks like it worked but I am pretty sure i am missing a bunch of vlan interfaces and bridge devices though on the GUI side, on the CLI side everything is configured the same.