You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
How is it possible to sent something parsed out of a JSON file. How is the correct syntax on having an uplink after a print variable?
On line 9 i have my print function were it prints the output of a JSON file narrowed to what i need. How will i convey this at lora.send without the error of line 20?
Hi @panban-ux
The send command takes byte arrays or strings with strings being the easiest.
You're trying to send a json array, so you'd need to encode it into a more suitable format. Potentially a custom byte array would work such as assigning each key a hex value and then formatting it as keyHex, Value for each one.
Ryanteck i used after this example an:
a=str(counter.most_common())
and then
lora.sent(a)
but still have an error.
How will i Hexify it? The above is a string retain, isnt it?
Thanks for moving the subject
From the image where you print the counter.most_common() part above the LoRa code shows that it's printing if I'm correct a python List with tuples inside of it. You should be able to confirm it if you run type(counter.most_common()) should output the name of the data.
For this type of data I would say you'd need to put together some kind of byte array or custom string as just converting the list to a string would likely be too many characters for LoRa.
I didnt got the type(counter.most_common()).
Anyway either way if i sent an "a" character i get the 61 in the TTN. Hence it encodes it in HEX. Am i wrong?
How is it possible to sent something parsed out of a JSON file. How is the correct syntax on having an uplink after a print variable?
On line 9 i have my print function were it prints the output of a JSON file narrowed to what i need. How will i convey this at lora.send without the error of line 20?
Originally posted by @panban-ux in #21 (comment)
The text was updated successfully, but these errors were encountered: