Skip to content

Instantly share code, notes, and snippets.

@claudyus
Last active August 29, 2015 14:08
Show Gist options
  • Save claudyus/43e2f9000a869b9b8d6c to your computer and use it in GitHub Desktop.
Save claudyus/43e2f9000a869b9b8d6c to your computer and use it in GitHub Desktop.
contiki-rpl-testcase
#!/bin/bash
set -x
#return 0 if border router is working (curl works)
#Init USB-RLY02
sudo chmod 777 /dev/ttyACM0
stty -F /dev/ttyACM0 raw ispeed 15200 ospeed 15200 cs8 -ignpar -cstopb -echo
echo 'n' > /dev/ttyACM0 # ALL relay OFF
#Power connected to RLY1 - NO
#Select (boot_on) connecter to RLY2 -NO
cd contiki; git describe --tags
make -C examples/ipv6/rpl-border-router/
#flash chip
echo 'f' > /dev/ttyACM0 #RLY2 ON
echo 'e' > /dev/ttyACM0 #RLY1 ON
sleep 0.2
cc2538-prog -d /dev/ttyUSB1 -f examples/ipv6/rpl-border-router/border-router.hex
sleep 0.5
#reset chip
echo 'n' > /dev/ttyACM0 #ALL OFF
sleep 1
echo 'e' > /dev/ttyACM0 #RLY1 ON
#tunnel up, wait some seconds
sudo ./tools/tunslip6 -s ttyUSB1 aaaa::1/64 &
sleep 6
#test
ping6 aaaa::212:4b00:413:36f1 -c 1 -i 2 | grep ttl || exit 1
curl -g "http://[aaaa::212:4b00:413:36f1]" | grep Routes || exit 1
sleep 2
echo 'n' > /dev/ttyACM0 #ALL OFF
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment