Manual:System/Firmware Loading

From Compex Wiki
Jump to: navigation, search

Backup/Flash Firmware

Only existing CompexWRT firmware can do this.

The System ➤ Backup/Flash Firmware page lets you perform backup and restore, or flash a new firmware.

Backup/Restore

Only the same version number of CompexWRT firmware can do this.

Download backup: Generate archive: Downloads a tar archive of the current configuration files.

Note: The backup archive file should be stored in a safe place because it contains the wireless password in clear text.

Reset to defaults: Perform reset: Resets the firmware to its initial state. This is required if the 11ac radio card changed.

Note: If radio card is changed from an 11ac card to a non-11ac card, please perform a reset. This is because the configuration for the radio cards are different.

Restore backup: Upload archive: Lets you upload a previously generated backup archive to restore configuration files. Restore backup configuration only works for the same version of the firmware together with the same hardware (board + card combination).

Flash new firmware

You can upload a new firmware to replace the currently running firmware.

Keep settings: Retains the current configuration. Please see the Manual:CompexWRT Changelog to check if "Keep settings" should be unticked.

Firmware: Shows the current version of the firmware and allows you to upload a new firmware.

CompexWRT Firmware/MAC File Upgrade

This section describes three methods to upgrade the firmware in the board, using a CompexWRT firmware image.

To upgrade the board with a new MAC file, the TFTP methods described in the following section have to be used.

There are two different TFTP methods to flash the firmware or MAC file. Method 1 uses the serial cable and Method 2 does not use the serial cable.

Using the CompexWRT LuCI web page to upgrade the firmware

The easiest way to upgrade the firmware is to go to the configuration web page of the AP, then go to System > Backup / Flash Firmware > Flash new firmware.

There is an option to keep the current configuration.

If the LuCI webpage cannot be seen, press the hardware “reset” button on the board for less than 3 seconds to reboot.

If the LuCI webpage still cannot be accessed, press and hold the “reset” button for between 4 and 30 seconds to reset to factory default, which retains the current firmware version. Please access the default IP address 192.168.1.1 of the AP.

If the LuCI webpage still doesn’t show up, the TFTP methods described in the following sections have to be used.

TFTP Method 1: Using the serial cable and serial terminal

This section describes how to upgrade the firmware into the board using loader mode, even when the web page has already hanged. A serial cable with serial converter is required.

A Compex serial converter is shown in the red box here:

Compex Serial Converter.JPG

The serial converter connects to the 4 serial pins of the Compex board. The red wire is for power and should be aligned with the pin having the triangle icon on the board.

Please connect a LAN cable to the board's Ethernet port farther away from the power adapter. The other end of the LAN cable goes to the PC with the firmware .img file.

  1. Set the PC LAN port to the IP address 192.168.1.10. Setup a TFTP server on your PC. The opensource Tftpd32 program can be used. (Some firewall programs may detect Tftpd32 and disable it. Therefore, please disable your firewall.) Put the firmware "compexwrt-wpj344-xxx.img” into the same directory.
  2. When the board is just turned on, hit any key on the serial console to enter the loader mode of the board. The board becomes a TFTP client at IP address 192.168.1.1.

2015-12-18 12 38 23-80-Y1005-2 CompexWRT Firmware MAC File Upgrade v2 0 no watermark.pdf - Foxit Pha.png

3. Set the server IP in the loader mode to be the PC's IP address.

  $ setenv serverip <IP address of the PC>

4. TFTP in the firmware into the board by using the following commands

  $ cpximg compexwrt-wpj344-xxx.img

2015-12-18 12 44 37-80-Y1005-2 CompexWRT Firmware MAC File Upgrade v2 0 no watermark.pdf - Foxit Pha.png

5. Reboot the device after loading in the firmware.

  $ reset

These are commands that run in the boot loader stage.

TFTP Method 2: Without using the serial cable

This section describes how to upgrade the firmware into the board using the TFTP method,even when the web page has already hanged. A serial cable is not required.

Since there is no serial output, one would have to take note of the LEDs which indicate the progress of the firmware upgrade. The physical arrangement of LEDs on the router may differ for different models. For example, on the WPJ344 router, the LEDs starting from the one nearest the corner are: Power (green), Diagnostics (green), LED#1 (red), LED#2 (orange), LED#3 (green), and LED#4 (green).

