mirror of
https://github.com/tinygo-org/drivers.git
synced 2026-08-08 17:03:39 +00:00
lorawan cleanup and optimizations:
- Remove all default loraconf default initialisation in lorawan examples (Region Settings takes care of this now) - Remove retries while receiving JoinAccept and increase LoraRX to 10s (no need to wait more than 10s) - Add constants for RegionSetting default frequencies - Standardize all lora default configurations in lora examples - Add new AT+LW=NET,(ON|OFF) command in atcmd example
This commit is contained in:
committed by
deadprogram
parent
4e687b29c3
commit
fa0cf6ec7f
@@ -39,3 +39,14 @@ Builds/flashes atcmd console application on Lora-E5 using onboard SX126x.
|
||||
tinygo flash -target lorae5 ./examples/lora/lorawan/atcmd/
|
||||
```
|
||||
|
||||
## Joining a Public Lorawan Network
|
||||
|
||||
```
|
||||
AT+ID=DevEui,0101010101010101
|
||||
AT+ID=AppEui,0123012301230213
|
||||
AT+KEY=APPKEY,AEAEAEAEAEAEAEAAEAEAEAEAEAEAAEAE
|
||||
AT+LW=NET,ON
|
||||
AT+JOIN
|
||||
```
|
||||
|
||||
AT+LW=NET,(ON|OFF) command changes Lora Sync Word to connect on public network(ON) or private networks(OFF)
|
||||
|
||||
@@ -337,6 +337,19 @@ func delay(setting string) error {
|
||||
|
||||
func lw(setting string) error {
|
||||
cmd := "LW"
|
||||
|
||||
param, val, hasComma := strings.Cut(setting, ",")
|
||||
if hasComma {
|
||||
if param == "NET" {
|
||||
if val == "ON" {
|
||||
lorawan.SetPublicNetwork(true)
|
||||
println("SET PUBLIC NET")
|
||||
} else {
|
||||
lorawan.SetPublicNetwork(false)
|
||||
println("SET PRIVATE NET")
|
||||
}
|
||||
}
|
||||
}
|
||||
writeCommandOutput(cmd, setting)
|
||||
|
||||
return nil
|
||||
|
||||
Reference in New Issue
Block a user