Overview
Prepare a USB key with the following files (see next section to get the files):
usb.autorun
: Auto executable script
usbkey.txt
: USB password file
liveburner_x.y.z-spn_klkgw-signed.ipk
: Wanesy SPN firmware package
Plug USB key on the iFemtoCell. After a few seconds a led will start blinking from green to red
Unplug USB key
Upgrade process will take a few minutes and reboot the gateway multiple times. Web user interface will be up and running when the left LED will be lit in green
Specific files
usbkey.txt
is a security file. It includes the password of usbuser user.
Default usbuser password is USBklkPassword
To update multiple boards, usbkey.txt
file can include multiple passwords (100 maximum, 1 password per line).
Here is an example of this file for 4 boards (010001 / 020056 / 040001 / 092356):
First board has a generic password and 3 others have a “serial-based” modified password (“<serial>_usbkey”)
Link below to download usbkey.txt file
- usbkey.txt
USBklkPassword
# Support for modified passwords
020056_usbkey
040001_usbkey
092356_usbkey
usb.autorun
is a script automatically executed by the board if the usbkey.txt
file includes a correct password.
The following script is used to deploy the Wanesy SPN firmware. Copy this script in a file named usb.autorun
.
Link below to download usb.autorun file
- usb.autorun
#!/bin/sh
USBDIR="`dirname $0`"
SYSLEDPATH_4_0_IBTS="/sys/class/leds/yellow:debug"
SYSLEDPATH_4_0_IFEMTO="/sys/class/leds/led1:red:power"
SYSLEDPATH="/sys/class/leds/status"
led_path="/do/not/exist"
if [ -e "${SYSLEDPATH}" ]; then
led_path="${SYSLEDPATH}"
elif [ -e "${SYSLEDPATH_4_0_IBTS}" ]; then
led_path="${SYSLEDPATH_4_0_IBTS}"
elif [ -e "${SYSLEDPATH_4_0_IFEMTO}" ]; then
led_path="${SYSLEDPATH_4_0_IFEMTO}"
fi
#
# Set default led behavior
# $1: trigger
#
# if trigger = timer : $2 = delay_on, $3 = delay_off
#
set_led() {
trigger="${1}"
on="$2"
off="$3"
if [ -e "${led_path}" ]; then
echo $trigger > "${led_path}/trigger"
case "$trigger" in
"timer")
echo ${on:=500} > "${led_path}/delay_on"
echo ${off:=500} > "${led_path}/delay_off"
;;
"none")
echo ${on:=0} > "${led_path}/brightness"
;;
*)
# Nothing to do
;;
esac
fi
}
deploy_packages()
{
mkdir -p /user/.updates
for pkg in ${USBDIR}/*.ipk
do
cp ${pkg} /user/.updates/
done
sync
}
#
# Force the system to put the packages immediately in backup
#
force_backup()
{
touch /user/.updates/force_backup
sync
}
#
# Trigger update and reboot in $1 minutes (or 'now')
#
trigger_update()
{
REBOOT_TIMEOUT=$1
kerosd -u
[ ${REBOOT_TIMEOUT:=0} -ne 0 ] && shutdown -r ${REBOOT_TIMEOUT}
}
#####################
# MAIN
#####################
# Set led On
set_led none 1
# Deploy packages
deploy_packages
# Trigger Update
trigger_update
# Optional: Force the system to put the packages immediately in backup
#force_backup
# Prepare reboot after USB unplug
cat > /tmp/usbkey_remove << EOF
# Switch off Led
echo "none" > ${led_path}/trigger
# Reboot Now to get Update
reboot
EOF
# All is right, make Led blinking fast to notify User
set_led "timer" 100 100