The following applies to the WPJ342, WPJ344, WPJ531, and WPJ558.

  1. Please connect one end of a LAN cable to the Ethernet port of the AP (power off) farther away from the DC jack. Please connect the other end of the LAN cable to your PC or your network. Set the PC LAN port to the IP address 192.168.1.10. (Previously there was a problem of Gigabit Ethernet not supported by the AP. If your PC had a Gigabit Ethernet port, the AP could not be connected directly to the PC, but had to be connected to a switch which is in turn connected to the PC. This problem had been resolved for bootloader version 2014-07-03 onwards.)
  2. While holding down the “reset” button, supply power to the board. Hold the “reset” button for at least 12 seconds. The Diagnostics LED will blink about 3 times per second. Following that, the LED#4 would start to blink about 3 times per second. Now you can release the “reset” button. The board becomes a TFTP server at IP address 192.168.1.1. Enable the TFTP client feature of Windows 7/8/10.
  3. Open a DOS window / command prompt and input tftp -i 192.168.1.1 put "F:\firmware\compexwrt-wpj344-xxx.img" ("F:\firmware\compexwrt-wpj344-xxx.img" is the path of the firmware. You can directly pull it into the window.) While the firmware is being transferred from the PC to the board, both the Diagnostic LED and the LED#4 would blink about 3 times per second.
  4. Wait till you see “Transfer successful: 4719000 bytes in 26 seconds, 181500 bytes/s”, “Transfer successful: 6237776 bytes in 52 seconds, 119957 bytes/s”, or “Transfer successful: 9542684 bytes in 3 second(s), 3180894 bytes/s”. Next, wait for a about couple of minutes. The board would then erase the flash memory and after that copy the firmware to the flash memory. During this process, the Power and LED#4 will show steady green lights. The Diagnostics LED will blink intermittently. Upon completion, all LEDs will flash once. You may also hear a beep upon completion if your board has a buzzer. Only the Power LED shows a steady green light. The Diagnostics LED blinks intermittently. All other LEDs are not lighted.
  5. For newer boards with the newer boot loader, the board will reboot automatically. Please wait a couple of minutes. After the booting completes, the buzzer will beep twice quickly. Only the Power LED shows a steady green light. The Diagnostics LED blinks intermittently. Otherwise, power off the board, then supply power again after at least 12 seconds. Check if you can login to the webpage (192.168.1.1). If yes, that means you have upgraded the firmware successfully.

Troubleshooting Tip

If you see this error message:

Timeout occurred
Connect request failed

Please disable 3rd party firewall software.

Try waiting at least 12 seconds before entering the command to transfer the firmware in Step 3 above.

Disconnect all other networks, e.g. turn off wireless.

(For older boards e.g. WP546, ping to the board again. Once the ping has found a path to the board, the PC wireless can be enabled again. Your PC should still be able to ping to the board. For current and newer boards, ping is not supported in loader mode. You just have to attempt the command to transfer the file.)

You may also try setting your PC LAN port IP address to a single static IP address only e.g. 192.168.1.10.

Next, you may disable Windows firewall and try again.

Loading CompexWRT firmware into WPJ428

Firmware for example is in https://downloads.compex.com.sg

  • CompexWRT/Beta/v5.0.7-b170904-Beta/openwrt-ipq806x-wpj428-squashfs-factory.img

Boards shipped with reference firmware cannot support CompexWRT firmware.

Please follow the steps in Manual:System/Firmware_Loading#CompexWRT_Firmware/MAC_File_Upgrade.

Loading CompexWRT firmware into WPQ864/WPQ865

Firmware for example is in https://downloads.compex.com.sg

  • CompexWRT/Stable/v5.1.3-b180110/openwrt-ipq806x-wpq864-squashfs-factory.img
  • CompexWRT/Stable/v5.1.6-b180409/openwrt-ipq806x-wpq865-squashfs-factory.img

Boards shipped with reference firmware cannot support CompexWRT firmware.

Please follow the steps in Manual:System/Firmware_Loading#CompexWRT_Firmware/MAC_File_Upgrade.

For Upgrading The Board With A New MAC File

The steps are the same, replacing firmware filename (e.g. compexwrt-wpj344-xxx.img) with the MAC filename (e.g. m1AFF3D.mac)

Gen1, Gen2, and Gen3 boards and MAC files

