Meshtastic Python CLI 免寫程式送訊息 --- 範例可以參照我之前的可攜python環境寫一個進批次來跑 [Meshtastic Python 的基礎可攜環境製作](https://hackmd.io/4RhEkBKSSjmRZtN_NQ67cg) 手上已經有兩台 heltec v3,一台用手機app連線,另外一台接電腦連線。 假設我接上電腦,使用的是COM3來做示範... ### 對頻道發送訊息 首先我們可以利用 --info 參數取得大量訊息, python -m meshtastic --port COM3 --info 通常裝置儲存的頻道剛好在最後, 會看到裝置已經存好的頻道, 有channel index 數字的訊息。 假設我想要對MeshTW頻道發送訊息, 剛剛查到你的裝置放在index數字是 1 python -m meshtastic --port COM3 --sendtext "hi python cli" --ch-index 1 手機上連上另外一台的app應該就會看到MeshTW,有訊息hi python cli,來自接上電腦那台發出的。 ### 直接對裝置發訊息(假設裝置 id是 !12345678) python -m meshtastic --port COM3 --sendtext "hi python cli" --dest !12345678 手機上連上另外一台的app應該就會看到來自接電腦的裝置id,有訊息hi python cli。 ### 需要得到回應可以在上述指令加上參數 --ack 可以得到回應結果 顯示等待訊息 Waiting for an acknowledgment from remote node (this could take a while) 如果送達並得到回應 Received an ACK. 如果失敗送達並得到 Received a NAK, error reason: MAX_RETRANSMIT
×
Sign in
Email
Password
Forgot password
or
By clicking below, you agree to our
terms of service
.
Sign in via Facebook
Sign in via Twitter
Sign in via GitHub
Sign in via Dropbox
Sign in with Wallet
Wallet (
)
Connect another wallet
New to HackMD?
Sign up