Skip to content
Drasko DRASKOVIC edited this page Oct 29, 2015 · 13 revisions

ONLINE Manual Update (via WeIO IDE program)

If from any reason standard IDE "Update" button don't work, it's possible to update WeIO to the newest version using the following script directly from WeIO IDE interface, as a usual WeIO program. Your WeIO board needs to be connected to the Internet in order to correctly do it's update.

This script will download the latest version of WeIO software and then start upgrade by completely replacing the old one. All your projects and configuration of WeIO board WILL BE preserved by this method. However we are suggesting that you do backup before doing update.

  • Open WeIO IDE and make sure that your board is connected to the Internet.
  • Click on the project > Create new project to create a new one
  • Inside main.py file copy paste this script and run it
  • Be patient, update can be long (up to 5min)
  • Wait until update process is finished (bootloader will pick new FW and write it into the flash).
  • You will see new Linux booting and blinking the LEDs
  • When only AP or STA led is lit - boot is finished and WeIO is up
  • Enjoy brand new WeIO :)
from weioLib.weio import *
import urllib, os, subprocess

def setup():
    attach.process(myProcess)
    
def myProcess():
    print("Hello world")
    url = "http://we-io.net/downloads/update/bundle/updateRecipe"
    response = urllib.urlopen(url)
    data = response.read()
    filename = "/tmp/updateRecipe"
    f = open(filename, 'w')
    f.write(data)
    f.close()
    os.chmod(filename, 0755)
    print "Updater will now install the newest WeIO firmware"
    print "Please don't touch a thing, this procedure can be long (up to 5min)"
    print "Wait until LED blinking stops at one LED and stays still"
    print "If you turn off the power you can easily brick your board\n\n"

    print "Update will start in :"    
    for a in range(20):
        print 20-a, "s"
        delay(1000)

    p = subprocess.call(filename)

OFFLINE Manual Update (via SD card or USB key)

Sometimes we might find ourselves with unusable board. This can be for several reasons:

  • Update that did not finished correctly
  • Some installations that broke something into the system
  • ...

In order to recover WeIO board to working version, we implemented mechanism of WeIO Recovery.

This mechanism takes WeIO FW in binary form from external storage and replaces (destructivly) all current SW on WeIO with it.

N.B. Back up all your projects before executing WeIO Recovery

Procedure is following:

  • Get weio_recovery.bin from latest release (for example here: https://github.com/nodesign/weio/releases/)
  • Put this binary on SD card or USB key
  • Unplug power from WeIO
  • Plug SD card / USBkey to WeIO
  • Press and hold SOFT RESET button on WeIO
  • Plug power to WeIO while keeping the SOFT RESET button pressed
  • You will see STA led blink 3 times
  • Now you can release the SOFT RESET BUTTON
  • Wait until update process is finished (bootloader will pick new FW and write it into the flash)
  • You will see new Linux booting and blinking the LEDs
  • When only AP led is lit - boot is finished and WeIO is up

N.B. currently there is bug in the WeIO that demands one reboot after WeIO Recovery for WeIO to function correctly.

To explain a bit this procedure for the people who would like to know how this works:

  • There is a U-Boot booatloader (http://www.denx.de/wiki/U-Boot) on the board that loads Linux from NOR flash (internal non-volatile memory of the Carambola 2 HW module on WeIO board) in the normal case.
  • In the special case (when SOFT RESET button is held on power-on) U-Boot will scan all external storage for the binary named weio_recovery.bin
  • If this bianry is found, it will load it in RAM from external storage, then erase current system from internal flash and then write new form RAM into the flash
  • Then u-boot will reset the board and boot in the normal way, loading Linux from flash - but this time there will be new system image (this one that was just written previously)