This repository contains the code used for the 6LoWPAN workshop by relayr.
The requirements willvary depending if you are in Linux, Mac or Windows.
For Debian based systems (Debian, Ubuntu, Mint, etc.) these are the steps.
- Get the basic tools for C based development:
apt-get install build-essential automake gettext
- Get the compiler and supporting libraries:
apt-get install gcc-arm-none-eabi libnewlib-arm-none-eabi
- Get git:
apt-get git
- See if have permissions to access serial devices:
groups | grep dialout
if the `dialout` groups appears then you are already in the group,
if nothing is printed, this means that you need to add yourself to
the group.
sudo adduser <your username> dialout
where `<username>` is your username. You have to **logout** and
**login** again for the change to take effect.
- Done.
-
The first thing you'll need is the
gcc-arm-embedded
compiler. There are two possibilities for getting the compiler:- Using brew.
-
Add the brew repository for the
gcc-arm-embedded
compiler.brew tap PX4/homebrew-px4 brew update
-
Install the gcc-arm-embedded` compiler.
brew install gcc-arm-none-eabi
- Installing the compiler without brew.
-
Go to https://launchpad.net/gcc-arm-embedded and download the Mac installation tarball.
-
Make a directory to install it. Is up to you to decide how to organize your filesystem. Our suggestion is to put it under
/usr/local
:mkdir /usr/local/gcc_arm
-
Unzip the tarball downloaded in 1. and move it to the above created directory.
-
Add the path to the compiler to your
PATH
shell variable so that you are able to compile code using the ARM GCC in any directory.export PATH="$PATH:/usr/local/gcc_arm/gcc-arm-none-eabi-<version>/bin"
where
<version>
is the version of ARM GCC you downloaded in 1.
-
Now you should be able to from any directory do:
arm-none-eabi-gcc --version
and get the version of the ARM GCC.
-
Note that depending on your particular setup you might have already an ARM GCC, it might work with the workshop code or not, so we advise to always update ARM GCC to the latest available version.
-
Get the driver for the USB to TTL adapter.
-
In Mac you should already have Python available, to make it easier to get new packages we'll use `pip. We need the pySerial module.
sudo pip install pyserial
-
As a final step get XCode so that we have a properly setup development environment (
git
,make
, othergcc
, etc). -
Done.
To make things work in Windows you'll need to install the Minimal Gnu Windows environment (MinGW). If you already have it in your system then you don't need to set it up.
-
Go to mingw.org and download the installer.
-
Follow the instructions to install MinGW.
-
Get the Windows version of the gcc-arm-embedded` compiler at https://launchpad.net/gcc-arm-embedded.
-
If you don't have Python you need to get it from the Python site.
-
We need the pySerial module.
shell pip install pyserial
-
Install the Git for Windows SDK.
-
Done.
The repository uses git submodules in order to include the Contiki repository inside.
-
Clone the repository:
git clone --recursive [email protected]:relayr/workshop-6lowpan.git
-
Go to the workshop directory:
cd workshop
-
Build the executable:
make TARGET=zoul BOARD=firefly
-
Connect the board to the USB of your computer.
-
Upload the code to the board:
make TARGET=zoul BOARD=firefly er-server.upload
All the code examples are in the workshop
directory. The
instructions on how to use them are on the
README.