Adafruit feather m0 with TTN

I am very thankful to you, sir. You already helped me a lot. You are extremely cooperative person.

I’m not sure which Ph.D degree but before trying to do anything with LoRaWAN security, the very minimum is that you first grasp the LoRaWAN basics and e.g. get a simple LoRaWAN node working, first with ABP, then with OTAA.
Basics, so no additional stuff for sensors etc. whatever.

From a Phd.D student I would expect that you try to understand the underlying technology (to a fair amount) first, and from there come up with targeted questions and provide all relevant information.

From this thread I do get a strong impression though that your primary goal is mainly to get your current assignment working so you can move on to your next step.

To be honest, I mainly see questions like ‘please help me get this code working’ instead of asking questions like “what do I need to…”, “why…”, “where can I find information about…”, “do I understand correctly…”, “is my assumption correct…” etc. and so whith all respect I get the impression that you want to let others do your own homework.

LoRaWAN is not simple and many aspects are involved. Several experienced people have tried to help you in this thread, but you seem not to pick up all advice given. @kersing told you to have a look at LMIC-node, but apparently you have not.

As a Ph.D student an important aspect is doing research. How hard is it to research information that is provided ‘handed onto a silver platter’?

Have a good look at LMIC-node. It is well structured and well documented and supports your Adafruit Feather M0 LoRa board right out of the box. With LMIC-node you can get a working node up and running literally in minutes (once you have read the documentation and are already familiar with the TTN console).

Once you have it up and running you can start extending or modifying it to your needs and liking, e.g. add code for reading a temperature sensor. You don’t have to use LMIC-node for your own code but it will at least show how things can be done to get them working (and contains the experience of several lessons learned).

If you need additional help, first research and experiment and then come up with targeted questions supplied with sufficient information so others can use their time more efficient to provide any answers.

3 Likes

Thank you so much for your kind suggestions. Indeed, I appreciate your suggestions. I would like to bring into your kind notice that I have done all these basics steps and tried LMIC basic example “Hello, world!” via TTN-ABP sketch. LoRaWAN is a very complex field even a small problem takes from weeks to months.

Again thanks for your kind words.

That’s why LMIC-node was created to make it easy to get a node up and running. :wink:

The problem is now with the join accept. The node is kept near the gateway but still, no join accept message has been received. Although, this is not my target abut s you suggested practicing on various examples will make me perfect in LoRaWAN. My goal is to connect the LoRa node via ABP.

Good luck with your research and journey on the forum.
(Much information is already present on the forum to help you solve those issues).

Using the Search option and checking the Categories will be most useful.

Thank you sir, Yes I am studying every post on the forum may be any of them could fit on my problem. Thanks for your encouragement.

I’ve outlined several times that ABP does not join which you are either not reading, forgetting or ignoring. But mostly you just don’t seem to absorb the information.

@bluejedi was referring to LMIC-node - a quick forum search would have found all the detail on that.

Strange, when I moved from LoRa to LoRaWAN, I spent two or three days to read the documentation and do the tutorials and implemented LMiC almost straight away.

You seem totally blind to your lack of knowledge. Try reading all the docs that TTN spent so much time creating that you could have found at any time.

https://www.thethingsnetwork.org/docs/v2-docs/

Hi sorry to interrupt in the conversation.

I have also have a couple of feather m0 lora, does any body know how to configure “add the device” in an application. it does not appear as one of the supported devices and I have no idea of how to add the device manually.

Maybe you have been able to configure it in TTN Console V3, and your knowledge would be greatly appreciated.

Regrads, Victor.

It’s just generic device so the docs & form aren’t that special, you could configure any device with them, as we did for devices in the repository before it existed.

So use the LoRaWAn version appropriate to the firmware, frequencies appropriate to your region, get the console to create the EUI’s and AppKey and put that in to the firmware.

Thanks Nick, I will give it a try this afternoon.

capture 2021-09-10 16·01·14

Hi Vsanjuan,

I’ve been using the MCCI Catenna LoRaWAN library Version 3.3.0, this by default will be LoRa MAC Version 1.0.3 for library version 3.3.0, so in TTNv3, select “manual” then select MAC version 1.0.3 and then the second PHY will be only one available and auto-selected - which narrows it down, only do this if you are using the same library as I have been.

