User Tools

Site Tools


init

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Next revision
Previous revision
init [2011/12/21 19:50]
sec created
init [2013/07/31 21:28] (current)
sec Change according to Sven Neuhaus
Line 1: Line 1:
-How to factory-reset your roket?+====== ** This page contains the current release of our r0ket firmware release. Feel free to try it and give us feedback if you discover bugs in the firmware or these instructions ** ======
  
-This procedure brings your r0ket back into shape in case it is not working. 
  
-Use this procedure also if you are installing the 28c3 firmware for the first time: 
  
-=== Linux+====== How to flash your r0ket? ======
  
-1. Turn r0ket off (switch position down) +<note tip>​Flashing your r0ket ensures you will get the full functionalityIt is highly recommended ​you flash your old r0ket before attending ​the congress.</note>
-2. Plug micro-USB cable into r0ket and Computer +
-3. Hold joystick to the left +
-4Turn r0ket on (switch position up) +
-5. Release joystick +
-6. Wait about 30 seconds. +
-7. Write firmware.bin to r0ket +
-7.1. If any automounter ​is running ​you should have /media/CRP ENABLD/​firmware.bin,​ write the new firmware by running: +
-      dd if=firmware.bin of="/​media/​CRP ENABLD/​firmware.bin"​ +
-7.2. If you don't have any automounter,​ you just have a new usb device like /dev/sdX. (check "​dmesg"​ to find the name). Write the new firmware by running (as root) dd if=firmware.bin bs=512 seek=4 of=/​dev/​sdX +
-8. Turn r0ket off. +
-9. Hold joystick down +
-10. Turn r0ket on. +
-11. Write new dataflash image +
-11.1. If there is already a filesystem on the r0ket, the automounter will mount itPlease unmount it by running (as root) +
-  umount ​/media/​XXXX-XXXX +
-12. Write the new image by running (as root) dd if=dataflash.img of=/dev/sdX (again, check "​dmesg"​ to find the device name) +
-13. run "​sync",​ wait until all data is written +
-14. turn off r0ket+
  
-You're doneYay!+This procedure also brings your r0ket back into shape in case you "​bricked"​ it or experience other strange software glitches including a damaged file system for l0dables.
  
-=== Windows+^Revision^Change^ 
 +| 1 | Initial | 
 +| 2 | Improved Mesh | 
 +| 3 | Improved r_player l0dable | 
 +| 4 | Improved fahrplan, mesh, fonts | 
 +| 5 | Fixed mesh | 
 +| 6 | Actually pushed the mesh changes, improved game l0dable | 
 +| 15 | numerous small bugfixes |
  
