ลง ChirpStack Docker บน Ubuntu Virtual Box

Somsak Lima
2 min readNov 1, 2022

--

1.สำหรับบาง PC ให้เข้า BIOS และ Enable Intel Virtualization ใน Advanced Menu กด F10 save แล้ว Reboot ใหม่

2. ติดตั้ง Oracle Virtual Box ให้เรียบร้อย โดย Download จาก https://www.virtualbox.org/wiki/Downloads

คู่มือ https://download.virtualbox.org/virtualbox/7.0.2/UserManual.pdf

เช่น ติดตั้ง VirtualBox-7.0.2–154219-Win.exe เป็นต้น

แต่ต้องติดตั้ง MicroSoft Visual C++ 2019 ก่อน เช่น Download จาก https://aka.ms/vs/17/release/vc_redist.x64.exe

3. สร้าง Virtual Machine และแก้ Network เป็น Bridged Adapter

4.Start VM เลือกบูท จาก ISO File ubuntu-22.04.1-live-server-amd64.iso

ให้เลือก Option Docker ด้วยเมื่อเจอหน้าตามภาพ

5. หลังติดตั้งเสร็จ ก่อนบูทให้ ลบ Storage ที่เป็น ISO ออก เพื่อให้บูทจาก Harddisk

6. บูทเสร็จให้ login ด้วย User/Password ที่ตั้งไว้ตอนติดตั้ง แล้ว update กับ upgrade Software

sudo apt update
sudo apt upgrade

หรือสั่ง upgrade รวดเดียวโดยใช้
sudo apt update -y && sudo apt upgrade -y

7.ติดตั้งโปรแกรมที่มีประโยชน์ ที่ต้องใช้งาน
sudo apt install locate lrzsz mc wget git net-tools

8.ติดตั้ง Portainner
sudo docker pull portainer/portainer-ce

sudo docker run -d — restart always -p 9000:9000 -v /var/run/docker.sock:/var/run/docker.sock -v portainer_data:/data portainer/portainer-ce

เช็ค ip address

เปิดเวป IP:9000 m2mlorawan123

9.ติดตั้ง PIP เพื่อใช้ติดตั้ง docker compose
sudu apt install python3-pip
pip3 — version
sudo pip3 install docker-compose

10.ติดตั้ง Chirpstack บน Docker

ติดตั้งเลยโดย

git clone https://github.com/brocaar/chirpstack-docker.git
cd chirpstack-docker

แก้ความถี่จาก eu868 เป็น as923

nano /home/pi/chirpstack-docker/docker-compose.yml
environment:
- INTEGRATION__MQTT__EVENT_TOPIC_TEMPLATE=eu868/gateway/{{ .GatewayID }}/event/{{ .EventType }}
- INTEGRATION__MQTT__STATE_TOPIC_TEMPLATE=eu868/gateway/{{ .GatewayID }}/state/{{ .StateType }}
- INTEGRATION__MQTT__COMMAND_TOPIC_TEMPLATE=eu868/gateway/{{ .GatewayID }}/command/#
environment:
- INTEGRATION__MQTT__EVENT_TOPIC_TEMPLATE=as923/gateway/{{ .GatewayID }}/event/{{ .EventType }}
- INTEGRATION__MQTT__STATE_TOPIC_TEMPLATE=as923/gateway/{{ .GatewayID }}/state/{{ .StateType }}
- INTEGRATION__MQTT__COMMAND_TOPIC_TEMPLATE=as923/gateway/{{ .GatewayID }}/command/#

และแก้เพิ่มความถี่ให้ครบ 8 ช่องความถี่

nano /home/pi/chirpstack-docker/configuration/chirpstack/region_as923.toml

เพิ่มตรงด้านล่างสุดของไฟล์

[[regions.network.extra_channels]]
frequency=923600000
min_dr=0
max_dr=5
[[regions.network.extra_channels]]
frequency=923800000
min_dr=0
max_dr=5
[[regions.network.extra_channels]]
frequency=924000000
min_dr=0
max_dr=5
[[regions.network.extra_channels]]
frequency=924200000
min_dr=0
max_dr=5
[[regions.network.extra_channels]]
frequency=924400000
min_dr=0
max_dr=5
[[regions.network.extra_channels]]
frequency=924600000
min_dr=0
max_dr=5

แก้ mqtt Server ถ้าจะใช้ mqtt

nano /home/pi/chirpstack-docker/configuration/chirpstack-gateway-bridge/chirpstack-gateway-bridge.toml
# See https://www.chirpstack.io/gateway-bridge/install/config/ for a full
# configuration example and documentation.
[integration.mqtt.auth.generic]
servers=["tcp://mosquitto:1883"]
username=""
password=""

เสร็จแล้วสั่งเริ่มสร้าง Container

cd /home/pi/chirpstack-docker/
sudo docker-compose up -d

เรียกใช้ Chirpstack ที่ Port:8080
admin/admin

Ref.

https://roboticsbackend.com/install-raspbian-desktop-on-a-virtual-machine-virtualbox/#Download_Raspberry_Pi_OS_Desktop_ISO

--

--

Somsak Lima
Somsak Lima

Written by Somsak Lima

สนับสนุนและส่งเสริมให้ผู้สนใจสามารถใช้งานเทคโนโลยี LoRa และ LoRaWAN ได้ โดยนำความรู้ที่ได้ไปต่อยอดเพื่อใช้งาน

No responses yet