Zum Inhalt springen

Projekt LoRaWAN: Unterschied zwischen den Versionen

Aus Opennet
Inhalt gelöscht Inhalt hinzugefügt
Leo (Diskussion | Beiträge)
→LoRa Endgeräte: neu: == LoRa Netzwerkkonfiguration ==
Thm (Diskussion | Beiträge)
 
(69 dazwischenliegende Versionen von 4 Benutzern werden nicht angezeigt)
Zeile 1: Zeile 1:
{{team
{{team
|description=LoRa-WAN
|description=LoRaWAN
|nextMeeting=nur bei Bedarf
|nextMeeting=nur bei Bedarf
|members=[[Benutzer:Thm|Thomas]], [[Benutzer:Oyla|Philipp]], [[Benutzer:Josch|Johannes]]
|members=[[Benutzer:Thm|Thomas]], [[Benutzer:Oyla|Philipp]], [[Benutzer:Josch|Johannes]], [[Benutzer:Mathias|Mathias]]
|kontakt=[mailto:crew@list.opennet-iniative.de crew@list.opennet-initiative.de]
|kontakt=[mailto:crew@list.opennet-iniative.de crew@list.opennet-initiative.de]
|logo=projektlorawan.jpg
|logo=projektlorawan.jpg
}}
}}


= Laufende Gateways =
= Knowledge LoRa / LoRaWAN =


Aktueller Status: https://eu1.cloud.thethings.network/console/gateways
== Einsatzmöglichkeiten ==

