Wireless Lab 1
- 實驗環境
- 硬體版本 : Raspberry Pi 3 Model B+
- 作業系統 : Raspbian 2018-06-27
- LoRa : SX1276晶片
- 實驗目標
- 使用ABP模式傳輸資料
- 並用MQTT取得資料後解碼
Image Not Showing
Possible Reasons
- The image file may be corrupted
- The server hosting the image is unavailable
- The image path is incorrect
- The image format is not supported
Learn More →
實驗結果
- 跑完ABP傳輸模式的流程,傳輸資料時分別使用
Confirm Data
和Unconfirm Data
,截圖樹莓派上的結果,應該會有一個是有ACK一個是沒有ACK的。
- 傳輸資料後用MQTT查看,並用base64解密截圖。
- 以組為單位(一個人上傳即可),將這些截圖結果貼成一個word檔案,命名為
wireless-lab1-groupxx.docx
,並上傳到LMS作業區。
ABP模式送出 (send_ttn.py)
這份程式主要修改來自 jeroennijhof 的程式碼
-
將devAddr,nwkSKey,appSKey填入config.json
中,各組別的key在這裡
-
調整send_ttn.py
主要參數
- Frequency
- Spreading Factor
- Bandwidth
-
fCnt 要隨著傳輸次數增加,Server端收到小於目前記錄的fCnt將會丟棄封包不處理。
-
當切換到MODE.TX
時,送出uplink之後會跳到on_tx_done
-
當接收到downlink時,會跳到on_rx_done
-
執行send_ttn.py
Image Not Showing
Possible Reasons
- The image file may be corrupted
- The server hosting the image is unavailable
- The image path is incorrect
- The image format is not supported
Learn More →
- MIC(Message Integrity Check):
- ACK(Acknowledge):
- 因為傳送的資料格式是
MHDR.CONF_DATA_UP
,所以Downlink中會有ACK回應
- Direction:
- devaddr
使用MQTT查看傳輸到Server的資料
- 請先安裝 MQTT BOX
- 新增 MQTT Client

- 輸入 MQTT server 資訊

- MQTT Client Name :
隨便取
- Protocol :
mqtts/tls
- Username :
engineer
- Host :
mqtt.hscc.csie.ncu.edu.tw:1883
- SSL/TLS Certificate Type :
CA signed server ceritificate
- Password :
nculoraserver
- 新增 Subscriber,並按下subscribe

- 主要格式為
application/[applicationID]/device/[devEUI]/rx
- applicationID : 3
- devEUI : 就是分配到的EUI
- rx : server端收到的
- 送出訊息後查看,
data
使用base64加密,所以要查看原始資料需要用base64解密

- base64解密
