Sodaq One (RN2903) fails to join network

Hi all,

I have a sodaq one rev 4 and I would like to use the supplied code:

I have used the serial passthough code and I’m able to send messages successfully. However using the above sample code I have not been able to join.

I have enabled the further debugging and both fail for different reasons, ultimately I would like to use the tracker so I will upload the log for it:

Settings:
  GPS (OFF=0 / ON=1)         (gps=): 1
  Fix Interval (min)         (fi=): 1
  Alt. Fix Interval (min)    (afi=): 0
  Alt. Fix From (HH)         (affh=): 0
  Alt. Fix From (MM)         (affm=): 0
  Alt. Fix To (HH)           (afth=): 0
  Alt. Fix To (MM)           (aftm=): 0
  GPS Fix Timeout (sec)      (gft=): 120
  Minimum sat count          (sat=): 4
  OTAA Mode (OFF=0 / ON=1)   (otaa=): 0
  Retry conn. (OFF=0 / ON=1) (retry=): 0
  ADR (OFF=0 / ON=1)         (adr=): 0
  ACK (OFF=0 / ON=1)         (ack=): 0
  Spreading Factor           (sf=): 9
  Output Index               (pwr=): 7
  DevAddr / DevEUI           (dev=): 0C600023
  AppSKey / AppEUI           (app=): xxx
  NWSKey / AppKey            (key=): xxx
  Num Coords to Upload       (num=): 1
  Repeat Count               (rep=): 0
  Status LED (OFF=0 / ON=1)  (led=): 0
  Debug (OFF=0 / ON=1)       (dbg=): 1
Enter command:

Settings:
  GPS (OFF=0 / ON=1)         (gps=): 1
  Fix Interval (min)         (fi=): 1
  Alt. Fix Interval (min)    (afi=): 0
  Alt. Fix From (HH)         (affh=): 0
  Alt. Fix From (MM)         (affm=): 0
  Alt. Fix To (HH)           (afth=): 0
  Alt. Fix To (MM)           (aftm=): 0
  GPS Fix Timeout (sec)      (gft=): 120
  Minimum sat count          (sat=): 4
  OTAA Mode (OFF=0 / ON=1)   (otaa=): 0
  Retry conn. (OFF=0 / ON=1) (retry=): 0
  ADR (OFF=0 / ON=1)         (adr=): 0
  ACK (OFF=0 / ON=1)         (ack=): 0
  Spreading Factor           (sf=): 9
  Output Index               (pwr=): 7
  DevAddr / DevEUI           (dev=): 0C600023
  AppSKey / AppEUI           (app=): xxx
  NWSKey / AppKey            (key=): xxx
  Num Coords to Upload       (num=): 1
  Repeat Count               (rep=): 0
  Status LED (OFF=0 / ON=1)  (led=): 0
  Debug (OFF=0 / ON=1)       (dbg=): 1
