LoRaWAN/Workshops: Difference between revisions

From The Munich Maker Lab's Wiki
Jump to navigation Jump to search
(updated parts)
 
(5 intermediate revisions by the same user not shown)
Line 1: Line 1:
== Intro To LoRaWAN ==
== Intro To LoRaWAN ==
* [https://www.thethingsnetwork.org/labs/story/creating-a-ttn-node TTN Lab]
* [https://www.tinytronics.nl/shop/nl/communicatie/rf(id)-wifi-bt/things-network-lorawan-node-workshop-2017 Kit for sale]
=== Parts ===
{| class=wikitable
! 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 [https://www.bauhaus.info/schalterdosen-deckel/abzweigdose/p/12165125], [https://www.hornbach.de/shop/Spelsberg-Abzweigkasten-SD7-75x75-mm-33290701/6060827/artikel.html?] || 0,70 ||
|}


== Build your own Gateway ==
== Build your own Gateway ==
* March 10th, 2018
* March 10th, 2018
* August 27th, 2018
* <del>August 27th, 2018</del> September 24th, 2018


=== Parts ===
=== Parts ===
Line 9: Line 29:
! Part !! Partnumber !! Source !! Cost !! Notes
! Part !! Partnumber !! Source !! Cost !! Notes
|-
|-
| LoRaWAN Concentrator || iMST ic880a|| [http://shop.imst.de/wireless-modules/lora-products/8/ic880a-spi-lorawan-concentrator-868-mhz?c=12 iMST] || 142€ + Shipping
| LoRaWAN Concentrator || iMST ic880a|| [http://shop.imst.de/wireless-modules/lora-products/8/ic880a-spi-lorawan-concentrator-868-mhz?c=12 iMST] || 142€ + Shipping ||
|-
|-
| RaspberryPi 3 || || [https://www.reichelt.de/RASPBERRY-PI-3/3/index.html?ACTION=3&LA=0&ARTICLE=164977&artnr=RASPBERRY+PI+3 Reichelt] || 32€
| RaspberryPi 3 || || [https://www.reichelt.de/RASPBERRY-PI-3/3/index.html?ACTION=3&LA=0&ARTICLE=164977&artnr=RASPBERRY+PI+3 Reichelt] || 32€ ||
|-
|-
| Adapter PCB || || Severin || 2€
| Adapter PCB || || Severin || 2€ || https://github.com/ch2i/iC880A-Raspberry-PI
|-
|-
| SD Card || || [https://www.reichelt.de/SD-Karten-Micro-/INTENSO-3413460/3/index.html?ACTION=3&LA=2&ARTICLE=126586&GROUPID=4802&artnr=INTENSO+3413460&trstct=pol_2 Reichelt] || 6,50€
| SD Card || || [https://www.reichelt.de/SD-Karten-Micro-/INTENSO-3413460/3/index.html?ACTION=3&LA=2&ARTICLE=126586&GROUPID=4802&artnr=INTENSO+3413460&trstct=pol_2 Reichelt] || 6,50€ ||
|-
|-
| uFL Pigtail ||  || AliExpress || 3€ (BNC)
| uFL Pigtail ||  || AliExpress || 3€ (BNC) ||
|-
|-
| Antenna || Aurel GP-868 || [https://www.conrad.de/de/antenne-aurel-gp-868-650200599-190123.html Conrad] || 40€
| Antenna || Aurel GP-868 || [https://www.conrad.de/de/antenne-aurel-gp-868-650200599-190123.html Conrad] || 40€ ||
|-
|-
| || [https://www.delock.de/produkt/89583/merkmale.html DELOCK 89583] || [https://www.jacob.de/produkte/delock-lora-868-89583-artnr-3742650.html Jacob], [https://www.ebay.de/itm/lora-868-mhz-antenne-n-buchse-3-dbi-32-cm-starr-mastmontage-weis-outdoor/142635718322?epid=2246854500&hash=item2135c056b2%3Ag%3A540AAOSwUYNaQNnl&_sacat=0&_nkw=868mhz+antenne+outdoor&_from=R40&rt=nc&_trksid=m570.l1313 eBay] || 40€
| || [https://www.delock.de/produkt/89583/merkmale.html DELOCK 89583] || [https://www.jacob.de/produkte/delock-lora-868-89583-artnr-3742650.html Jacob], [https://www.ebay.de/itm/lora-868-mhz-antenne-n-buchse-3-dbi-32-cm-starr-mastmontage-weis-outdoor/142635718322?epid=2246854500&hash=item2135c056b2%3Ag%3A540AAOSwUYNaQNnl&_sacat=0&_nkw=868mhz+antenne+outdoor&_from=R40&rt=nc&_trksid=m570.l1313 eBay] || 40€ ||
|-
|-
| || "Antenne kollinear 868 MHz" || [https://www.ebay.de/usr/stanislavpalo130 eBay Seller] || 30€ || Currently not available -> Mail sent out.
| || "Antenne kollinear 868 MHz" || [https://www.ebay.de/usr/stanislavpalo130 eBay Seller] || 30€ || if it's not available in the shop, send them an email, they'll reply
|-
|-
| Case || [https://rfelements.com/assets/Uploads/Datasheet-StationBox-ALU-1.pdf RF-Elements StationBox ALU (SBX-ALU-6N1E)] || [http://varia-store.com/Zubehoer/Gehaeuse-ohne-Antenne/RF-Elements-StationBox-ALU::2440.html Varia Store] || 32€ || deprecated? Seems to be out of stock everywhere
| Case || [https://rfelements.com/assets/Uploads/Datasheet-StationBox-ALU-1.pdf RF-Elements StationBox ALU (SBX-ALU-6N1E)] || [http://varia-store.com/Zubehoer/Gehaeuse-ohne-Antenne/RF-Elements-StationBox-ALU::2440.html Varia Store] || 32€ || deprecated? Seems to be out of stock everywhere
Line 33: Line 53:
|  || RND 455-00185 || [https://www.reichelt.de/Kunststoffgehaeuse-RND/RND-455-00185/3/index.html?ACTION=3&LA=2&ARTICLE=193399&GROUPID=8042&artnr=RND+455-00185&trstct=pol_78 Reichelt] || 7,50€ || probably not an outdoor case
|  || RND 455-00185 || [https://www.reichelt.de/Kunststoffgehaeuse-RND/RND-455-00185/3/index.html?ACTION=3&LA=2&ARTICLE=193399&GROUPID=8042&artnr=RND+455-00185&trstct=pol_78 Reichelt] || 7,50€ || probably not an outdoor case
|-
|-
| PSU || 30 W, 12 V, 2,5 A || [https://www.reichelt.de/Netzteile-Festspannung/VT-3238/3/index.html?ACTION=3&LA=2&ARTICLE=215627&GROUPID=4950&artnr=VT-3238&trstct=pol_0 Reichelt] || 12€
|  || RND 455-00137 || [https://www.reichelt.de/kunststoffgehaeuse-200-x-120-x-90-mm-ip65-rnd-455-00137-p193351.html?&trstct=pol_15 reichelt] || 9,90€ ||
|-
|  || RND 455-00148 || [https://www.reichelt.de/kunststoffgehaeuse-200-x-120-x-90-mm-ip65-rnd-455-00148-p193362.html?&trstct=pol_5 reichelt] || 6,95€ || Same as above, but without transparent front, used for workshop 2. Works pretty well
|-
|  || WaveArena GOLD ALUBOX || [https://www.wlan-shop24.de/WaveArena-GOLD-ALUBOX-Gehaeuse-Aluminium-Wetterfest-IP65-26-x-20-x-9cm wlan-shop24.de] || 32,99€ || Outdoor case, works great (used in WS2)
|-
| PSU || 30 W, 12 V, 2,5 A || [https://www.reichelt.de/Netzteile-Festspannung/VT-3238/3/index.html?ACTION=3&LA=2&ARTICLE=215627&GROUPID=4950&artnr=VT-3238&trstct=pol_0 Reichelt] || 12€ ||
|}
|}


Line 45: Line 71:
* [https://www.reichelt.de/Buchsenleisten/BL-1X20G8-2-54/3/index.html?ACTION=3&LA=2&ARTICLE=51827&GROUPID=7435&artnr=BL+1X20G8+2%2C54&trstct=pol_0 BL 1X20G8 2,54 :: 20pol. Buchsenleiste, gerade, RM 2,54, H: 8,5mm]
* [https://www.reichelt.de/Buchsenleisten/BL-1X20G8-2-54/3/index.html?ACTION=3&LA=2&ARTICLE=51827&GROUPID=7435&artnr=BL+1X20G8+2%2C54&trstct=pol_0 BL 1X20G8 2,54 :: 20pol. Buchsenleiste, gerade, RM 2,54, H: 8,5mm]
* [https://www.reichelt.de/RND-connect/RND-205-00053/3/index.html?ACTION=3&LA=2&ARTICLE=170241&GROUPID=7552&artnr=RND+205-00053&trstct=pol_2 RND 205-00053 :: Lötbare Schraubklemme - 10-pol, RM 5 mm, 90°]
* [https://www.reichelt.de/RND-connect/RND-205-00053/3/index.html?ACTION=3&LA=2&ARTICLE=170241&GROUPID=7552&artnr=RND+205-00053&trstct=pol_2 RND 205-00053 :: Lötbare Schraubklemme - 10-pol, RM 5 mm, 90°]
* 1N400x diode (MuMa stock)
* Jumper (Severin stock)


=== HowTos ===
=== HowTos ===
* Using resin.io for management
* [https://github.com/galagaking/ttn_nodeworkshop/raw/master/WorkshopTTNOutdoorGatewaybuildinginstructions.docx.pdf JPMeijer's Gateway building description]
* JPMeijer's Gateway building description
** [https://github.com/jpmeijers/ttn-resin-gateway-rpi Sources resin.io application]
** [https://github.com/galagaking/ttn_nodeworkshop/raw/master/WorkshopTTNOutdoorGatewaybuildinginstructions.docx.pdf Documentation]
** resin.io website instructions not quite up to date
** [https://github.com/jpmeijers/ttn-resin-gateway-rpi Sources]
 
== 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 ===
<pre>
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
</pre>
=== TIG Stack ===
<pre>
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
</pre>
 
==== References ====
* https://devconnected.com/how-to-setup-telegraf-influxdb-and-grafana-on-linux/

Latest revision as of 10:38, 18 February 2020

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