HERE IS
+EVT:RX_1:-46:10:UNICAST:2:30
In this case, i extracted the 30
LoRaWAN - RAK WIRELESS
- Fernando Perez
- Posts: 378
- Joined: Mon Feb 15, 2021 10:09 pm
- Location: Santander (Spain)
- Has thanked: 195 times
- Been thanked: 267 times
Re: LoRaWAN - RAK WIRELESS
If you want to extract the seventh field from a character string in which the fields are delimited by ":", you can use the Annex word$() statement.
And to change the state of the pins according to the extracted value, I would use SELECT CASE.
But there is something I still don't understand: in your code, the line:
s$= left$(s$, INSTR(1, s$, "+EVT")-1)
It keeps giving me an error, which is logical since instr() will never find the string "+EVT" and will return zero. And zero minus one....
And to change the state of the pins according to the extracted value, I would use SELECT CASE.
Code: [Local Link Removed for Guests]
' r$ = "+EVT:RX_1:-46:10:UNICAST:2:30" ' uncomment for debug
' wlog "r$ = "; r$
' wlog
s$ = word$(r$, 7, ":")
wlog s$
SELECT CASE s$
CASE "31" : pin(23) = 1
CASE "32" : pin(19) = 1
CASE "33" : pin(18) = 1
CASE "34" : pin(5) = 1
CASE "35" : pin(23) = 0
CASE "36" : pin(19) = 0
CASE "37" : pin(18) = 0
CASE "38" : pin(5) = 0
END SELECT
s$= left$(s$, INSTR(1, s$, "+EVT")-1)
It keeps giving me an error, which is logical since instr() will never find the string "+EVT" and will return zero. And zero minus one....
Re: LoRaWAN - RAK WIRELESS
hi
getting this
+EVT:TX_DONE
+EVT:RX_1:-48:9:UNICAST:3:31
+EVT:LINKCHECK:0:24:1:-48:9
Package Sent
31
+EVT <--------- ???
Thanks to the help!
getting this
+EVT:TX_DONE
+EVT:RX_1:-48:9:UNICAST:3:31
+EVT:LINKCHECK:0:24:1:-48:9
Package Sent
31
+EVT <--------- ???
Thanks to the help!
Re: LoRaWAN - RAK WIRELESS
I forgot to say to you that those messages comes only one message (not separeted by 13,10) on received uart buffer...i dont now why...maybe is the loRa Radio that is not sending the UNICAST message with 13,10
+EVT:RX_1:-48:9:UNICAST:3:31
+EVT:LINKCHECK:0:24:1:-48:9
+EVT:RX_1:-48:9:UNICAST:3:31
+EVT:LINKCHECK:0:24:1:-48:9