Initializing LoRa...
Initializing LoRa...
[initABP]
[init]
[sleep]
[wakeUp]
[resetDevice]
[expectString] expecting RN.(RN2903AU 0.9.7rc7 Aug 11 2016 15:07:56) found a match!
The device type is RN2903
[setFsbChannels]
[expectString] expecting ok.(ok) found a match!
[expectString] expecting ok.(ok) found a match!
[expectString] expecting ok.(ok) found a match!
[expectString] expecting ok.(ok) found a match!
[expectString] expecting ok.(ok) found a match!
[expectString] expecting ok.(ok) found a match!
[expectString] expecting ok.(ok) found a match!
[expectString] expecting ok.(ok) found a match!
[expectString] expecting ok.(ok) found a match!
[expectString] expecting ok.(ok) found a match!
[expectString] expecting ok.(ok) found a match!
[expectString] expecting ok.(ok) found a match!
[expectString] expecting ok.(ok) found a match!
[expectString] expecting ok.(ok) found a match!
[expectString] expecting ok.(ok) found a match!
[expectString] expecting ok.(ok) found a match!
[expectString] expecting ok.(ok) found a match!
[expectString] expecting ok.(ok) found a match!
[expectString] expecting ok.(ok) found a match!
[expectString] expecting ok.(ok) found a match!
[expectString] expecting ok.(ok) found a match!
[expectString] expecting ok.(ok) found a match!
[expectString] expecting ok.(ok) found a match!
[expectString] expecting ok.(ok) found a match!
[expectString] expecting ok.(ok) found a match!
[expectString] expecting ok.(ok) found a match!
[expectString] expecting ok.(ok) found a match!
[expectString] expecting ok.(ok) found a match!
[expectString] expecting ok.(ok) found a match!
[expectString] expecting ok.(ok) found a match!
[expectString] expecting ok.(ok) found a match!
[expectString] expecting ok.(ok) found a match!
[expectString] expecting ok.(ok) found a match!
[expectString] expecting ok.(ok) found a match!
[expectString] expecting ok.(ok) found a match!
[expectString] expecting ok.(ok) found a match!
[expectString] expecting ok.(ok) found a match!
[expectString] expecting ok.(ok) found a match!
[expectString] expecting ok.(ok) found a match!
[expectString] expecting ok.(ok) found a match!
[expectString] expecting ok.(ok) found a match!
[expectString] expecting ok.(ok) found a match!
[expectString] expecting ok.(ok) found a match!
[expectString] expecting ok.(ok) found a match!
[expectString] expecting ok.(ok) found a match!
[expectString] expecting ok.(ok) found a match!
[expectString] expecting ok.(ok) found a match!
[expectString] expecting ok.(ok) found a match!
[expectString] expecting ok.(ok) found a match!
[expectString] expecting ok.(ok) found a match!
[expectString] expecting ok.(ok) found a match!
[expectString] expecting ok.(ok) found a match!
[expectString] expecting ok.(ok) found a match!
[expectString] expecting ok.(ok) found a match!
[expectString] expecting ok.(ok) found a match!
[expectString] expecting ok.(ok) found a match!
[expectString] expecting ok.(ok) found a match!
[expectString] expecting ok.(ok) found a match!
[expectString] expecting ok.(ok) found a match!
[expectString] expecting ok.(ok) found a match!
[expectString] expecting ok.(ok) found a match!
[expectString] expecting ok.(ok) found a match!
[expectString] expecting ok.(ok) found a match!
[expectString] expecting ok.(ok) found a match!
[expectString] expecting ok.(ok) found a match!
[expectString] expecting ok.(ok) found a match!
[expectString] expecting ok.(ok) found a match!
[expectString] expecting ok.(ok) found a match!
[expectString] expecting ok.(ok) found a match!
[expectString] expecting ok.(ok) found a match!
[expectString] expecting ok.(ok) found a match!
[expectString] expecting ok.(ok) found a match!
[setPowerIndex]
[setMacParam] pwridx = 5
[expectString] expecting ok.(ok) found a match!
[setSpreadingFactor]
[setMacParam] dr = 3
[expectString] expecting ok.(ok) found a match!
[setMacParam] devaddr = [array][expectString] expecting ok.(ok) found a match!
[setMacParam] appskey = [array][expectString] expecting ok.(ok) found a match!
[setMacParam] nwkskey = [array][expectString] expecting ok.(ok) found a match!
[setMacParam] adr = off
[expectString] expecting ok.(ok) found a match!
[joinNetwork]
[expectString] expecting ok.(ok) found a match!
[expectString] expecting accepted.(accepted) found a match!
[setSpreadingFactor]
[setMacParam] dr = 1
[expectString] expecting ok.(ok) found a match!
[setPowerIndex]
[setMacParam] pwridx = 7
[expectString] expecting ok.(ok) found a match!
[sleep]
** Boot-up completed successfully!
Starting getGpsFixAndTransmit()...
Setting RTC from 946684846 to 1493160239
Timestamp, BatteryVoltage, BoardTemperature, Lat, Long, Altitude, Speed, Course, SatelliteCount, TimeToFix
1493160239, 134, 21, -xxx, xxx, 66, 0, 0, 7, 0

