Raspberry PI TTN gateway image based on Hypriot
1.8K
Raspberry PI TTN gateway image based on Hypriot. This dockerfile is heavily influenced by the install script from The Things Network iC880a-based gateway.
This image is made for and tested on a Raspberry Pi 3 together with a IMST-iC880 SPI LoRaWAN concentrator.
Here are the steps to get the host environment ready for this image:
ssh file in the root of the SD card to enable SSH access to the Pipirate and password hypriot Note: default keyboard layout is QWERTY. If you are using a QWERTZ keyboard make sure you use the correct 'y' in the password
black-pearl in your network.sudo apt-get update && sudo apt-get install raspi-config kbd. During setup you can choose a different keyboard layout if you needsudo raspi-config to
4 Localisation Options > I2 Change Timezones5 Interfacing Options > P4 SPI > Yescat /sys/class/net/eth0/address | awk -F\: '{print $1$2$3"fffe"$4$5$6}'. This turns the 48-bit MAC address into EUI-64, splits it in half and injects fffe (e.g. b827eb8684a2 → b827ebfffe8684a2).docker run -it --privileged --net=host --restart=always \
-e PI_RESET_PIN=<optional-see-explanation-below> \
-e TTN_GATEWAY_SERVER_URL=<optional-see-explanation-below> \
-e GATEWAY_EUI=<EUI-identified-in-previous-step> \
-e GATEWAY_LAT=YOUR_LATITUDE \
-e GATEWAY_LON=YOUR_LONGITUDE \
-e GATEWAY_ALT=YOUR_ALTITUDE \
-e GATEWAY_EMAIL=YOUR_EMAIL \
-e GATEWAY_NAME=YOUR_GATEWAY_NAME \
netceteragroup/rpi-ttn-gateway
PI_RESET_PIN may or may not be required depending on how the concentrator is connected to the Pi. The default
reset pin configured by the start script is 25.
Installations with simple backplanes such as the one from Gnz
can go with the default value. More elaborate backplanes might rewire the reset pin. The one from CH2i
for example uses 17. Hence, you would say docker run ... -e PI_RESET_PIN=17 ....TTN_GATEWAY_SERVER_URL URL of the TTN API endpoint server to use, the default is eu1.cloud.thethings.network. Server address for other regions are listed here:
https://www.thethingsindustries.com/docs/getting-started/ttn/addresses/Item 9 above documents the Docker run command. If you would rather want to run the TTN container in daemon mode rather than interactive mode you would replace -dt with -it. This will put the Docker container process into the background and not block the CLI but you won't see the log output that normally spills to the console.
docker logs <container-id> could make that visible again if necessary. Or docker attach <container-id>. Or docker exec -i <container-id> /bin/bash and then poke around the container.
To build a (potentially customized) image yourself do as follows:
$ git clone https://github.com/netceteragroup/rpi-ttn-gateway
$ cd rpi-ttn-gateway
$ docker build -t <your-handle-here>/rpi-ttn-gateway .
<your-handle-here> can be anything that is uniquely you (e.g. name) but you might also use rpi-ttn-gateway w/o any "prefix".
Just a few obvious measures you can/should think about before you release your new gateway into the wild.
passwd to use a custom password./boot/device-init.yaml and modify the hostname attribute (source).Content type
Image
Digest
Size
159.4 MB
Last updated
about 5 years ago
docker pull netceteragroup/rpi-ttn-gateway