Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
Next revisionBoth sides next revision
toh:zyxel:p2812hnu-f1 [2020/04/15 15:06] – [Replacement of factory U-Boot] correct link for tftpd settings mafketeltoh:zyxel:p-2812hnu-f1 [2022/10/04 13:35] – [Installing OpenWrt] minor fixes linus
Line 5: Line 5:
 {{media:zyxel:p2812:p-2812hnu-f1_general_view.gif?200|P-2812HNU-F1}} {{media:zyxel:p2812:p-2812hnu-f1_general_view.gif?200|P-2812HNU-F1}}
 ===== OpenWrt Status ===== ===== OpenWrt Status =====
-[[https://forum.openwrt.org/search.php?action=show_user_posts&user_id=21206]|scapi]] has F1 to test and seems to work. Wifi at higher loads is not 100% stable with 17 or 18, Original zyxel firmware is more stable on the same hardware.+[[https://forum.openwrt.org/search.php?action=show_user_posts&user_id=21206]|scapi]] has F1 to test and seems to work. Wifi at higher loads is not 100% stable with v17 or v18, Original zyxel firmware is more stable on the same hardware.
  
-Current snapshots and 19 and above are a BIG improvement and work fine. +Current snapshots and v19 and above are a BIG improvement and work fine. 
  
 ===== Supported Versions ===== ===== Supported Versions =====
Line 36: Line 36:
 -> [[docs:guide-user:installation:generic.flashing|Install OpenWrt (generic explanation)]] -> [[docs:guide-user:installation:generic.flashing|Install OpenWrt (generic explanation)]]
  
-Due to some issues of the initramfs there is a bit of a workaround needed for 19 and above releases.+**Due to some issues of the initramfs there is a bit of a workaround needed for v19 and above releases.**
  
-Up to and including 18 the kernel image is smaller then 2 mb and will fit in the reserved space of the older working initramfs image.+Up to and including v18 the kernel image is smaller than 2MB and will fit in the reserved space of the older working initramfs image.
  
-However 19 and above + snapshots are larger and need an adjustment in the reserved space for the kernel. +However (some) v19 and above + snapshots can be larger and need an adjustment in the reserved space for the kernel. 
  
-In able to install this larger reservation you need a kernel that is smaller then 2mb ;) see the catch 22 here ;) in order to solve this issue I had compiled a very barebone image a while ago which has a smaller kernel and this will fit into the 2mb reserved space. Use this file to update your modem first before updating to snapshot or 19 and above.+To install this larger reservation you need a kernel that is smaller then 2MB ;) see the catch 22 here ;) in order to solve this issue I had compiled a very barebone image a while ago which has a smaller kernel and this will fit into the 2MB reserved space. Use this file to update your modem first before updating to snapshot or v19 and above.
  
 https://github.com/Mafketel/p2812hnu-f1-files/blob/master/openwrt-lantiq-xrx200-zyxel_p-2812hnu-f1-squashfs-sysupgrade.bin https://github.com/Mafketel/p2812hnu-f1-files/blob/master/openwrt-lantiq-xrx200-zyxel_p-2812hnu-f1-squashfs-sysupgrade.bin
  