[wakeUp]
[send]
[macTransmit]
[expectString] expecting ok.(ok) found a match!
Waiting for server response..
(ok)
Some other string received (error)
[lookupMacTransmitError]: ok
[lookupMacTransmitError]: found 95
There was an error while transmitting through LoRaWAN.
[sleep]
Default fix event started.
Starting getGpsFixAndTransmit()...
Timestamp, BatteryVoltage, BoardTemperature, Lat, Long, Altitude, Speed, Course, SatelliteCount, TimeToFix
1493160302, 134, 21, -xxx, xxx, 52, 0, 0, 6, 2

[wakeUp]
[send]
[macTransmit]
[expectString] expecting ok.[lookupMacTransmitError]: ok
[lookupMacTransmitError]: not found!
There was an error while transmitting through LoRaWAN.
[sleep]

It looks as if the setting were configured correctly but that there was an error while transmitting.

I hope someone can help with my problem, any help is greatly appreciated.

Cheers
Cam

Dear Cam,

What is the board file version you use?
http://downloads.sodaq.net/package_sodaq_samd_index.json

Regards,
Jan

Hi Jan,

I have just changed to 1.6.14 however I was using 1.6.12. PS I have a Sodaq One rev 4 and using the SodaqOne Universal Tracker - 3.0.
With the new board version, the RN module is no longer seen:

Settings:
  GPS (OFF=0 / ON=1)         (gps=): 1
  Fix Interval (min)         (fi=): 1
  Alt. Fix Interval (min)    (afi=): 0
  Alt. Fix From (HH)         (affh=): 0
  Alt. Fix From (MM)         (affm=): 0
  Alt. Fix To (HH)           (afth=): 0
  Alt. Fix To (MM)           (aftm=): 0
  GPS Fix Timeout (sec)      (gft=): 120
  Minimum sat count          (sat=): 4
  OTAA Mode (OFF=0 / ON=1)   (otaa=): 0
  Retry conn. (OFF=0 / ON=1) (retry=): 0
  ADR (OFF=0 / ON=1)         (adr=): 0
  ACK (OFF=0 / ON=1)         (ack=): 0
  Spreading Factor           (sf=): 8
  Output Index               (pwr=): 5
  DevAddr / DevEUI           (dev=): 0C600023
  AppSKey / AppEUI           (app=): xxx
  NWSKey / AppKey            (key=): xxx
  Num Coords to Upload       (num=): 1
  Repeat Count               (rep=): 0
  Status LED (OFF=0 / ON=1)  (led=): 1
  Debug (OFF=0 / ON=1)       (dbg=): 1
Initializing LoRa...
Initializing LoRa...
[initABP]
[init]
[sleep]
[wakeUp]
[resetDevice]
[expectString] expecting RN.LoRa init failed!
[sleep]
** Boot-up completed successfully!
Starting getGpsFixAndTransmit()...
Setting RTC from 946684867 to 1493683423
Timestamp, BatteryVoltage, BoardTemperature, Lat, Long, Altitude, Speed, Course, SatelliteCount, TimeToFix
1493683423, 135, 33, -xxx, xxx, 61, 0, 0, 9, 1

As mentioned earlier, I can use the module fine using the pass through code.
Any help you can provide in order to get a resolve for this problem is greatly appreciated.

Cheers
Cam

Hi Cam,

I was able to reproduce the issue.
Arduino made some changes, we have updated our RN2483 library (also for RN2903).
We didn’t update this yet in the Tracker V1 software. :sweat_smile:

Download tracker V2 software and copy the two RN2483 files into the V1 tracker software.
Please let me know if this solves your issue.

I’ll update our github soon.

Regards,
Jan

Hi Jan,

Thanks for the huge help. I have replaced the header and cpp files and my problem has been resolved :slight_smile: with the caveat that I also changed the default FSB to that I was using. I think this will be particularly useful to others using the Sodaq One in Australia.

Cheers
Cam

PS I will now try to have the GPS fix < 1 minute :slight_smile:

Hi Cam,

Please share the code for the default Australian FSB settings.
I can build them in the V1, V2 of the tracker software.

Regards,
Jan

Hi Jan,

By default, in the RN2483 header file the FSB was set to 2. With a gateway using only the first 8 channels (0 thru 7 - in Aus 915.2MHz thru 916.6MHz), I needed to set the FSB to 1. Please see here:
http://www.microchip.com/forums/m926581.aspx

I think that it would be a good idea to include the FSB option in the settings menu for future revisions.

