Closed mbgg closed 5 years ago
@mbgg What do you expect as payload? Tried: test 0x1 1h
But the program is just responding with:
error: argument --payload/-p: invalid hex value:
you are right. I'll fix that and send a new pull request.
You can also just fix it in your branch. It will automatically updated in this PR.:)
Changes in this version:
@mbgg Wouldn't make it sense to use ascii which is then converted to hex?
@Citrullin we convert ascii to int in the argparse type lambda. Problem is, that I didn't find how to print hex values using %.16x, that's why I store it as int. BTW casts to int in line 46-50 shouldn't be needed anymore.
@Citrullin any comments on that?
@mbgg I am going to take a look into it .
In the example. I would send a string of hex representing three channels all Cayenne encoded: 1. Temperature at 20 deg c 2. Humidity 50% and 3. GPS location for Beaverton. OR. Stretch goal: a.couple of switches on the Cayenne console turn on and off the LEDs on the LoStik.
It's very easy to setup a LoStik app on TTN and set its integration to Cayenne. It's also not hard to setup Cayenne.
The other example would build an IFTTT example.
lorawan_sender.py: error: argument --appkey/-a: invalid <lambda> value: '7929233E8412329F0D9B2B20FF92043F'
Command used:
./lorawan_sender.py --appkey 7929233E8412329F0D9B2B20FF92043F --appeui [APP_EUI] --deveui [DEVEUI] --payload A1F3
I found out recently that I was not getting emails with PR requests / github issues recently 👎 I'm in the midst of moving right now, but plan to get this tested and merged in before the new year. Thanks for the PR and I'm sorry it's taken so long for me to take a look at it.
./lorawan_sender.py --appkey 7929233E8412329F0D9B2B20FF92043F --appeui [APP_EUI] --deveui [DEVEUI] --payload A1F3
you have to pass hexadecimal values using 0x prefix
I just found the code that I had written to do LoRaWAN and created another PR here https://github.com/lolsborn/LoStik/pull/6 to compare. I haven't had time to compare against your work, but my code does handle both otaa and abp and I've admittedly tested mostly abp. When I get some time this week I'll compare them a bit closer and hopefully combine the best of them.
The following Cayenne encoded payload sends two channels - temperature 17.0C and humidity 57%: 016700AA026872
01 - channel 1 67 - temperature 00AA - 170 = 17.0 degrees C 02 - channel 2 68 - humidity 72 - 57 %
If you set your payload format to Cayenne LLP and add Cayenne as an integration type, you can quickly build a Cayenne dashboard to show the data.
I'm not merging this PR, but it was used along with the prior LoRaWAN branch I had started to provide the current example script which I know people have used successfully and I have been bug-fixing. I appreciate the work here and did use bits of the code as reference to see how other people had implemented things.
This adds a small program to show how to connect the device to The Things Network backend.