Jump to: navigation, search

Uboot and OpenWrt Failsafe on the MP02

Introduction

The MP02 is provided with a number of mechanisms to allow access to the device in the event that the installed firmware is not operating correctly, or the device needs to be reflashed.

Serial Port

A Serial Port adapter module is available which provides access to the on board UART via a standard DB9 connector. Connecting a PC serial port to the adapter and running a serial terminal program such as GTKTerm will show the boot sequence and allow interruption to go into Uboot console mode.

Uboot

The MP02 has an advanced Uboot which supports Web Interface, Serial Console, and NetConsole methods of connection.

The web Interface mode may be used to reflash the device firmware with a suitable sysupgrade firmware image. In addition it can be used to upgrade the Uboot firmware and the ART data table.

References:

   https://github.com/pepe2k/u-boot_mod
   http://wiki.dragino.com/index.php?title=Web_FailSafe_Uboot

OpenWrt Failsafe

The MP02 supports the OpenWrt Failsafe mode which provides a means of editing the configuration of the installed firmware eg to change IP address or password.


Note: When connecting to the MP02 via Ethernet from a PC in these modes, it can be helpful to connect via a network switch so that the PC does not disable the Ethernet port while waiting for the MP02 to start up.

Starting in Uboot or Failsafe Modes

Each mode of access requires a different start up procedure as detailed below.

Starting up in Uboot Mode

To start the MP02 in Uboot mode, hold down the recessed Reset ('toggle') button while switching on the power to the device.

There is a sequence of LED flashes that is used to guide the selection of the particular Uboot mode required.

The sequence consists of four LEDS flashing together, one long flash, followed by a series of short flashes at one second intervals.

To select a particular Uboot mode, hold the button down until the required number of short flashes has occurred, then release the button.

Web Page Mode

To switch to the web mode, hold the button down, switch on the power and wait for one long flash and THREE short flashes, then release the button. At this point the LEDs will flash quickly for a second to indicate that the web mode has been selected.

The web page is then available at IP address 192.168.255.1

This web page allows you to reflash the device with new a firmware sysupgrade file.

Uboot Serial Console Mode

To switch to the serial mode, hold the button down, switch on the power and wait for one long flash and FIVE short flashes, then release the button. The LEDs will go out and the console mode will be available via the serial port.

Use a terminal program such as GTKTerm configured for 115k/NoParity/8 Data bits/1 Stop bit and the appropriate serial port or USB based serial port.

For details of Uboot console usage see:

 http://wiki.villagetelco.org/Serial_Port_Access_and_Firmware_Recovery_for_MP-02

Uboot Netconsole Mode

To switch to the netconsole mode, hold the button down, switch on the power and wait for one long flash and SEVEN short flashes, then release the button. The LEDs will go out and the netconsole mode will be available via the Ethernet port.

Netconsole mode provides the same interaction as the serial console, but uses the LAN Ethernet port and the netcat (nc) program on a Linux PC. (For a Windows PC you can use the Hercules program or similar.)

To use the netconsole mode with netcat proceed as follows:

  • Set up your PC Ethernet port with an IP address of 192.168.255.2 and connect it to the LAN Ethernet port on the MP2.
  • Open a terminal window and run the command:
  $   nc  -kul 6666
  • Power up the MP2 and put it into the NetConsole mode as above.
  • The 'dr_boot' prompt will appear in the terminal. Type 'help' or '?' for a list of commands.

For details of Uboot console usage see:

 http://wiki.villagetelco.org/Serial_Port_Access_and_Firmware_Recovery_for_MP-02

Starting up in OpenWrt Failsafe Mode

To start up in OpenWrt Failsafe mode, it is necessary to power up the device, and to operate the recessed Reset (toggle) button at a particular point in the boot up sequence. There are several ways to determine the correct point to do this as detailed below.

Note: Some devices provide a LED flashing sequence to indicate the correct timing for entering Failsafe mode, however this has not been implemented on the MP02 at this point.

Once the device is in Failsafe mode, you may access it via telnet on IP address 192.168.1.1

For details of OpenWrt Failsafe mode usage see:

 http://wiki.villagetelco.org/Serial_Port_Access_and_Firmware_Recovery_for_MP-02

Using Ping

To activate Failsafe mode on the MP02 using the Ping method, proceed as follows:

  • Set up your PC with a fixed IP address in the range 192.168.1.x and have it ping the target device on 192.168.1.1
  • Start the ping running and then power up the target device.
  • When you see the *first* ping responses it is time to press and hold the Reset button.

Hold the button for 5 - 10 seconds then release it.

  • The target device should then be in Failsafe mode and you should be able to telnet to it on 192.168.1.1.

Using Timing

For the MP02 the correct time to push the Reset ('toggle') button is 10 seconds after applying power.

Apply power, time ten seconds and then push the button for one second.

The device should then be in Failsafe mode and you can telnet to it on 192.168.1.1

Note that the window of time is just a couple of seconds so if you don't succeed at first, try varying the time by a second or two.

An alternative timing approach is to power up the device and after a few seconds start repeatedly operating the button for one second on, one second off. After 10 seconds the device should be in Failsafe mode.