Cheers
Cam

PS I am also using the RN2903AU 0.9.7rc7 firmware.

Hi Jan,

I have noticed a problem with the setting of the SF, I have successfully transmitted data using SF7 and SF9 however it fails when using SF10:

Settings:
  GPS (OFF=0 / ON=1)         (gps=): 1
  Fix Interval (min)         (fi=): 60
  Alt. Fix Interval (min)    (afi=): 0
  Alt. Fix From (HH)         (affh=): 0
  Alt. Fix From (MM)         (affm=): 0
  Alt. Fix To (HH)           (afth=): 0
  Alt. Fix To (MM)           (aftm=): 0
  GPS Fix Timeout (sec)      (gft=): 120
  Minimum sat count          (sat=): 4
  OTAA Mode (OFF=0 / ON=1)   (otaa=): 0
  Retry conn. (OFF=0 / ON=1) (retry=): 0
  ADR (OFF=0 / ON=1)         (adr=): 0
  ACK (OFF=0 / ON=1)         (ack=): 0
  Spreading Factor           (sf=): 10
  Output Index               (pwr=): 5
  DevAddr / DevEUI           (dev=): 0C50006A
  AppSKey / AppEUI           (app=): xxx
  NWSKey / AppKey            (key=): xxx
  Num Coords to Upload       (num=): 1
  Repeat Count               (rep=): 0
  Status LED (OFF=0 / ON=1)  (led=): 1
  Debug (OFF=0 / ON=1)       (dbg=): 1
Initializing LoRa...
Initializing LoRa...
[initABP]
[init]
[sleep]
[wakeUp]
[resetDevice]
[expectString] expecting RN.(RN2903AU 0.9.7rc7 Aug 11 2016 15:07:56) found a match!
The device type is RN2903
[setFsbChannels]
[expectString] expecting ok.(ok) found a match!
***Omitted***
[expectString] expecting ok.(ok) found a match!
[setPowerIndex]
[setMacParam] pwridx = 5
[expectString] expecting ok.(ok) found a match!
[setSpreadingFactor]
[setMacParam] dr = 0
[expectString] expecting ok.(ok) found a match!
[setMacParam] devaddr = [array][expectString] expecting ok.(ok) found a match!
[setMacParam] appskey = [array][expectString] expecting ok.(ok) found a match!
[setMacParam] nwkskey = [array][expectString] expecting ok.(ok) found a match!
[setMacParam] adr = off
[expectString] expecting ok.(ok) found a match!
[joinNetwork]
[expectString] expecting ok.(ok) found a match!
[expectString] expecting accepted.(accepted) found a match!
[setSpreadingFactor]
[setMacParam] dr = 0
[expectString] expecting ok.(ok) found a match!
[setPowerIndex]
[setMacParam] pwridx = 5
[expectString] expecting ok.(ok) found a match!
[sleep]
** Boot-up completed successfully!
Starting getGpsFixAndTransmit()...
Setting RTC from 946684861 to 1493851811
Timestamp, BatteryVoltage, BoardTemperature, Lat, Long, Altitude, Speed, Course, SatelliteCount, TimeToFix
1493851811, 135, 29, -xxx, xxx, 56, 0, 0, 5, 0

[wakeUp]
[send]
[macTransmit]
[expectString] expecting ok.(invalid_data_len)[lookupMacTransmitError]: invalid_data_len
[lookupMacTransmitError]: found 3
There was an error while transmitting through LoRaWAN.
[sleep]
Starting getGpsFixAndTransmit()...
Timestamp, BatteryVoltage, BoardTemperature, Lat, Long, Altitude, Speed, Course, SatelliteCount, TimeToFix
1493851814, 135, 29, -xxx, xxx, 69, 0, 0, 5, 1

As can be seen in the dump, after changing the SF from 9 to 10 the device fails to join. Is there a fix for this problem.

Cheers
Cam

Hi,

Whats the time between the messages?
If you send too many packages its maybe the duty cycle.

Can you at least wait 2 minutes between each packet?

Regards,
Jan

Hi Jan,

Seems to occur regardless of time, I have set to fix to 60 min and have to same error.

Cheers
Cam