There are Gen1, Gen2, and Gen3 boards. There are also Gen1, Gen2, and Gen3 firmware.

From the v1.76_b150409 firmware onwards, the boards are classified into Gen1 and Gen2 boards.

Before the v1.82_b150918 firmware, Gen1 firmware can only be used on Gen1 boards. Gen2 firmware can only be used on Gen2 boards. If the board Gen is different from the firmware Gen, the radios cannot be enabled. This has caused problems therefore we have changed it.

From the v1.82_b150918 firmware onwards, both Gen1 and Gen2 firmwares can be used on both Gen1 and Gen2 boards. The radios will still be enabled.

The difference between Gen1 and Gen2 boards is that Gen2 boards have the VLAN feature.

The difference between Gen2 and Gen3 boards is that Gen3 boards have the Mesh and Hotspot features.

The Gen3 firmware can only be used on Gen3 boards. Otherwise, the radios cannot be enabled.

For newer Gen3 v1.82 b150915 firmware upwards, loaded on newer boards with original MAC address 04:F0:21:1E:60:00 upwards, the customer is able to use Compex MAC files to change the MAC address. MAC files can be requested from your sales representative.

QSDK / QCA Reference / Kosong / Kosong Plus Firmware File Upgrade

Loading QSDK / QCA reference / Kosong / Kosong Plus firmware into WPJ428

Firmware for example is in https://downloads.compex.com.sg

  • QSDK/Kosong-Plus/ipq40xx-spf50-cs1/nor-ipq40xx-single.img

To flash the WPJ428 QSDK / QCA reference / Kosong / Kosong Plus firmware using u-boot console command, please follow these instructions:

set ipaddr 192.168.1.11
set serverip 192.168.1.10
ping ${serverip}
tftpboot 0x84000000 nor-ipq40xx-single.img
imgaddr=0x84000000 && source $imgaddr:script

Loading QSDK / QCA reference / Kosong / Kosong Plus firmware into WPQ864

Firmware for example is in https://downloads.compex.com.sg

  • QSDK/QCA-Reference/WPQ864/1GB-RAM/ipq806x-spf502-cs/b170706/nand-ipq806x-single.img
  • QSDK/Kosong-Plus/ipq80xx-spf50-cs1/nand-ipq806x-single.img

Please follow these steps.

  1. Connect LAN cable to LAN0 port.
  2. Connect serial 4-cable.
  3. Connect antenna to CH0 etc.
  4. WPQ864 board: Put jumper in JP13 (leave JP9 open) to load nand firmware and boot from nand.
  5. Open PuTTY COM port.
  6. Connect power supply (48V for 6A01 HV, 12V for 6A02).
  7. Power up.
  8. Press enter on PuTTY to enter bootloader mode.
  9. Set PC Ethernet port IP address to 192.168.1.10.
# To flash the firmware using u-boot console command:
set ipaddr 192.168.1.1
# This should be the address of the TFTP server
set serverip 192.168.1.10
# This should be the ethernet address of the board
set ethaddr 00:aa:bb:cc:dd:ee
set bootargs console=ttyMSM0,115200n8
saveenv
ping ${serverip}

Windows: In the same folder as "nand-ipq806x-single.img", Run tftpd32.exe.

# If using a NAND flash, execute the following command:
tftpboot 0x42000000 nand-ipq806x-single.img
# Wait for command to be completed.
imgaddr=0x42000000 && source $imgaddr:script
# Wait for command to be completed.
reset

Web Upgrade

Firmware for example is in https://downloads.compex.com.sg

  • QSDK/QCA-Reference/WPQ864/1GB-RAM/ipq806x-spf40-csu2-r023/b170405/ipq806x-nand-apps.zip

Web upgrade must use apps firmware, not single firmware. The nand or nor must match the jumper.

  • Place jumper at JP13 for WPQ864 to upgrade firmware and load from NAND flash.
  • Place jumper at JP9 for WPQ864 to upgrade firmware and load from NOR flash.

Old Fusion Firmware File Upgrade

For older WP546 board

For WP546 board, you must connect the LAN cable to the port closer to the DC jack. Plug in the LAN cable first before rebooting the board.

Set your PC IP address to 192.168.168.10/24.

Press the ESC key when you see "Loading Firmware ..." in the serial console e.g. PuTTY. You will see:

Main Menu