* Warnemünde Kurpark Lesesaal (Anbindung über Stadt VLAN [https://eu1.cloud.thethings.network/api/v3/gs/gateways/opennet-warnemuende-kurpark/connection/stats Status])
* Hansaviertel Holbeinplatz 14 Bauamt (Anbindung über <OnApStatus>1.164</OnApStatus> [[Projekt_Bauamt]] [https://eu1.cloud.thethings.network/api/v3/gs/gateways/bauamt/connection/stats Status])
* Innenstadt August-Bebel-Straße Hochhaus (Anbindung über <OnApStatus>1.136</OnApStatus> [[Projekt_Philosophische_Fakultät]] [https://eu1.cloud.thethings.network/api/v3/gs/gateways/3133303746006300/connection/stats Status])
* Südstadt Albert-Einstein-Straße 22 Informatik (Anbindung über DSL Uni [[Projekt_AE22]] [https://eu1.cloud.thethings.network/api/v3/gs/gateways/opennet-ae22/connection/stats Status])
* Südstadt Ziolkowskistraße 10 Hochhaus (Anbindung über <OnApStatus>1.245</OnApStatus> [[Projekt_Z10]] [https://eu1.cloud.thethings.network/api/v3/gs/gateways/opennet-ziolkowski10/connection/stats Status])
* Warnemünde IOW (Anbindung über GRE Tunnel und dann <OnApStatus>1.107</OnApStatus> [[Projekt_IOW]] [https://eu1.cloud.thethings.network/api/v3/gs/gateways/opennet-iow/connection/stats Status])
* Schwerin TGZ Haus 5 (Anbindung über <OnApStatus>1.243</OnApStatus>

[https://eu1.cloud.thethings.network/api/v3/gs/gateways/opennet-warnemuende-robbenstation/connection/stats opennet-warnemuende-robbenstation Status]
[https://eu1.cloud.thethings.network/api/v3/gs/gateways/uni-indoor-gateway-ae22/connection/stats uni-indoor-gateway-ae22 Status]

https://grafana.thmcloud.de/d-solo/-FOeBhhVz/opennet?orgId=1&refresh=30s&panelId=11

<OniFrame src="https://grafana.thmcloud.de/d-solo/-FOeBhhVz/opennet?orgId=1&refresh=30s&panelId=11" width="640" height="480" frameborder="0"></OniFrame>
<OniFrame src="https://grafana.thmcloud.de/d-solo/-FOeBhhVz/opennet?orgId=1&refresh=30s&panelId=12" width="640" height="480" frameborder="0"></OniFrame>

= Einsatzmöglichkeiten =


* Low Energy, low throughput, high bandwidth, long range Übertragung
* Low Energy, low throughput, high bandwidth, long range Übertragung
Zeile 17: Zeile 35:
* https://www.youtube.com/watch?v=3cIGzwH-NI8
* https://www.youtube.com/watch?v=3cIGzwH-NI8


== Protokoll ==
= Netzstruktur =

[[Datei:lorawanclasses.png|mini|LoRaWAN Klassen (ausLoRaWAN Backend Interfaces 1.0 Specification)]]

* Layer 1 - Chirp Spread Spectrum
** https://de.wikipedia.org/wiki/Chirp_Spread_Spectrum
** In Europa Frequenzen 433 MHz (ISM-Band Region 1) und 868 MHz (SRD-Band Europa)
** Reichweiten von 2 km (Stadtgebiet) über 15 km (Vororte) bis zu 40 km (ländliche Gebiete)

* Layer 2
** Bi-directional end-devices (Class A): End-devices of Class A allow for biirectional communications whereby each end-device’s uplink transmission is followed by two short downlink receive windows. The transmission slot scheduled by the end-device is based on its own communication needs with a small variation based on a random time basis (ALOHA-type of protocol). This Class A operation is the lowest power end-device system for applications that only require downlink communication from the server shortly after the end-device has sent an uplink transmission. Downlink communications from the server at any other time will have to wait until the next scheduled uplink.
** Bi-directional end-devices with scheduled receive slots (Class B): End-devices of Class B allow for more receive slots. In addition to the Class A random receive windows, Class B devices open extra receive windows at scheduled times. In order for the End-device to open its receive window at the scheduled time, it receives a time synchronized Beacon from the gateway.
** Bi-directional end-devices with maximal receive slots (Class C): End-devices of Class C have nearly continuously open receive windows, only closed when transmitting. Class C end-device will use more power to operate than Class A or Class B but they offer the lowest latency for server to end-device communication.

* Layer 3
** https://www.lora-alliance.org/for-developers
** LoRa-WAN ist eine Möglichkeit, ein [https://de.wikipedia.org/wiki/Low_Power_Wide_Area_Network Low Power Wide Area Network] zu errichten


[[Datei:LoRaWAN-NRM.png|mini|LoRaWAN Network Reference Model (NRM), roaming End-Device (aus LoRaWAN Backend Interfaces 1.0 Specification)]]
[[Datei:LoRaWAN-NRM.png|mini|LoRaWAN Network Reference Model (NRM), roaming End-Device (aus LoRaWAN Backend Interfaces 1.0 Specification)]]


* Opennet stellt Radio Gateways auf und sorgt für Internet-Anbindung.
= LoRaWAN bei Opennet =
* Radio Gateway kommuniziert über Internet mit Network Server von The Things Network (https://www.thethingsnetwork.org).
* Network Server steuert Teilnahme am Netzwerk (mit Hilfe des Join Servers), verteilt Uploads an Application Server und ist Scheduler für Downloads.
* Application Server empfängt Nutzlast von den Mobilen Geräten. In den meisten Fällen bei The Things Network. Dann Weiterleitung z.B. über MQTT.


= Plan =
== Nutzen für Opennet ==


* Bereitstellen eines Community LoRaWANs in Rostock und Schwerin
* Neues Projekt
* [[:Datei:LoRaWAN Opennet.pdf | FAQ zum Verschicken an Standort-Überlasser]]
* Bereitstellen eines Community LoRaWANs in Rostock und ggfs. sonstwo
* Eigene Nutzungsmöglichkeiten
** Anwendungen vor allem Sensordaten erfassen, Fernsteuern, Überwachen [[Datei:esp32lora.jpg|mini|ESP32 mit LoRa Transceiver, WLAN]]
** Gateways ab 100,-EUR ohne Outdoor-Gehäuse und Antennen
** Eigene Clients zum Basteln je nach Anwendung


== Standorte ==
= How To =
== Gateway aufbauen ==


=== Hardware für Selbstbau Standard-Gateway ===
Bei 2km Reichweite in Städten würden wir mit den ersten drei Gateways schon die komplette Innenstadt abdecken.


<gallery widths=300px heights=200px mode="packed">
[[Datei:LoRaWAN.jpg|mini|Verteilung möglicher Gateways.]]
Datei:Lorawanradio2.jpg
</gallery>


==== Teileliste ====
Das erste Radio-Gateway hängt seit Anfang Mai auf Z10.


* [https://www.raspberrypi.com/products/ Raspberry Pi 3 B] oder besser
[[Datei:LoRaWANZ10.jpg|mini|Erstes Gateway auf Z10.]]
* [https://wiki.seeedstudio.com/WM1302_module/ Seeed WM1302] LoRaWAN Concentrator mit SPI
* [[Projekt_LoRaWAN#PCB_Layout_f.C3.BCr_Adapter_Pi_Header_nach_mPCIe |Adapter Pi Header nach mPCIe]]
* [https://www.mini-box.com/ALIX-boxes Gehäuse mini-box Alu Druckguss]
* [https://www.amazon.de/gp/product/B09Q4ZX2GG/ Antenne]
* [https://www.amazon.de/VARIA-Group-Pigtail-N-Buchse-U-FL-Stecker/dp/B01MTQGJP8/ Pigtail u.fl nach N-Stecker]
* [https://www.amazon.de/gp/product/B0832QR4NG/ PoE Splitter (802.1af, nicht passiv) nach USB]
* [https://www.amazon.de/dp/B09QKD2N5X/ Schrauben und Spacer]
* [https://www.amazon.de/dp/B085WFH7WR/ Montage-Platte] - oder als [[#Baseplate|3D-Modell zum Ausdrucken]]


[[LoRaWAN-GW-Schritt-für-Schritt|Alte Schritt-für-Schritt-Anleitung für ein Gateway mit IMST iC880A-SPI]].
== Plan / Offene Fragen ==


==== PCB Layout für Adapter Pi Header nach mPCIe ====
* Gateways aufstellen
* LoRaWAN Network Server bereitstellen
* Eventuell Anbindung an The Things Network oder eigene Systeme aufbauen
* Standorte so planen, dass gesamte Stadt abgedeckt wird
* Adressen und Einbindung in Opennet Netzwerkstruktur besprechen


<gallery widths=300px heights=200px mode="packed">
== Ausprobierte Hardware ==
Datei:Lorawanmpcie.gif
Datei:PiHatLoRaWAN.png
Datei:LoRaWAN Pi Hat auf Pi.jpg
</gallery>


* [[Media:LoRaWAN Hat.zip|Download des PCB Layouts für KiCAD]]
* Unser erstes Gateway soll so aussehen: https://github.com/ttn-zh/ic880a-gateway/wiki
* Teileliste:
* Ein iC880A-SPI-Board - LoRaWAN Concentrator 868 MHz haben wir schon im Gehäuse - http://shop.imst.de/wireless-modules/lora-products/8/ic880a-spi-lorawan-concentrator-868-mhz [[Datei:prototyplora.jpg|mini|Prototyp eines LoRa-Gateways mit Raspberry Pi und LoRaWAN Concentrator (8 Kanäle) iC880A-SPI]]
** [https://www.digikey.com/en/products/detail/molex/0480994000/2405320 Molex 480994000 Edge Connector] - [https://jlcpcb.com/partdetail/MOLEX-480994000/C492353 JLCPCB Teilenummer C492353]
* Antenne mit N-Stecker für 868 MHz selbst gebaut - siehe Foto [[Datei:loraantenne.jpg|mini|Selbstgebaute Groundplane-Antenne für 868 MHz und 50 Ohm Impedanz.]]
** [https://www.digikey.de/de/products/detail/molex/0679105700/3044373 Molex 679105700 mPCIe SMD Adapter] - [https://jlcpcb.com/partdetail/Molex-679105700/C277606 JLCPCB Teilenummer C277606]
* https://www.amazon.de/MakerHawk-Entwicklungsbrett-Bluetooth-Doppelkern-0-96inch/dp/B076T28KWG
** Stiftleiste (2 x 20 Pins 2,54 mm weiblich)
* Die Teile lassen sich auch einfach selbst löten (SMD)


==== Baseplate ====
* Fotos in der Gallery https://www.opennet-initiative.de/gallery/technik/Boards-Ger-te/LoRaWAN-Gateway


<gallery widths=300px heights=200px mode="packed">
== LoRa Endgeräte ==
Datei:Baseplate.jpg
Datei:Baseplate3D.png
</gallery>


* [[:Datei:BaseplateA.stl.zip|3D-Modell als STL zum Ausdrucken oder Fräsen]]
* Ein auf [https://www.espressif.com/en/products/hardware/esp32/overview ESP32] basierendes Developer Board dient zur Demonstration der Fähigkeiten von LoRa
* [[:Datei:Baseplate3D.f3d.zip|Quellformat als Fusion 360 3D-Modell]]
* [[LoRaSensor| Anleitung zum Nachbau gibt es hier]]


=== Software ===
== LoRa Netzwerkkonfiguration ==


Bewährt hat sich [https://www.thethingsindustries.com/docs/gateways/concepts/lora-basics-station/ BasicStation] ([https://github.com/lorabasics/basicstation Source bei Github]) als Software für das Radio Gateway, am einfachsten als Docker Container.
Folgenden Schritte haben wir unternommen damit alles funktionierte:


* Pi Image auf SD Karte (64 bit ist ok, wenn Basic Station im Container läuft)
Geräte:
* Raspberry konfigurieren
* AP1.52 (hat auf eth0 192.168.11.52)
** Nutzer und Passwort (nicht mehr default)
* LoRaWan GW: 192.168.5.30 (siehe Adressschema)
** SSH, SPI und I2C aktivieren
** Netzwerk konfigurieren (DHCP sollte es tun)
* Docker installieren
* Docker Compose installieren
* Docker Container xoseperez/basicstation installieren
* EUI des Gateways ermitteln
* Gateway bei The Things Network registrieren
* API Token generieren
* docker-compose.yml anpassen (Key eintragen, ggfs. EUI und Chipsatz)


Dich wichtigsten Schritte finden sich in der [https://github.com/xoseperez/basicstation Beschreibung des Containers].
* Netzwerkkonfiguration in /etc/network/interfaces


== LoRaWAN Endgeräte ==
# Ethernet
auto eth0
allow-hotplug eth0
iface eth0 inet static
address 192.168.5.30
netmask 255.255.0.0
gateway 192.168.11.52


* Ein auf [https://www.espressif.com/en/products/hardware/esp32/overview ESP32] basierendes Developer Board dient zur Demonstration der Fähigkeiten von LoRa
# add nameserver routes
* [[LoRaSensor| Anleitung zum Nachbau gibt es hier]]
dns-nameservers 192.168.0.246 192.168.0.247 192.168.0.248
up ip route add 192.168.0.246 dev eth0 via 192.168.11.52
down ip route del 192.168.0.246 dev eth0 via 192.168.11.52
up ip route add 192.168.0.247 dev eth0 via 192.168.11.52
down ip route del 192.168.0.247 dev eth0 via 192.168.11.52
up ip route add 192.168.0.248 dev eth0 via 192.168.11.52
down ip route del 192.168.0.248 dev eth0 via 192.168.11.52

* Konfiguration des TTN Gateways (unter anderem, welcher TTN Server genutzt werden soll)

/opt/ttn-gateway/global_conf.json

* Status des Gateway abfragen:

service ttn-gateway status

* AP1.52
** HNA 192.168.5.30 eintragen
** hier Masquerade für HNA konfigurieren (siehe [Opennet_Firmware_f%C3%BCr_Fortgeschrittene#HNA.2FNAT_Konfigurieren_f.C3.BCr_Nicht-OLSR-Nachbarn]

* UGW Server: Forward für TTN Router (router.eu.thethings.network 52.169.76.203) immer erlauben


= Merkzettel =
= Merkzettel =

Aktuelle Version vom 21. Mai 2024, 12:10 Uhr

Team

Projekt LoRaWAN
Treffen: nur bei Bedarf
LoRaWAN
Mitglieder:
Thomas, Philipp, Johannes, Mathias
Kontakt:
crew@list.opennet-initiative.de


Laufende Gateways

Aktueller Status: https://eu1.cloud.thethings.network/console/gateways

  • Warnemünde Kurpark Lesesaal (Anbindung über Stadt VLAN Status)
  • Hansaviertel Holbeinplatz 14 Bauamt (Anbindung über <OnApStatus>1.164</OnApStatus> Projekt_Bauamt Status)
  • Innenstadt August-Bebel-Straße Hochhaus (Anbindung über <OnApStatus>1.136</OnApStatus> Projekt_Philosophische_Fakultät Status)
  • Südstadt Albert-Einstein-Straße 22 Informatik (Anbindung über DSL Uni Projekt_AE22 Status)
  • Südstadt Ziolkowskistraße 10 Hochhaus (Anbindung über <OnApStatus>1.245</OnApStatus> Projekt_Z10 Status)
  • Warnemünde IOW (Anbindung über GRE Tunnel und dann <OnApStatus>1.107</OnApStatus> Projekt_IOW Status)
  • Schwerin TGZ Haus 5 (Anbindung über <OnApStatus>1.243</OnApStatus>

opennet-warnemuende-robbenstation Status uni-indoor-gateway-ae22 Status

https://grafana.thmcloud.de/d-solo/-FOeBhhVz/opennet?orgId=1&refresh=30s&panelId=11

<OniFrame src="https://grafana.thmcloud.de/d-solo/-FOeBhhVz/opennet?orgId=1&refresh=30s&panelId=11" width="640" height="480" frameborder="0"></OniFrame> <OniFrame src="https://grafana.thmcloud.de/d-solo/-FOeBhhVz/opennet?orgId=1&refresh=30s&panelId=12" width="640" height="480" frameborder="0"></OniFrame>

Einsatzmöglichkeiten

Netzstruktur

LoRaWAN Network Reference Model (NRM), roaming End-Device (aus LoRaWAN Backend Interfaces 1.0 Specification)
  • Opennet stellt Radio Gateways auf und sorgt für Internet-Anbindung.
  • Radio Gateway kommuniziert über Internet mit Network Server von The Things Network (https://www.thethingsnetwork.org).
  • Network Server steuert Teilnahme am Netzwerk (mit Hilfe des Join Servers), verteilt Uploads an Application Server und ist Scheduler für Downloads.
  • Application Server empfängt Nutzlast von den Mobilen Geräten. In den meisten Fällen bei The Things Network. Dann Weiterleitung z.B. über MQTT.

Plan

How To

Gateway aufbauen

Hardware für Selbstbau Standard-Gateway

Teileliste

Alte Schritt-für-Schritt-Anleitung für ein Gateway mit IMST iC880A-SPI.

PCB Layout für Adapter Pi Header nach mPCIe

Baseplate

Software

Bewährt hat sich BasicStation (Source bei Github) als Software für das Radio Gateway, am einfachsten als Docker Container.

  • Pi Image auf SD Karte (64 bit ist ok, wenn Basic Station im Container läuft)
  • Raspberry konfigurieren
    • Nutzer und Passwort (nicht mehr default)
    • SSH, SPI und I2C aktivieren
    • Netzwerk konfigurieren (DHCP sollte es tun)
  • Docker installieren
  • Docker Compose installieren
  • Docker Container xoseperez/basicstation installieren
  • EUI des Gateways ermitteln
  • Gateway bei The Things Network registrieren
  • API Token generieren
  • docker-compose.yml anpassen (Key eintragen, ggfs. EUI und Chipsatz)

Dich wichtigsten Schritte finden sich in der Beschreibung des Containers.

LoRaWAN Endgeräte

Merkzettel

Hardware

Gateways

Endgeräte

Server-Software

Sonstiges