Adafruit feather m0 with TTN

I’m pretty sure most of the code needs starting again.

Nah, there’s code in there that trashes the DevAddr and the NwksKey …

No, and it won’t help as your code is the problem so you’ll just have it not working in two places.

It will not change automatically to V3. Please read the forum for more information.

I think @Descartes has some valid concerns about the code you are using. Was it written to be used with TTN? Or is it intended for a private LoRaWan implementation? A lot of the setup is very different from the usual code for TTN.

It’s a borked version of LMiC - hard to tell if it’s Classic or MCCI or which release.

Dear Sir, the SRSPacket.h library is included in the separate folder of this code.

image

Last time, it was tested on resiot lorawan (ResIOT Login - ResIOT LoRaWAN Network Server and IoT Platform) platform and it was working fine with this code. But the only problem is with the ttn.

image

There was some very similar code back in 2019 OTAA Join with Adafruit feather M0 LoraWan.

Where on the internet do I find this code please.

Yeah, students do that, it’s an annual thing …

First hit in a popular search engine took me to that post.

Yeah, first hit in the forum search took me to that post, but no one uses Mistress Google or Master Forum Search, they get others to do it for them.

Sir if you want I can send you, I just received it from my Professor. This is the part of my Ph.D degree, first I have to connect the node then I will move to Cybersecurity of LoRaWAN.

Why can’t you post a link to the library or post the code here or put it somewhere public. Stop wriggling like a fish, if we are going to do your Ph.D work for you, at least respect our time.

Note to other readers, one of the calls to this library dumps JSON so I’m keen to know what the heck it is sending as a payload.

My dear sir, I am sorry I already posted the google drive link where the complete code and library are included. Extremely sorry I didn’t get your point where can I post the link? I am following you what you suggest me.

You haven’t made it public, which means I have to share my email address with you - make it public link. Or post the code on here.

uhhhhh I am very very sorry now I got the point. Could you please try with this new link? Please let me know if there is any problem with the link

https://drive.google.com/drive/folders/1aY8BLin8-PVVEi0HzLH9UzLtSaYYA7AU?usp=sharing

I am really sorry yesterday I sent it in hurry so was not aware of that.

LoRaWan is a topic that has many levels of understanding. I got started by looking at examples of what works in TTN. Then modifying those to do what I wanted. Then I decided I needed to understand more about what happens in the libraries used in those examples, and more about TTN and LoRaWan. I’m still a Newbie more than 2 years later.

If you have time, find a TTN example that works with your hardware, then re implement the example code you have so that it works in the TTN environment.

Then recommend you send it back! Unless he has done this to set you a challenge of debugging crap code before getting into the even more complex arena of cyber security!

You have been asked a number of questions and set a number of challenges and response requirements by the mods and other posters please give a complete ground up response as these drip feed threads take everyone’s time and are not productive.

Last night Jac challenged you on the channel selection (from with US band?) so didnt flag as he just beat me to it. Nick has now done the same. Where in the world are you? You previously used (Italian) RESiot and I see you IP address resolves to Telecom Italia…and given previous posts looks like you are using EU868… is your Dragino LPS8 a EU version and the Adafruit? Looks like your code has US content unmodified. The duty cycle called out by Nick may breach TTN FUP and potentially be illegal in EU but if origin of code/library is US based then they don’t have same DC limitation…but they have dwell time limit!

Please list source and origin of all libraries and base code then help can be effective…

Recommend start again with a clean sheet and go back to previous tutorials :wink:

@descartes @AndyG

I analyzed the code and commented on the issues earlier today. Please do not duplicate this as it will only lead to confusion for the OP.

OK, to cut to the chase, use this:

which is the most up to date version of your code base, read the instructions, the Feather M0 is directly supported by this board, I use this code base and I use the Feather so there is no reason for the ‘out the box’ code not to work. Then you can add to it from there.

Plus, the SRSPacket system produces unnaturally large payloads for LoRaWAN and duplicates sequence numbers and has redundant fields. You should just use plain data structures, see https://www.thethingsnetwork.org/docs/devices/bytes/

3 Likes

We already have so that horse has bolted.

You may not be aware that the ArduinoUniqueId library auto-initialises itself so the OP will be overwriting his NwksKey because UniqueIDsize is populated.