LoRaWAN/Workshops

From The Munich Maker Lab's Wiki
Jump to: navigation, search

Intro To LoRaWAN

Parts

Part Partnumber Source Cost Notes
PCB SeedStudio, JLCPCB 2
Arduino Pro Mini, 3.3V, 8Mhz AliExpress 1,90
Antenna 868Mhz SMA AliExpress (NextRF) 1,50
SMA Connector Edge mount AliExpress, DigiKey 0,15
LoRa Module RFM95 DigiKey 7,6
Battery Holder 2x AA AliExpress 0,20
Case Abzweigdose 75x75 Hardware store [1], [2] 0,70

Build your own Gateway

  • March 10th, 2018
  • August 27th, 2018 September 24th, 2018

Parts

Part Partnumber Source Cost Notes
LoRaWAN Concentrator iMST ic880a  iMST 142€ + Shipping
RaspberryPi 3 Reichelt 32€
Adapter PCB Severin 2€ https://github.com/ch2i/iC880A-Raspberry-PI
SD Card Reichelt 6,50€
uFL Pigtail AliExpress 3€ (BNC)
Antenna Aurel GP-868 Conrad 40€
DELOCK 89583 Jacob, eBay 40€
"Antenne kollinear 868 MHz" eBay Seller 30€ if it's not available in the shop, send them an email, they'll reply
Case RF-Elements StationBox ALU (SBX-ALU-6N1E) Varia Store 32€ deprecated? Seems to be out of stock everywhere
EZ-SOE01W Aerial 19€ + Shipping (~10€) No longer for sale
EZ-DCE15 Aerial 19€ + Shipping Currently out of stock
RND 455-00185 Reichelt 7,50€ probably not an outdoor case
RND 455-00137 reichelt 9,90€
RND 455-00148 reichelt 6,95€ Same as above, but without transparent front, used for workshop 2. Works pretty well
WaveArena GOLD ALUBOX wlan-shop24.de 32,99€ Outdoor case, works great (used in WS2)
PSU 30 W, 12 V, 2,5 A Reichelt 12€

Small Stuff

HowTos

TTN Application Dashboard

Note: This is not complete or secure at all. Please don't run this on a public server just like that.

Node Red

apt update
apt install curl
curl -sL https://deb.nodesource.com/setup_11.x | bash -
apt-get install -y nodejs

npm install -g --unsafe-perm node-red

npm install -g pm2
pm2 start /usr/bin/node-red
pm2 save
pm2 startup

TIG Stack

apt update
apt install -y apt-transport-https

wget -qO- https://repos.influxdata.com/influxdb.key | apt-key add -
source /etc/os-release
echo "deb https://repos.influxdata.com/debian stretch stable" > /etc/apt/sources.list.d/influxdb.list

apt update
apt install -y influxdb
systemctl enable influxdb
systemctl start influxdb

influx

create database telegraf
#create user telegraf with password 'SafetyThird'


apt install -y telegraf

cd /etc/telegraf
mv telegraf.conf telegraf.conf.default
grep -v "^ *#" telegraf.conf.default | grep -v "^$" > telegraf.conf

vi telegraf.d/influx.conf

[[outputs.influxdb]]
  database = "telegraf"
  urls = [ "http://127.0.0.1:8086" ]
#  username = "telegraf"
#  password = "SafetyThird"

vi telegraf.d/ttn.conf

[[inputs.mqtt_consumer]]
  servers = ["tcp://eu.thethings.network:1883"]
  qos = 0
  connection_timeout = "30s"
  topics = [ "+/devices/+/up" ]
  client_id = ""
  username = "ttn-muc-paxcounter"
  password = "ttn-account-v2.Ey78w3jn9ttHS7kGrZ8uv6PCKCd1s6WkHGuB8YOMEPE"
  data_format = "json"
  json_query = "{app_id,dev_id,hardware_serial,\"payload\":payload_fields}"
  json_name_key = "app_id"
  tag_keys = ["dev_id", "hardware_serial"]

systemctl restart telegraf
systemctl enable telegraf

echo deb https://packages.grafana.com/oss/deb stable main > /etc/apt/sources.list.d/grafana.list

wget -q -O - https://packages.grafana.com/gpg.key | apt-key add -
apt update
apt install grafana
systemctl daemon-reload
systemctl enable grafana-server
systemctl start grafana-server

References