Web FailSafe Uboot

From Wiki for Dragino Project
Jump to: navigation, search

Introduction

The MS14 and HE is pre-load with Web FailSafe u-boot from https://github.com/pepe2k/u-boot_mod/. This U-boot provide Web Interface and Netconsole feature, it eliminates the need of UART while user have to upgrade firmware in U-Boot, User can access to u-boot via its LAN interface.



Check if device has Web FailSafe U-Boot

To check if MS14 is loaded with the Web Failsafe U-Boot, user can press the toggle button and power on the device. The left four LEDs will blink together every second if the MS14 has the Web Failsafe U-boot. If the device doesn't have the Web FailSafe u-boot. User can upgrade it to support Web FailSafe according to this Intruction.



Working Modes

Boot to different Mode

There is a counter in the Web Failsafe U-Boot, keep pressing the toggle button and power on the device, all LEDs will blink and the counter will start from 0 and it increase one on every blinking of the four LEDs. The system will be in four different working modes depends on the status of the counter:

  • < 3 sec: System will boot into OpenWrt Linux
  • 3 ~ 5 sec: Web FailSafe U-Boot
  • 5 ~ 7 sec: u-boot UART Console
  • > 7 sec: u-boot netconsole


Web FailSafe Mode

User should connect a RJ45 cable from the PC to MS14 or HE before power on the device, once boot into this mode, ms14 or HE will have a default IP 192.168.255.1.The full operation is:

  • Use a RJ45 cable to connect the PC to device's ethernet port directly.
  • Set the PC to ip 192.168.255.x, netmask 255.255.255.0
  • Pressing the toggle button and power on the device
  • All LEDs of the device will blink four times then release the toggle button
  • All LEDs will then blink very fast once, this means device detect a network connection and enter into the web-failsafe mode.Your PC should be able to ping 192.168.255.1 after device enter this mode.
  • Open 192.168.255.1 in web broswer
  • Select a squashfs-sysupgrade type firmware and update firmware.
Upgrade Firmware in Web Failsafe Mode

Notice: If the previous firmware used in Dragino is Yun Firmware, and user want to upgrade the firmware in web failsafe mode, user should set the bootaddress to 0x9f040000 in u-boot netconsole use below commands:

dr_boot>setenv bootcmd bootm 0x9f040000
dr_boot>saveenv



U-Boot UART Console Mode

In U-boot Console mode, user can use access the u-boot enviroment via rs232 connection. Intruction is here

Upgrade u-boot

Warning: Upgrade to an inproper u_boot may make the device inaccessible. Be careful to choose the u-boot before upgrade. here is the tested u-boot: DOWNLOAD

  • std: Version with Dragino Logo
  • oem: None Logo Version
  • none-web-failsafe: u-boot doesn't support Web FailSafe


User can upgrade U-Boot in u-Boot console mode, procedure is:

  • Set up a TFTP server with address 192.168.255.2
  • Place the new U-Boot file under the TFTP root and rename it to uboot.bin
  • Run run uboot_upg. Device will auto get the uboot file from tftp file and upgrade. Device will use the new u-boot after reset.

Output:

Environment size: 934/32764 bytes

dr_boot> run uboot_upg
Link down: eth0
Ethernet mode (duplex/speed): 1/1000 Mbps
Using eth1 device

Ping OK, host 192.168.255.2 is alive!


TFTP from IP: 192.168.255.2
     Our IP: 192.168.255.1
   Filename: 'uboot.bin'
Load address: 0x80800000
      Using: eth1

    Loading: #######################################

TFTP transfer complete!

Bytes transferred: 196608 (0x30000)
Erase FLASH from 0x9F000000 to 0x9F02FFFF in bank #1
Erasing: ###

Erased sectors: 3

Copying to FLASH...
Writting at address: 0x9F000000

Done!

OK!
dr_boot> reset




U-Boot NetConsole Mode

In this mode, user is able to access the u-boot by netconsole tool. The Netconsole mode support same commands as UART Console mode and without the need of UART converter.


In Windows OS we can use the hercules utility for netconsole. The using of this tool is easy. Steps are:

  1. Download hercules and run it with correct paramters as shown below.
  2. Connect PC to MS14 LAN port.
  3. Configure PC with IP 192.168.255.2.
  4. Disable Windows firewall
  5. Boot MS14 to Netconsole mode.

Then Hercules should be able to get response from MS14 and able to interactive with the U-Boot.

Hercules Configure


In Linux OS we can use nc command (NetConsole Tool) to access the u-boot netconsole. process:

  1. Connect PC to MS14 LAN port.
  2. Configure PC with IP 192.168.255.2.
  3. Run nc -kul 6666
  4. Boot MS14 to Netconsole mode.

U-Boot info will be shown in Linux console once the MS14 has entered the netconsole mode.

Ubuntu to access netconsole



Upgrade to Web FailSafe U-boot

Upgrade in OpenWrt Mesh Firmware version

If you have the OpenWrt Mesh version Firmware loaded in the MS14, you can upgrade the firmware to the Web Failsafe version from THIS LINK.

After upgrade, ssh access to the MS14 and run below command:

root@Arduino:~# mtd write /etc/uboot_for_dragino_v2_ms14.bin u-boot
Unlocking u-boot ...

Writing from /etc/uboot_for_dragino_v2_ms14.bin to u-boot ...     
root@Arduino:~# reboot

This command will write the Web-FailSafe u-boot to MS14.



Trouble Shooting

Can't type strings in Netconsole mode

Some customers feedback that the Hercules can see the string from device but fail to send strings to device via Hercules. This issue is found that the device has a ipaddress different from 192.168.255.1. such as 192.168.255.3 / 192.168.255.4 or 192.168.255.5. To solve this issue, user can use windows to ping above ip and see which is the exactly ip. then configure the Hercules to use that ip to connect to the device.