-After you installed this one going back to 18 or below needs a full from scratch install(uart and all) as the start of the root fs has moved 1 mb and you will get a kernel panic.+After you installed this one going back to v18 or below needs a full from scratch install (UART and all) as the start of the root fs has moved 1MB and you will get a kernel panic. 
 + 
 +(DGDodo, Testing upgrade to v21.02.0 from v19.07.7 without TTL-serial, with [[:docs:techref:bootloader:uboot.config#accessing_u-boot_environment_variables_in_openwrt]] and only adjust nboot parameters just before flashing, no mtd-adjustments. My v19.07.7 -kernel- builds still fit in 2MB, v21.02.0 gets bigger. I've seen flashed devices with v21.02.0 crashing, but will boot ok after __only__ adjusting nboot paramter. An howto I've made is on http://dolfgeerdink.nl/phpbb/viewtopic.php?p=341#p341) 
 +(Mafketel, obviously it will fit from V19 as it has already an adjusted mtd size ;) ) 
 ==== Replacement of factory U-Boot ==== ==== Replacement of factory U-Boot ====
 The Out of the Box bootloader does not allow to load openwrt, so you have to replace the bootloader first. The Out of the Box bootloader does not allow to load openwrt, so you have to replace the bootloader first.
Line 52: Line 55:
  
 You need the following files: You need the following files:
-  - [[https://github.com/ScApi/P2812HNUFx-Pre-Build/blob/OpenWrt-Chaos-Calmer-r45578/F1%20OpenWRT/uboot-lantiq-p2812hnufx_ram/openwrt-lantiq-p2812hnufx_ram-u-boot.asc|openwrt-lantiq-p2812hnufx_ram-u-boot.asc]]   Right click the 'raw' button, and do 'save as'.+  - [[https://downloads.openwrt.org/releases/22.03.0/targets/lantiq/xrx200/u-boot-p2812hnufx_ram/u-boot.asc|u-boot.asc]] Right click the 'raw' button, and do 'save as'.
   - [[https://github.com/ScApi/P2812HNUFx-Pre-Build/blob/OpenWrt-Chaos-Calmer-r45578/F1%20OpenWRT/uboot-lantiq-p2812hnufx_nandtpl/openwrt-lantiq-p2812hnufx_nandtpl-u-boot.img|openwrt-lantiq-p2812hnufx_nandtpl-u-boot.img]]   - [[https://github.com/ScApi/P2812HNUFx-Pre-Build/blob/OpenWrt-Chaos-Calmer-r45578/F1%20OpenWRT/uboot-lantiq-p2812hnufx_nandtpl/openwrt-lantiq-p2812hnufx_nandtpl-u-boot.img|openwrt-lantiq-p2812hnufx_nandtpl-u-boot.img]]
  
Line 58: Line 61:
 and [[https://github.com/ScApi/P2812HNUFx-Pre-Build/blob/OpenWrt-Chaos-Calmer-r45578/F1%20OpenWRT/calibration%20data/RT3062.eeprom|wifi calibration data]] (RT3062.eeprom) as well. and [[https://github.com/ScApi/P2812HNUFx-Pre-Build/blob/OpenWrt-Chaos-Calmer-r45578/F1%20OpenWRT/calibration%20data/RT3062.eeprom|wifi calibration data]] (RT3062.eeprom) as well.
  
-Power of board.+Power off the board.
  
-Short the (R17) bootsel_1 and power on the router. +Short the (R17) bootsel_1 and power on the router. The usual method is to use a small flat screwdriver to short this while powering on the router.
  
 When CFG 02 UART Popups in terminal You can disconnect/revert bootsel pin to normal or you can wait till the end of process. When CFG 02 UART Popups in terminal You can disconnect/revert bootsel pin to normal or you can wait till the end of process.
Line 69: Line 72:
 </file> </file>
  
 +Upload the U-Boot RAM image ([[https://downloads.openwrt.org/releases/22.03.0/targets/lantiq/xrx200/u-boot-p2812hnufx_ram/u-boot.asc|u-boot.asc]]) using a
 + [[docs:techref:hardware:port.serial.cables|serial cable]] (baud 115200)
 +
 +  * If you used cutecom for Linux, issue „Send File”
 +  * If you're using Minicom, you can suspend or quite minicom after seeing the message above, then issue the upload from the command line: ''ascii-xfr -s -n -v u-boot.asc > /dev/ttyUSB0'', then return or restart Minicom.
 +
 +This will take a minute or so.
 +
 +On windows there are some more caveats, you can try terraterm first, if it does not work, which is indicated by * signs appearing on the prompt try to set a transmit delay of 1 msec/char. If that makes the upload excruciatingly slow try realterm with the same settings. It still won't be fast but cuts the waiting game from multiple hours to about 20 minutes. 
  
-Upload U-Boot RAM image ([[https://github.com/ScApi/P2812HNUFx-Pre-Build/blob/OpenWrt-Chaos-Calmer-r45578/F1%20OpenWRT/uboot-lantiq-p2812hnufx_ram/openwrt-lantiq-p2812hnufx_ram-u-boot.asc|openwrt-lantiq-p2812hnufx_ram-u-boot.asc]]) using a +After uploading the ''u-boot.asc'' filewait for U-Boot to load and stop auto-boot process.
- [[docs:techref:hardware:port.serial.cables|serial cable]] (baud 115200) via „Send File”cutecom for linux. This will take a minute or so. On windows there are some more caveats, you can try terraterm first, if it does not work, which is indicated by * signs appearing on the prompt try to set a transmit delay of 1 msec/char. If that makes the upload excruciatingly slow try realterm with the same settings. It still won't be fast but cuts the waiting game from multiple hours to about 20 minutes.  +
-Wait for U-Boot to load and stop auto-boot process.+
  
 <file> <file>
Line 102: Line 112:
  
 Then: Then:
-PRE STEP 1 Make a backup of your NAND ! (optionally)+PRE STEP 1 Make a backup of your NAND ! (optionally and only works with more recent asc files so for instance this one [[https://downloads.openwrt.org/releases/19.07.2/targets/lantiq/xrx200/u-boot-p2812hnufx_ram/u-boot.asc|u-boot.asc]]) (Mafketel, to be able to restore it to the modem you might need the crc data as well, no tutorial for that yet)
  
  
Line 165: Line 175:
 Bytes transferred = 231813 (38985 hex) Bytes transferred = 231813 (38985 hex)
 </file> </file>
 +
 +If tftp is not working for you, you can also upload the u-boot image over the serial port using ''loady'' and then send the file using zmodem, e.g. in Minicom Ctrl+A followed by S, then select zmodem and the u-boot.img file.
  
 **Step 5**: Type in console **Step 5**: Type in console
Line 218: Line 230:
 mtdparts add nand0 - ubi mtdparts add nand0 - ubi
 setenv ethaddr XX:XX:XX:XX:XX:XX setenv ethaddr XX:XX:XX:XX:XX:XX
-setenv nboot 'nand read 0x80800000 0x60000 0x300000; bootm 0x80800000'+setenv nboot 'nand read 0x81000000 0x60000 0x300000; bootm 0x81000000'
 setenv bootcmd 'run nboot' setenv bootcmd 'run nboot'
 saveenv saveenv
Line 232: Line 244:
 Continue further below Continue further below
 ==== Installing OpenWrt ==== ==== Installing OpenWrt ====
-At the present timethe recent openwrt releases do not include the proper initramfs image. A working version is available at ScApi 's github, see aboveAt the end we will upgrade to the latest openwrt version.+To install OpenWrt into the NAND flashyou first have to boot an initramfs image. This is a version of the OpenWrt (with linux kernel and root filesystem) that executes only from RAMYou will use this to flash the resident version of OpenWrt into the NAND flash.
  
-NOTES: Future upgrades can be done by flashing *sysupgrade.bin from web interface.+At the present time, the recent OpenWrt releases do not include a working initramfs image. Normally this would be the files named ''zyxel_p-2812hnu-f1-initramfs-kernel.bin'' but these files in the release folders are broken. A working version is available at ScApi 's github, see above. At the end we will upgrade to the latest openwrt version. 
 + 
 +NOTES: After flashing the NAND from the initramfs, future upgrades can be done by flashing ''zyxel_p-2812hnu-f1-squashfs-sysupgrade.bin'' from each release through the web interface.
  
 **Step 1**: Place [[https://github.com/ScApi/P2812HNUFx-Pre-Build/blob/OpenWrt-Chaos-Calmer-r45578/F1%20OpenWRT/openwrt-lantiq-xrx200-P2812HNUF1-uImage-initramfs|openwrt-lantiq-xrx200-P2812HNUF1-uImage-initramfs]] in your tftp folder **Step 1**: Place [[https://github.com/ScApi/P2812HNUFx-Pre-Build/blob/OpenWrt-Chaos-Calmer-r45578/F1%20OpenWRT/openwrt-lantiq-xrx200-P2812HNUF1-uImage-initramfs|openwrt-lantiq-xrx200-P2812HNUF1-uImage-initramfs]] in your tftp folder
  
-**Step 2**: Set Your IP addres to "192.168.1.2" and start tftp server. See also above for instructions.+**Step 2**: Set Your IP address to "192.168.1.2" and start tftp server. See also above for instructions
 + 
 +**Step 3**: Upload the initramfs image.
  
-**Step 3**: Upload initramfs image 
  tftpboot openwrt-lantiq-xrx200-P2812HNUF1-uImage-initramfs  tftpboot openwrt-lantiq-xrx200-P2812HNUF1-uImage-initramfs
 <file> <file>
Line 262: Line 277:
 </file> </file>
  
 +If tftp is not working for you, you can also upload the initramfs image over the serial port using ''loady'' and then send the file using zmodem, e.g. in Minicom Ctrl+A followed by S, then select zmodem and the ''openwrt-lantiq-xrx200-P2812HNUF1-uImage-initramfs'' file. The file is a few megabytes so this will take some time.
  
-**Step 4**: Run initramfs image and wait till fully booted and press Enter to activate the console+**Step 4**: Run the initramfs image and wait till fully booted and press Enter to activate the console
  bootm $fileaddr  bootm $fileaddr
  
Line 295: Line 311:
 </file> </file>
  
 +**Step 5**: Obtain and flash flash this image **first**:
  
-**Step 5**set root passwd.+  [[https://github.com/Mafketel/p2812hnu-f1-files/blob/master/openwrt-lantiq-xrx200-zyxel_p-2812hnu-f1-squashfs-sysupgrade.bin|openwrt-lantiq-xrx200-zyxel_p-2812hnu-f1-squashfs-sysupgrade.bin]]
  
- passwd  root -d yoursecretpassword +If you use a newer image there will be erase block errors when writing the image.
-**Step 6**: Log into the modem on the web interface and go to System flash firmware and flash up to and including 18 release, if you want to install snapshots or 19 and above you need to increase the space reserved for the kernel. You do this by installing this image first https://github.com/Mafketel/p2812hnu-f1-files/blob/master/openwrt-lantiq-xrx200-zyxel_p-2812hnu-f1-squashfs-sysupgrade.bin and then go back into the web interface and flash the one you want.+
  
-This assumes that your are able to enter the webinterface, if this does not work. you can continue in the serial console this way. +Log into the modem on the web interface and go to System flash firmware.
-If not use Linux scp or [[https://winscp.net/eng/download.php|WinSCP]] to upload [[http://downloads.openwrt.org/releases/18.06.2/targets/lantiq/xrx200/openwrt-18.06.2-lantiq-xrx200-zyxel_p-2812hnu-f1-squashfs-sysupgrade.bin|openwrt-18.06.2-lantiq-xrx200-zyxel_p-2812hnu-f1-squashfs-sysupgrade.bin]] to /tmp.+
  
-         sysupgrade -n /tmp/openwrt-18.06.2-lantiq-xrx200-zyxel_p-2812hnu-f1-squashfs-sysupgrade.bin+This assumes that your are able to enter the webinterface, if this does not work, you can use the serial console: upload ''openwrt-lantiq-xrx200-zyxel_p-2812hnu-f1-squashfs-sysupgrade.bin'' to /tmp using ''scp'' or ''wget''':
  
-**Step 7**: the router Reboots itself+         cd /tmp 
 +         scp user@192.168.1.N:openwrt-lantiq-xrx200-zyxel_p-2812hnu-f1-squashfs-sysupgrade.bin 
 +         sysupgrade -n openwrt-lantiq-xrx200-zyxel_p-2812hnu-f1-squashfs-sysupgrade.bin 
 + 
 +Since the Dropbear SSH version in the initramfs is quite old, this can lead to problems because new SSH servers will not accept the algorithms it supports. 
 + 
 +Alternatively (if you have a web server on your 192.168.1.N machine): 
 + 
 +         cd /tmp 
 +         wget http://192.168.1.N/openwrt-lantiq-xrx200-zyxel_p-2812hnu-f1-squashfs-sysupgrade.bin 
 +         sysupgrade -n openwrt-lantiq-xrx200-zyxel_p-2812hnu-f1-squashfs-sysupgrade.bin 
 + 
 +You probably need a local web server that can use plain HTTP on port 80 because the initramfs image cannot handle SSL. 
 + 
 +**Step 6**: the router Reboots itself
  
 <file> <file>
Line 405: Line 434:
 -------------------------------------------------- --------------------------------------------------
 </file> </file>
 +
 +**Step 7**: upgrade to the latest working release of OpenWrt
 +
 +The last known working version of OpenWrt for this router is the 21.02.3 release:
 +
 +  * [[https://downloads.openwrt.org/releases/21.02.3/targets/lantiq/xrx200/openwrt-21.02.3-lantiq-xrx200-zyxel_p-2812hnu-f1-squashfs-sysupgrade.bin|openwrt-21.02.3-lantiq-xrx200-zyxel_p-2812hnu-f1-squashfs-sysupgrade.bin]]
 +
 +The 22.03.0 version will brick the router and you have to reinstall from initramfs. (Back to **step 3**...)
  
 ==== WIFI on openwrt ==== ==== WIFI on openwrt ====
Line 413: Line 450:
 <code>rt2800pci 0000:00:0e.0: Direct firmware load for RT3062.eeprom failed with error -2</code> <code>rt2800pci 0000:00:0e.0: Direct firmware load for RT3062.eeprom failed with error -2</code>
  
-This file can also be found in your firmware backup at etc/wireless/rt2860ap folder and called RT3062_PCI_LNA_2T2R_V1_0.bin+This file can also be found in your ZyXEL OEM-firmware backup at etc/wireless/rt2860ap folder and called RT3062_PCI_LNA_2T2R_V1_0.bin 
 + 
 +OpenWrt v21.02.0 does __not__ scan PCI-bus (correctly) during boot and it looks like wifi won't work at all the first time? 
 +A workaround is to add the following line to file //rc.local// just before 'exit 0' (via //System / Startup / Local Startup// in web-GUI): 
 + 
 +<code>echo 1 > /sys/bus/pci/rescan</code> 
 + 
 +And reboot the device. Now the PCI-bus will be scanned (later) and wifi will become ready / usable. 
 ==== DSL ==== ==== DSL ====
 You may need to adapt the network settings to connect to your internet provider. You may need to adapt the network settings to connect to your internet provider.
  • Last modified: 2024/12/08 19:19
  • by idwv