Helium Mapper & Cargo MicroPython LoRaWAN Node
อุปกรณ์ที่ใช้
- ESP32 NODEMCU ESP-32S V1.1 101010 ผู้เขียนเลือกใช้รุ่นนี่เนื่องจากความกว้างของตัว PCB ไม่กว้างมากเมื่อใช้เสียบทดสอบ Breadboard จะมี Pin ด้านข้างเหลือช่องไว้หนึ่งช่อง
- GPS Module NEO-6M หรือจะใช้ GPS + BDS Beidou ATGM336H ซึ่งมีขนาดเล็กกว่าก็ได้
- LoRaWAN มอดูล Maxiiot DL7612-AS923-TH เป็นมอดูล LoRaWAN ที่ใช้ AT Command
- จอ OLED สีขาว 0.96 inch 128X64
ซอฟท์แวร์ที่ใช้
รูปด้านบนเป็นตัว Prototype ของผู้เขียนที่ใส่อุปกรณ์มากกว่าที่ใช้ในบทความนี้
ตัวอย่างการเชื่อมต่อ
จอ OLED ขา SCL ต่อ GPIO22, ขา SDA ต่อ GPIO21
Module DL7612-AS923-TH ใช้ UART2 ขา RX ต่อ GPIO16 ขา TX ต่อ GPIO17
Module GPS ขา TX ต่อ GPIO12 ขา RX ต่อ GPIO25 เป็นต้น
บทความนี้เขียนเพื่อเป็นตัวอย่างแสดงวิธีการสร้าง Node โดยใช้ภาษา MicroPython เพื่อใช้กับ Cargo, Mapper ของ Helium People Network หรือ Mapper ของ TheThingsNetwork เบื้องต้นเท่านั้น ผู้สนใจสามารถนำไปดัดแปลงแก้ไขให้ตรงตามความต้องการใช้งานได้ตามต้องการ
ติดตั้ง MicroPython บน ESP32 ลงใส่ Lib และลงโปรแกรมต่อไปนี้
Code นี้ยังใช้ค่าตัวแปรสมมุติบางค่า เช่น Voltage ของ bat ที่เหลืออยู่
ส่วนค่า Lat,Long,speed ได้จาก GPS โดย speed มีหน่วยเป็น MPH (Cargo แสดงเป็น MPH)
ใช้ console.helium.com ( ไม่ใช่ https://staging-console.helium.wtf/)
Add Device
หลัง Add อาจต้องรอถึง 20 นาทีจนระบบ Process ให้
Add Function
Copy Code ดังต่อไปนี้ใส่ใน Function ตั้งชื่อไว้ว่าชื่อ GPS
ข้อมูลทดสอบ Function เช่น
030023009da8d200d0affd05
ตัวอย่างผลการ Decode ของ Functions
เช่น
Add Integration
คลิกบวกมุมขวาล่าง
- สำหรับใช้งาน cargo เลือกอันแรก Helium Cargo
- สำหรับใช้งาน mapper เลือก http Integration
ใส่ URL ด้านล่าง
https://mappers.helium.com/api/v1/ingest/uplink
Add Flow
เพิ่ม Block ที่ใช้งาน แล้วเชื่อม device, Function, Integration เข้าหากัน ตามรูป
กลับไปดูที่ Device พบว่าหากข้อมูลส่งจากตัว Node และทำงานถูกต้องและส่งผ่านถึง Integration Cargo, Mapper ไม่ผิดพลาดจะเห็น Real Time Packet เป็นจุดสีฟ้าบน graph
ดูข้อมูลโดยเปิด cargo.helium.com เลือก Device Name ที่เราลงทะเบียนไว้ จะเห็นจุดตำแหน่ง GPS บนแผนที่ กรณีที่ Node รับสัญญาณจากดาวเทียมและส่งเข้า Cloud Helium และส่งข้อมูลเข้า Cargo ถูกต้อง
จุดสีฟ้าคือตำแหน่งที่อุปกรณ์ ตัวอย่าง ชื่อ Device witeboard อยู่
เปิด Mapper.helium.com
คลิกตำแหน่งที่เป็นสีเขียว จะเห็นว่าจุดดังกล่าว ส่งสัญญาณไปถึง gateway ตัวไหน ตามภาพเป็นข้อมูลจำลอง
ถ้ามี Display OLED SSD1306 อาจเลือกใช้ Code ดังต่อไปนี้แทน
หน้าจอ OLED จะแสดงตามตัวอย่าง เช่น
หากต้องการดูความเข้มสัญญาณระหว่าง Gateway มายังโหนดให้ใช้ Code ดังต่อไปนี้
จะเห็นค่า RSSI อีกหน้าจอ หากติดลบน้อยๆ จะแสดงว่าสัญญาณเข้ม
Reference
- https://news.rakwireless.com/make-a-helium-mapper-with-the-wisblock/
- https://www.heliumact.com.au/2021/10/01/using-the-helium-network-building-a-helium-enabled-mapper-part-1/
- https://github.com/hkicko/CubeCell-GPS-Helium-Mapper
- https://github.com/jas-williams/CubeCell-Helium-Mapper
- https://docs.helium.com/use-the-network/console/integrations/cargo/
- https://docs.helium.com/use-the-network/coverage-mapping/mappers-quickstart/
- Mapper API Decoder
https://docs.helium.com/use-the-network/coverage-mapping/mappers-api/ - https://medium.com/@JoooostB/how-i-send-my-first-lorawan-message-to-the-things-network-using-a-ttgo-esp32-micropython-a3fe447fff82
ใครสนใจใช้ Tbeam ทำโดยใช้ภาษา C/C++ ลองดู
https://github.com/Max-Plastix/tbeam-helium-mapper
https://github.com/tmiklas/tbeam-helium-mapper
https://github.com/hereismeaw/ttgo-tbeam-ttn-tracker
https://github.com/palbeda/Lora-TTNMapper-T-Beam
https://github.com/hottimuc/Lora-TTNMapper-T-Beam
https://github.com/MichaelEFlip/Lora-TTNMapper-T-Beam
https://github.com/radforschung/Lora-TTNMapper-T-Beam
https://github.com/PA4WD/Lora-TTNMapper-T-Beam
https://github.com/r8420/Lora-TTNMapper-T-Beam
https://github.com/pulento/Lora-TTNMapper-T-Beam
https://github.com/DeuxVis/Lora-TTNMapper-T-Beam
https://github.com/sbiermann/Lora-TTNMapper-ESP32
https://github.com/pamribeirox/Lora-TTNMapper-T-Beam
https://github.com/noppingen/Lora-TTNMapper-T-Beam-v10
https://github.com/Edzelf/LoRa
https://github.com/FabTangi/ttgo-ttn-ds18b20
https://github.com/tekk/TTGO-T-Beam-Car-Tracker
https://codeberg.org/Gruenstreifen-eV/ttgo-tbeam-ttn-Sensor
https://github.com/hereismeaw/ttgo-tbeam-ttn-tracker
https://github.com/dermatthias/Lora-TTNMapper-T-Beam
https://github.com/xoseperez/ttgo-beam-tracker
https://github.com/kizniche/ttgo-tbeam-sensor-node-bme280
https://github.com/FrankUlbrich/Lora-TTNMapper-T-Beam
https://github.com/Bjoerns-TB/Lora-TTNMapper-T-Beam
https://github.com/hottimuc/Lora-TTNMapper-T-Beam
https://tz.liuqiufeng.com/kizniche/ttgo-tbeam-ttn-tracker
https://githubplus.com/kizniche/ttgo-tbeam-sensor-node-bme280