Hi Brian,
Yes I got it working just fine.
Congratulations
It took me several months to change over to V3 as I had to modify the original Dragino code to handle MAC command handling because the original coder stopped developing just before V3 kicked in.
I feel your pain and great work updating the code.
You can find my modded version of the Python code here:-
BNNorman/dragino-1: LoRaWAN implementation in python (github.com)
Awesome. This code made my day. Together with this GitHub comment on how to configure the SPI bus, I finally got to a stage where there seems to be some actual communication between the Pi and the Dragino board. This feels like a big step forward.
Unfortunately, nothing is showing up on the TTN console yet, but there could be many reasons for that.
The closest gateway is 8km from my location and I have no idea whether I would be able to reach and connect to it. My plan is to set up my own gateway, but I am waiting for parts. With my own gateway, it hopefully will be easier to see whether and what gets send/received.
I believe the V3 console now generates deveui etc for you so I wasted money buying the eeprom memory chips
LOL. So yes, a DevEUI gets generated, together with an AppEUI and AppKey. However, I have a few questions about this. Maybe you can help?
So I got AppEUI, DevEUI and AppKey. The AppEUI are only ‘0’ though. It was set to this value when I generated the device. Does that sound right?
Then you need to modify dragino.toml to configure it for you use case.
Ok, so I am wondering what I need to set when it comes to these key and id parameters. The toml file contains:
[TTN.OTAA]
# received session key values are stored by MAChandler
# enter your OTAA keys here
deveui = [0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00]
appeui = [0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00]
appkey = [0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00]
devaddr= [0x00, 0x00, 0x00, 0x00] # not joined
[TTN.ABP]
# enter your device ABP key values below
devaddr = [0x00,0x00,0x00,0x00]
newskey = [0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00]
appskey = [0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00]
appkey = [0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00]
appeui = [0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00]
deveui = [0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00]
Which of the two sections (TTN.OTAA vs TTN.ABP) do I need to fill out? Both? I’ve set deveui, appeui and appskey in both sections. As said, though, appeui is only ‘0’ and the appskey I get from the TTN console is one octal shorter then the place holder. Should I just remove the last 0x00?
I have no idea what devaddr and newskey mean and where I would get them from.
Can you shed some light on this?
Also a bit unrelated. When I created the device on the TTN network, I needed to select the generic device option where I had to specify a MAC protocol version, ranging somewhere from v 1.0 to 1.1 with various increments in between. I took the first option, but no idea whether this was right or not. What do you use?
You don’t need cache.json it will be created when the code first runs and its absence basically makes the node send a join request. There is,normally, only ever one join request with V3 OTAA the subsequent messages used the cached keys from the join. If you want to force a new join just delete cache.json and run your code again.
Let’s see when I get there
My project was to add LoRa radio to the road speed signs for the local council - they have yet to install it on a road , not the fastest shakers and movers, but they did fire it up to check it was talking to TTN.
Nice one. I want to connect some temperature sensors which are supposed to feed into a weather station of mine.
–Hardy