Freenerding: Eine NB-IoT LTE pi Suppe kochen - IoT Signalerfassung mit dem pi zero WH und uplink zu 1NCE

in #deutsch4 years ago

Heute bin ich ein idIoT und habe vor, ein paar Sachen zusammenzustecken, die schon länger rumliegen, um einen kleinen mobilen connected Sensor zu bekommen.
Ganz ohne Sinn und Ziel ist das nicht, denn für ein Kundenprojekt brauche ich auch ein Monitoring von Umgebungsparametern "draußen im Feld".

Die Zutaten:

je 1x

  • pi zero WH
  • Waveshare SIM7020X NB-IoT HAT (extra dafür gekauft)
  • az-delivery 18650 Holder (seit einem der letzten Freenerdings bewährt und nun im Standardbaukasten)
  • 1NCE SIM Karte (die hatte ich eigentlich in einem Particle Boron LTE einsetzen wollen, nur um nach zwei frustrierenden Nachmittagen einsehen zu müssen, dass das Boron schlicht nicht im Telekom NB-IoT Netz eingesetzt werden kann) mit 500MB 10 Jahre lifetime Datenpaket
  • pimoroni Enviro pHAT (leider discontinued, war eine schöne Sensor-Einsteigerplatine)
  • GPIO Expansion Board
    um zwei pHATs gleichzeitig stecken zu können; es dupliziert nur die GPIO-Pins, erweitert keine GPIOs, hier ist das egal, denn das IoT pHAT braucht nur die seriellen Pins und läßt I²C und SPI für die Sensorkarte frei
  • 64GB sd-Karte (viel hilft viel, groß kostet kaum mehr als klein)

Das Rezept:
Zuerst brate man die SD-Karte unter leichtem Rühren mit dem neuesten RaspiOS Image scharf an, füge eine Prise wpa_supplicant.conf und ssh bei.
Dann gebe man unter Beachtung der richtigen Polung die pHATs hinzu und veredle die NB-IoT Platine mit der SIM. Eine 18650 Zelle gibt den Saft.

Den ersten Boot beobachte man kritisch am HDMI Display, um ggf. nachzuwürzen.
Man lasse das pi ein paar Minuten auf kleiner Wifi-Anbindung (seine Updates) ziehen und studiere derweil die Hersteller Wikis.
idIoTbootet.jpg

Man aktiviere den serial port, deaktiviere die serielle Konsole und reboote.
Und fluche. Das Viech redet nicht mit mir.
Die beiden gelben Jumper die ab Werk stecken, müssen raus. Manchmal muss man auch noch den Taster auf dem Board drücken. Dann kommt es hoch und redet in einem Screen mit mir. In Form von AT Kommandos. Das ist soooo 90er, aber nur so kriegt man das Ding konfiguriert.

screen /dev/ttyAMA0 9600

AT+CGMR
1752B12SIM7020E
OK
AT*MCGDEFCONT="IP","iot.1nce.net"
OK
AT+CBAND=8!
OK
AT+CGDCONT=1,"IP","iot.1nce.net"
OK

Und so weiter. Mich käst das etwas an und ich suche nach einigen Minuten Frustration im Internet nach Leidensgenossen, weil es einfach nicht mit dem 1NCE Netz verbinden wollte.

Dieses hackster Projekt war dann sehr nützlich:
https://www.hackster.io/hhf/using-sim7020e-to-connect-to-1nce-nb-iot-network-bfd41a

Am Ende ist die "NET" LED auf dem board nicht hilfreich und das Pi lag wohl in einem Homeoffice-Funkloch. Ans Fenster platziert baut es brav eine Session zu 1NCE auf. Nun kann ich per tcp oder MQTT Daten pushen. Das ist schon mal nett und ein guter Abschluss für heute. Später kommt dann ggf. PPP für eine ssh Verbindung dazu und natürlich das Auslesen des enviro-phat.

bis zum nächsten Freenerding!

Sort:  

Congratulations @schlafhacking! You have completed the following achievement on the Hive blockchain and have been rewarded with new badge(s) :

You received more than 3500 upvotes. Your next target is to reach 3750 upvotes.

You can view your badges on your board and compare yourself to others in the Ranking
If you no longer want to receive notifications, reply to this comment with the word STOP

Congratulations @schlafhacking! You received a personal badge!

You powered-up at least 10 HIVE on Hive Power Up Day!
Wait until the end of Power Up Day to find out the size of your Power-Bee.
May the Hive Power be with you!

You can view your badges on your board and compare yourself to others in the Ranking

Do not miss the last post from @hivebuzz:

Hive Power Up Day - Introducing the Power Up Helper!

Congratulations @schlafhacking! You received a personal badge!

You made another user happy by powering them up some HIVE on Hive Power Up Day and got awarded this Power Up Helper badge.

You can view your badges on your board and compare yourself to others in the Ranking

Do not miss the last post from @hivebuzz:

Hive Power Up Day - Introducing the Power Up Helper!

Congratulations @schlafhacking! You received a personal badge!

You powered-up at least 10 HIVE on Hive Power Up Day! This entitles you to a level 1 badge.
Participate in the next Power Up Day and try to power-up more HIVE to get a bigger Power-Bee.
May the Hive Power be with you!

You can view your badges on your board and compare yourself to others in the Ranking

Do not miss the last post from @hivebuzz:

Hive Power Up Day - Introducing the Power Up Helper!