Skip to content

Instantly share code, notes, and snippets.

View twatteyne's full-sized avatar

Thomas Watteyne twatteyne

View GitHub Profile
@twatteyne
twatteyne / map.html
Created October 30, 2015 09:29
simple Google maps-based mote and link visualization
<!DOCTYPE html>
<html lang="en">
<head>
<meta name="viewport" content="initial-scale=1.0, user-scalable=no">
<meta charset="utf-8">
<title>Motes and Paths</title>
<style>
html, body {
height: 100%;
margin: 0;
@twatteyne
twatteyne / 4e_tsch_default_ch.py
Created November 9, 2014 23:25
IEEE802.15.4e-2012 TSCH default channel hopping sequence calculator
BANNER = r'''
This script calculates the default channel hopping sequence for the
IEEE802.15.4e-2012 TSCH mode.
\author Thomas Watteyne
\date November 2014
\license http://opensource.org/licenses/BSD-3-Clause
'''
class Lfsr(object):
@twatteyne
twatteyne / testFindSerialPort.py
Created September 5, 2014 02:26
use OpenWSN's findSerialPort
'''
drop this file in a new directory:
openwsn-sw\software\openvisualizer\bin\testFindSerialPort\
double-click to run.
example output:
[('COM6', 115200)]
Script ended successfully. Press Enter to close.
@twatteyne
twatteyne / 00_iotlab_forwarder.md
Last active August 29, 2015 14:04
IoT-LAB: forward serial traffic from motes to your local computer

The IoT-LAB platform lets you log into the server of the site your motes are located at (e.g. rennes.iot-lab.info). It all works fine.

In some cases, you want to be able to run programs and interact with the motes' serial port on your local computer. One example is running the OpenVisualizer from the OpenWSN project.

This Gist contains a couple of ideas about how to do that using SSH forwarding and a pair of Python scripts.

How it works

@twatteyne
twatteyne / vector.py
Created April 4, 2014 06:36
Dynamic VPython-based visualization of a vector
import random
import visual
MAXDIFF = 0.05
class ArrowCoords(object):
x = random.random()
y = random.random()
z = random.random()
def get(self):