Then select country/frequency plan that suits where the device will be deployed - this matches exactly what you programmed the node too, e.g. MCCI you have to select frequency plan in lmic_project_config.h from the library before compiling (best to edit config file, save and then re-open the project) then in the code state for US915 and AU915 for example the subband 2 (at least this is still manual process in MCCI 3.3.0 library because of the vastness of AU915 etc) to select this use the line " LMIC_selectSubBand(1); " in the void setup section, where (1) = Subband 2, (0) = Subband 1, if your frequency plan doesn’t need sub-band control (e.g AS923) then comment out the subband section in void setup.

I’ve successfully done around 6 OTAA DIY devices with Feather M0 LoRa RFM95 with AU915, measuring PM2.5, DHT-22, SHT31 and thermistors etc using this code as basis - no major issues, best the check the example sketches too - DHT22 is a good one to show how the code measures and prepares sensor data for transmission.

There is new version of the MCCI library (like 4.0.0) but I personally have not tried it, at least I had to update all my node devices to MCCI 3.3.0 a few months ago in order for them to even join on TTNv3 / TTS CE compared to TTNv2, as MAC version 1.0.2 on the old library was not working in V3, even though it all matched.

Regards

Toby

Hi thanks for your help, I have just registered the feather as a manual device as show in the image.
image

Now i suppose in the arduino code i have to fill in the APPEUI, DEVEUI, APPKEY in little indian code.

Also I have eddited the config.h file to 868 EU.

I will give it a try in mo.

1 Like

Ok, so at then end I started from scratch with a clean computer.

Just to give you some more info, the gateway is a bobcat miner.

Steps i have done
1.Downloaded MCCI Catenna LoRaWAN library Version 3.3.0 and the correct MCCI library indicated in catena.
2.Setup the correct frecuency for europe in the lmic_project_config.h
3.Added all the TTN APPEUI, DEVEUI and APPKEY in the project.
4.Commented the LMIC_selectSubBand(1); line as europe does not use this.
5.Compile and uploaded successfully to feather.

But im still getting in the ardunio serial 115200 (bauds): as shown in the following image.
Starting
12270947: EV_JOINING
12271537: EV_TXSTART
12673403: EV_JOIN_TXCOMPLETE: no JoinAccept

screen capture

Im stuck now because it should work. Any idea what i should do next?

This is for the Helium network so unless you have done something with its configuration, it won’t be connected to TTN and would make your post off topic for this forum.

1 Like

Wow, did not know that. So even being a lora network. you cannot use TTN?

TTN is a LoRaWAN network (and so is Helium).

But they aren’t like mobile phone networks - at present there is no link between the two of them.

If you wish to use TTN and do not have a community gateway in range, then you will have to change yours to TTN or get a suitable gateway to register on TTN.

If you want to setup your device for Helium, you will need to make enquiries on the Helium forums.

Ok thanks, sorry I did not know that. Even so many thanks for your help.

1 Like

Hi Vsanjuan,

As mentioned by Nick above, Helium and TTN are two different LoRaWAN networks, so that Helium gateway is probably somewhat factory configured to push to Helium, and not to TTN, but I could be wrong.

Going forward with TTN, It would be a good idea if you check the community TTN Gateway Map - you might be able to tell actual gateways within range, then afterwards see if you can move your gateway to match TTN too - but that is a question you will have to look into.

Apart from mismatching networks, I have noticed a possible error in your code, I think you need to switch the DevEUI to LSB before copying from TTN and/or entering this into the code.

You can do this manually after you had created it, this is done nicely by pressing the “toggle array” button, then press the dual arrow area OR “MSB” spot when expanding the DevEUI in the activation information section for the node. Once pressed it will re-order to LSB, then copy and override in your code to have it the correct way around.
image

I worked this out from the screen grab of the keys in IDE you have shown, noted you have copied the DevEUI direct from TTN OR entered it as per from Adafruit in MSB "0x98, 0x76 etc… first.
This has to be reversed to have 0xD6, 0xDB first left to right.

This condition that the library needs for LSB also affects the AppEUI - but being all 0x00 has masked the issue there at least - but in future any other AppEUI (such as IEEE issued AppEUI) other than all 0x00 have to be entered in the code as LSB just like the DevEUI.

Note as indicated in the IDE code, AppKey is expected to be in MSB, so is copied direct from TTN without having to switch it from MSB to LSB.

Regards

Toby