Arduino Forum

Products => MKR Boards => MKRWAN1300 => Topic started by: AlexSneedMiller on Apr 12, 2018, 02:46 pm

Title: Connecting to Private Network via OTAA
Post by: AlexSneedMiller on Apr 12, 2018, 02:46 pm
I am trying to connect my MKR-WAN-1300 (https://www.arduino.cc/en/Guide/MKRWAN1300) to a private LoRa network that I have at my location.

According to the documentation, if I have my network set up with a EUI and password I should be able to just call modem.joinOTAA("network_EUI_goes_here", "network_password_goes_here"). However, I am getting failures back from that call.

I spent some time and dug into the MKRWAN.h file and think I have pin pointed the problem. When the function set(APP_EUI, appEui) gets called on line 279 of the MKRWAN.h file (https://github.com/arduino-libraries/MKRWAN/blob/master/src/MKRWAN.h#L279) the AT command that goes out is AT+APPEUI=MY_NETWORK_NAME, but the response back from the Murata CMWX1ZZABZ is just "+ERR"

Anybody have any ideas why that's giving an error back?



I've been trying to find some good documentation about the AT command set, but have been only able to come up with this one and I'm not sure if that's even correct: http://www.st.com/content/ccc/resource/technical/document/application_note/group0/db/8c/4f/5a/95/9e/40/69/DM00346311/files/DM00346311.pdf/jcr:content/translations/en.DM00346311.pdf
Title: Re: Connecting to Private Network via OTAA
Post by: Marco_Benini on Apr 12, 2018, 06:02 pm
I suppose that is a private LoRAWAN network.
What is the format and size of the application EUI and application key?

Application EUI has to be a 8 hexadecimal values, if You have a shorter one than You need to add "00" at the beginning.
For example "00AABBCCDDEEFFAA"

Application key is 16 hexadecimals.
Title: Re: Connecting to Private Network via OTAA
Post by: horace on Apr 12, 2018, 10:04 pm
does it work OK connecting to The Things network?
Title: Re: Connecting to Private Network via OTAA
Post by: Marco_Benini on Apr 13, 2018, 12:07 am
I used MKR 1300 WAN with the The Things Network in Europe (868 MHz) with the MKRWAN library.

One has to get the device EUI from the MKR 1300 in order to register the device on a TTN application.

The join, with the gateway not far away, is made at spread factor 7 / 125 KHz, but messages (uplinks) are instead made at SF12 (unfortunately).

I have also to find a way to store the session parameters (join data, frame counter, ...) so to use after sleep.
It is bad practice to make a new join every time one has to send a message.
Title: Re: Connecting to Private Network via OTAA
Post by: horace on Apr 13, 2018, 11:59 am
you could use an SD card or an FRAM to store your data
Title: Re: Connecting to Private Network via OTAA
Post by: Marco_Benini on Apr 13, 2018, 02:18 pm
An addendum to my previous post.
I updated to firmware of the Murata chip to version 1.1.5 before testing with TTN.
One of the MKRWAN library examples allow to update the firmware with a pre-compiled version.

Firmware Github project "mkrwan1300-fw" can be found here: https://github.com/arduino/mkrwan1300-fw (https://github.com/arduino/mkrwan1300-fw)
Title: Re: Connecting to Private Network via OTAA
Post by: AlexSneedMiller on Apr 13, 2018, 10:28 pm
I updated my private network gateway to have a hex EUI and hex password. I am seeing the AT commands working for setting the mode to OTAA and setting the EUI and password. Then the AT+JOIN goes out and OK comes back.

Is there any more debugging we can get from the Murata chip?
Title: Re: Connecting to Private Network via OTAA
Post by: AlexSneedMiller on Apr 16, 2018, 10:45 pm
An addendum to my previous post.
I updated to firmware of the Murata chip to version 1.1.5 before testing with TTN.
One of the MKRWAN library examples allow to update the firmware with a pre-compiled version.

Firmware Github project "mkrwan1300-fw" can be found here: https://github.com/arduino/mkrwan1300-fw (https://github.com/arduino/mkrwan1300-fw)
I was able to update the Murata firmware to version 1.1.5, but I was still not able to get it to connect to my network.

My gateway has one dedicated rx channel (right now set to "7"). It sounds like the standard is for 64 channels, but the gateway just does a modulo/7 operation to trim the 64 channels down to 8 (0-8)

Do you know if there is a way to configure the Murata chip to connect only one on channel?
Title: Re: Connecting to Private Network via OTAA
Post by: Marco_Benini on Apr 17, 2018, 02:17 am
Most LoRa gateways in the market are 8 channels.

Using OTAA, if I remember well, it should the gateway that says the end node the frequencies plan to use, but I could be wrong.

Are You sure that the join process arrives to the end? Are the paramenters in the MKR1300 written in their registers?
Title: Re: Connecting to Private Network via OTAA
Post by: AlexSneedMiller on Apr 26, 2018, 10:30 pm
My LoRa gateway is using set to use sub-band 7. My understanding is that the gateway receives packets on all 64 channels, and then it takes the modulo 8 of all 64. Therefore, if the MKRWAN1300 is using channels 7, 14, 21..., or 63 it should connect. Is there a way to force the MKRWAN1300 to use a specific sub-band, or at least to report which sub-band it's using to connect?

I'm not 100% sure if the join process is being received correctly. But I am able to get other 3rd party devices to work, just not the Arduino. I am able to specify the sub band with the Arduino.

I'm not sure that your question means about making sure that the parameters are written in their registers. Do you think I need to modify the Arduino library to send an AT command to write the parameters from previous AT commands?
Title: Re: Connecting to Private Network via OTAA
Post by: cparrish60 on Sep 21, 2018, 02:49 pm
My 1300 would join with the Multitech Conduit gateway, but then it would fail.  I switched to "public' lorawan and it worked.
Title: Re: Connecting to Private Network via OTAA
Post by: AlexSneedMiller on Mar 04, 2019, 09:49 pm
My 1300 would join with the Multitech Conduit gateway, but then it would fail.  I switched to "public' lorawan and it worked.
I was able to get it to work when I did this. However, sometimes when I try and join the network it times out. I've changed my setup() code to continuously retry until it eventually does join the network. Sometimes this can take a very long time.

My assumption is that the Murata module is attempting to join on one of the uplink channels that my gateway is not set up to listen on. Is there any way to configure the Murata module to only use one sub band?

Does anyone have good documentation of what the AT commands actually are for the Murata module?