-1. Turn r0ket off (switch position ​down) +===== Linux ===== 
-2. Plug micro-USB cable into r0ket and Computer + 
-3. Hold joystick to the left +  - Download the firmware pack here: {{:​r0ket-firmware-r15.tar.gz}} 
-4. Turn r0ket on (switch position ​up) +  - Unpack the archive with your favourite tool.  
-5. Release joystick +  - Turn r0ket off (switch position ​up). 
-6. Wait about 30 seconds. +  - Plug micro-USB cable into r0ket and Computer. 
-7Write firmware.bin ​to r0ket +  - Hold joystick to the left. 
-7.1. run "copy firmware.bin G:" (check ​the drive letter first -- or just do it via drag&drop) +  - Turn r0ket on (switch position ​down). 
-8. Turn r0ket off. +  - Release joystick. 
-9. Hold joystick down +  - Wait about 30 seconds. 
-10. Turn r0ket on. +  - The r0ket will pose as a thumb driveCheck that you have a new volume with a 'firmware.bin' file on it. Mount the r0ket if you don't get a new volume. 
-11. Write new dataflash ​image +  - As a normal user run the following command in a command window: 
-12.1 Either use tool like [[https://launchpad.net/win32-image-writer/+download|ImageWriter]] ​-- select ​dataflash.img ​as source and the USB r0ket as target +    ​cd r0ket-firmware-28c3-r6 ​&& ./​flash-r0ket 
-12.2 or write with [[http://​www.chrysocome.net/​dd|dd for windows]] with a command like dd if=dataflash.img of=\\.\g: (check drive letter first) +  - The script should tell you, that everything went fine. 
-13. wait until all data is written +  - Turn r0ket off. 
-14turn off r0ket+  ​- ​Hold joystick down towards the battery connector. 
 +  - Turn r0ket on. 
 +  - As above look for a new volume on your system. Mount the r0ket if you don't get one. 
 +  - <note important>​If you already completed the steps below before, please jump to [[init#​updating|Updating the dataflash]]</​note> ​ 
 +  - Make a copy of the following files to your computer: R0KET.CFG, NICK.CFG, L0NICK.CFG, FONT.CFG, pubx.key, puby.key and priv.key 
 +    - Don't worry if some of these files are missing. Your r0ket will still work. 
 +  - Now unmount the r0ketIn terminal run the following commands: 
 +    - <​code>​mount</​code>​ 
 +      - look for a line like: <​code>​/dev/sdb on /​media/​3355-4B37 type vfat [...]</code> 
 +      ​In this case "/​dev/​sdb"​ is the device of your r0ket. Make sure that the second path matches name of the new volume 
 +    ​<​code>​sudo umount <device that was shown by the '​mount'​ command above><​/code> 
 +      ​Example: <​code>​sudo umount /​dev/​sdb</​code>​ 
 +  ​Write the new image by running: 
 +    - <​code>​sudo dd if=dataflash.img ​of=<​device that was shown by the '​mount'​ command above></​code>​ 
 +      - make absolutely sure that you enter the correct device in the line above, or you can damage your computer. 
 +      - Example<​code>​sudo ​dd if=dataflash.img of=/​dev/​sdb</​code>​ 
 +    - <​code>​sync</​code>​ 
 +      - This command may take a minute or two. 
 +  - Turn off r0ket and back on, while pressing the joystick towards the battery connector. 
 +  - Copy the files from step 16 back to the r0ket.
  
 You're done. Yay! You're done. Yay!
  
 +===== Windows =====
 +
 +  - Download the firmware here: {{:​r0ket-firmware-r15.zip}}
 +  - Turn r0ket off (switch position up)
 +  - Plug micro-USB cable into r0ket and Computer
 +  - Hold joystick to the left
 +  - Turn r0ket on (switch position down)
 +  - Release joystick
 +  - Wait about 30 seconds.
 +  - Write firmware.bin to r0ket
 +    * run "copy firmware.bin G:" (check the drive letter first -- or just do it via drag&​drop)
 +  - Turn r0ket off.
 +  - Hold joystick down
 +  -  Turn r0ket on.
 +  -  Write new dataflash image
 +    * Either use a tool like [[https://​launchpad.net/​win32-image-writer/​+download|ImageWriter]]
 +      * select dataflash.img as source and the USB r0ket as target
 +    * or write with [[http://​www.chrysocome.net/​dd|dd for windows]] with a command like
 +      * dd if=dataflash.img of=\\.\g: # (check drive-letter first)
 +  - wait until all data is written
 +  - turn off r0ket
 +
 +**You'​re done. Yay!**
 +
 +===== Mac =====
 +
 +  - Download the firmware pack here: {{:​r0ket-firmware-r15.tar.gz}}
 +  - Download and compile keys.c from https://​github.com/​r0ket/​r0ket.git (r0ket/​tools/​crypto/​generate-keys.c) and put in in the same directory as the script
 +  - Write the following script to a file. Extract the firmware. Execute the script with the directory containing the new firmware as parameter. The script will guide you through the process.
 +  - Example
 +    - <​code>​ ./​flashscript r0ket-firmware-r15 </​code>​
 +FlashScript UNSAFE (user errors might cause loss of data and corruption)
 +
 +<​code>​
 +#!/bin/bash
 +
 +myTmpdir=/​tmp/​r0ket/​$(uuidgen)
 +myCalled="​$(pwd)"​
 +
 +function ERROR {
 + echo ERROR $@
 +}
 +
 +function DEBUG {
 + echo DEBUG $@
 +}
 +
 +function PRINT {
 + echo $@
 +}
 +
 +function DIE {
 + echo DIED $@
 + exit 1
 +}
 +
 +function flashFirmware {
 + myMount="​$(diskutil info $(system_profiler SPUSBDataType | grep -A15 "NXP LPC13XX IFLASH"​ | grep "BSD Name" | awk -F:  '​{print $2}') | grep "Mount Point" | sed 's/[ ]*.*[ ][ ]//​g'​)/"​
 + if [ -z "​$myMount"​ ] || [ ! -d "​$myMount"​ ]; then
 +                DIE "Could not flash firmware. Could not find mountpoint $myMount"​
 +        fi
 + cp -v "​$FIRMWAREBIN"​ "​$myMount"​
 + sleep 2
 + sync
 + sleep 2
 + myroket="/​dev/​$(system_profiler SPUSBDataType | grep -A15 "NXP LPC13XX IFLASH"​ | grep "BSD Name" | awk -F: '​{print $2}' | sed 's/ //'​)"​
 + PRINT Unmounting the rocket $myroket. Please enter your password:
 + sudo umount "​$myroket"​
 + return
 +
 +}
 +
 +
 +function flashDataflash {
 + myMount="​$(diskutil info $(system_profiler SPUSBDataType | grep -A10 "​r0ket"​ | grep 'BSD Name' | awk -F:  '​{print $2}' | sed 's/ //' ) | grep "Mount Point" | sed 's/[ ]*.*[ ][ ]//​g'​)"​
 + if [ -z "​$myMount"​ ] || [ ! -d "​$myMount"​ ]; then
 + DIE "Could not flash dataflash. Could not find mount $myMount"​
 + fi
 + cd "​$myMount"​
 + pwd
 + cp -v R0KET.CFG NICK.CFG L0NICK.CFG FONT.CFG pubx.key puby.key priv.key $myTmpdir/​backup/​
 + cd $myTmpdir
 + sleep 5
 + #PRINT "​Please unmount the roket in the finder. Press the eject button on the newly mounted device. Then press return"​
 + #read
 + myroket="/​dev/​$(system_profiler SPUSBDataType | grep -A10 "​r0ket"​ | grep "BSD Name" | awk -F: '​{print $2}' | sed 's/ //'​)"​
 + PRINT Unmounting the rocket $myroket. Please enter your password:
 + sudo umount $myroket
 + PRINT Flashing the rocket. Please enter your password:
 + cd "​$myCalled"​
 + echo sudo dd if=$FIRMWARE/​dataflash.img of=$myroket
 + sudo dd if=$FIRMWARE/​dataflash.img of=$myroket
 + sync
 + sleep 3
 + sudo mount -t msdos $myroket $myTmpdir/​mountpoint
 + cd $myTmpdir/​backup
 + cp -v *  $myTmpdir/​mountpoint/​
 + ls pubx.key puby.key priv.key || ( echo "​Generating new keys" && cd .. && ./​generate-keys && cp -v files/* $myTmpdir/​mountpoint/​ )
 + cd /tmp
 + PRINT Unmounting the rocket $myroket. Please enter your password:
 + sudo umount $myroket
 +
 +}
 +
 +function cleanUp {
 + sudo rm -rf /tmp/r0ket/
 +}
 +
 +
 +function init {
 + mkdir -p $myTmpdir/​backup
 + mkdir -p $myTmpdir/​mountpoint
 + mkdir -p $myTmpdir/​files
 +
 +}
 +
 +function main {
 + init
 + if [ -n "​$@"​ ]; then
 + if [ -e "​$@/​firmware.bin"​ ]; then
 + FIRMWARE=$@
 + FIRMWAREBIN=$@/​firmware.bin
 + else
 + DIE $@/​firmware.bin seems not to be a firmware
 + fi
 + else
 + DIE expected the path to the directory with the new firmware as parameter
 + fi
 + PRINT "​Please turn off your r0ket and connect your r0ket to a USB port."
 + PRINT "​Please press the r0ket joystick to the LEFT and turn the rocket on. Then press return"​
 + read
 + sleep 10
 + flashFirmware
 + #PRINT "​Please unmount the roket in the finder. Press the eject button on the newly mounted device. Then press return"​
 + #read
 + PRINT "​Please turn off your r0ket."​
 + PRINT "​Please press the r0ket joystick DOWNWARDS and turn the rocket on. Then press return"​
 + read
 + flashDataflash
 +
 + cleanUp
 +
 +
 +}
 +
 +main $@
 +</​code>​
 +
 +===== Updating =====
  
-The needed ​files will be on this page soon. Check back on Dec 22nd...+If completed the steps above once, you can update your dataflash by copying the files from the '​files'​ directory in the archive to the mounted dataflash of your r0ketDo not forget to properly '​eject'​ or '​unmount'​ the device or you might loose data!
  
-firmware.bin 
-dataflash.img 
init.1324493415.txt.gz · Last modified: 2011/12/21 19:50 by sec