1 - Load Firmware
2 - Load Program
3 - BIOS Setup
4 - Fdisk Utility
5 - Update Flash (Binary Mode)
6 - Update Firmware (Image Mode)
7 - Reboot System
8 - Memory Test

Please select : 6

Update Firmware (Image Mode)

Mini TFTP Server 1.0 (IP : 192.168.168.1)
Usage (Windows 2000/XP) :
  tftp -i 192.168.168.1 put <filename>

Your PC needs to be able to ping to the board at 192.168.168.1 first.

Enable TFTP Client on Windows 7/8/10.

Open a DOS window / command prompt and input tftp -i 192.168.168.1 put "F:\firmware\wp546_abgn_v237_b150710.img" ("F:\firmware\wp546_abgn_v237_b150710.img" is the path of the firmware. You can directly pull it into the window.)

You would see something like this in the DOS window:

Transfer successful: 3321520 bytes in 1 second(s), 3321520 bytes/s

In the serial console, you would see something like this:

The TFTP download from IP (192.168.168.10)...
...................................................................................................
TFTP download completed...

Updating firmware, please wait ......
Update firmware successfully! Please reboot.

Finding out if board is 8 MB flash or 16 MB flash version

The flash memory on the board may be of the size of 8 MB or 16 MB. The 8 MB flash firmware can be used on a 16 MB flash board, but half of the flash is never used. There are three methods to find out the flash memory size of the board: using the serial console,looking at the dmesg output, or viewing the production text file.

By using the serial console

If using the serial console, it is easy to see whether the flash is 8 MB or 16 MB.

See that the board is linked to the PC by a serial connector. Open the PuTTY / Tera Term application. The following picture shows the configuration settings for the serial port.

2015-12-18 15 54 26-80-Y1005-2 CompexWRT Firmware MAC File Upgrade v2 0 no watermark.pdf - Foxit Pha.png

When you turn on or reboot the AP, the following line can be seen within the first 20 lines of the PuTTY / Tera Term output.

 Flash: 8 MB

or

 Flash: 16 MB

By looking at the dmesg output

Either by using SSH, telnet, or a serial console, the command “dmesg” in MobaXterm / PuTTY can be used.

From the dmesg log about 0.3 seconds from startup, the message can be seen:

 [ 0.300000] m25p80 spi0.0: mx25l6405d (8192 Kbytes)

or

 [ 0.300000] m25p80 spi0.0: mx25l12805d (16384 Kbytes)

The “8192 Kbytes” means that the flash is 8 MB. The “16384 Kbytes” means that the flash is 16 MB.

The command “dmesg | grep -i m25p80” can also be used. If there are no results, the message may have been flushed due to continuous overwriting. Rebooting the device will clear the kernel log and add this message again.

By viewing the production text file

Either by using SSH, telnet, or a serial console, the following command can be used to show the production text file: cat /www/prod/info.txt

The following is a sample output:

2015-12-18 15 58 09-80-Y1005-2 CompexWRT Firmware MAC File Upgrade v2 0 no watermark.pdf - Foxit Pha.png

The flash size (16 MB) can be seen.

Using the Serial Cable in Windows 8.1/10

Question

On WPJ344, we have trouble to stop booting with serial cable using Windows 8.1 computer. This happened during flash new firmware. How can we input to the board using the serial debug cable?

Answer

TeraTerm would not show up the last few characters of each line (maybe because of USB, closing and opening the program may solve it). Some time later, it would only show nonsense maze characters.

RealTerm at first cannot show, then changing the baud rate to 115200 and other font, it can show, then after some time it becomes corrupted. Also it cannot copy the text.

PuTTY could use the serial console properly in Windows 8.1/10. Please open the Device Manager in the Control Panel to see the COM number. For example, “Prolific USB-to-Serial Comm Port (COM5)” under “Ports (COM & LPT)” means that you should specify “COM5” as the Serial line name in PuTTY.

PuTTY is also working very well with “ATEN USB to Serial Bridge (COM3)”, a generic Made-In-China USB-to-Serial cable.

MobaXterm is also running well. It detected (COM3) and you would need to modify the serial port settings to the following:

Serial Port Settings

  • Baud rate / bits per second = 115200;
  • Data bits = 8;
  • Stop bits = 1;
  • Parity = None;
  • Flow control = None;

Apply the same settings in the Windows 8.1/10 Device Manager.