Blues.One Lorawan

I got the Blues.One unit today.
I had no issue getting it connected to NoteHub using the getting started docs.

I could not get the LORAWAN working and connected to TTN using the getting started docs and the stock firmware.
I flashed the unit with 4631 with the Arduino LoRaWAN_OTAA_ABP example and it connected to TTN immediately.

I download the VSCode tracker example, recompiled it, and reflashed the 4631 using the UF2 file.
Seemed to be updated version, from what shipped.
I checked/redid all the LORA AT settings/commands.

Still cant get LORA to connect as per the getting started docs.

Any suggestions?

Recompiled the tracker firmware with debugging. Log attached below.
Cant see anything that helps debug failed lorawan joins.

blues one track debug.log (15.0 KB)

Can you send a ATC+STATUS to the RAK4631 when it runs the Blues firmware and check that the settings are correct.

Share the output here so I can have a look. From your log, I can only see that JOIN fails:

2024-01-09 21:38:56.688710 +EVT:JOIN_FAILED

but not why it failed.

OK. ATC+STATUS was what i needed.

It shows that my band and subband are wrong.

I have used, AT+BAND=5 multiple times.
When i run AT+BAND? it returns 5

while looking thru the tracker code, i found at section in blues.cpp that also sets the band based on the country returned but notecard gps. It didnt handle Canada. I added code to the US915 to handle CA.
I can see it returning in the debug log before joining. But ATC+STATUS still show EU868 after failed join.

code added to blues.cpp

else if (strcmp(str_value, "US") == 0 || (strcmp(str_value, "CA") == 0))
{
     MYLOG("BLUES", "Found US/CA");

boot log 1
failed join, status check, reset band, check band, reboot

[APP] init_app
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
WisBlock Blues Tracker
FW Ver 1.0.2
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
[USR_AT] Added 11 User AT commands
+EVT:RAK1906
+EVT:IMSI-864475046aaaaaa
[USR_AT] Valid Blues settings found, Blues Product UID = com.sixthsenseprocessware.craven:rak
[USR_AT] Selected SIM card: internal only
[BLUES] Found saved settings, override NoteCard internal settings!
[BLUES] Set Product ID and connection mode
[BLUES] Set SIM and APN
[BLUES] Set location mode off
[BLUES] Disable ATTN
[BLUES] Enable ATTN on motion
[BLUES] card.attn mode returned: {"set":true}
[BLUES] Arm ATTN on motion
[BLUES] Attach interrupt on motion
+EVT:RAK13102
[APP] restart_advertising
[APP] api_timer_start
[APP] Timer wakeup, start GNSS
[APP] GNSS inactive, start it
[BLUES] Set location mode continuous
[BLUES] Disable ATTN
[BLUES] Enable ATTN on location
[BLUES] card.attn mode returned: {"set":true}
[BLUES] Arm ATTN on location
[BLUES] Attach interrupt on location
[APP] ATTN triggered
[BLUES] card.attn mode returned: {"files":["location"],"set":true}
[BLUES] card.attn check returned: {"files":["location"],"set":true}
[BLUES] card.attn files: location
[BLUES] card.attn for LOCATION
[APP] GNSS wait finished
[BLUES] gnss_status >>GPS updated (32 sec, 38/38 dB SNR, 6/10 sats, HDOP 1.30) {gps-active} {gps-signal} {gps-sats} {gps}<<
[BLUES] GNSS is updated!
[BLUES] Got location Lat 43.585625 Long -79.607628
[BLUES] Last GNSS update was 1705156373
[BLUES] Found US/CA
[BLUES] Switch to band 5
[BLUES] Last card time was 1705156375
[BLUES] Set location mode off
[BLUES] Disable ATTN
[BLUES] Enable ATTN on motion
[BLUES] card.attn mode returned: {"set":true}
[BLUES] Arm ATTN on motion
[BLUES] Attach interrupt on motion
[BME] Start BME reading
[BME] RH= 34.91 T= 27.52 P= 973.890
[APP] Network not joined, skip sending over LoRaWAN
[APP] Get hub sync status:
[BLUES] Finished parsing
+EVT:TX_CELL_OK
[APP] Cellular count w/o Join 2
[APP] Join network failed
+EVT:JOIN_FAILED

Device status:
   RAK4631
   Mode LPWAN
   Auto join enabled
   Network not joined
LPWAN status:
   Dev EUI xxxx09FFFE0Fxxxx
   App EUI yyyyyyyyyyyyyyyy
   App Key zzzzzzB55B098B37675A15CF11zzzzzz
   Dev Addr 26021FB4
   NWS Key 323D155A000DF335307A16D...............
   Apps Key 3F6A66459D5EDCA63CBC46................
   OTAA enabled
   ADR enabled
   Public Network
   Dutycycle disabled
   Join trials 3
   TX Power 0
   DR 3
   Class 0
   Subband 1
   Fport 2
   Unconfirmed Message
   Region EU868
   Send Frequency 3600

OK
OK

AT+BAND=5
OK
OK

AT+BAND=?
AT+BAND=5

OK

ATZ

after reboot
failed joined, check band, check status

[APP] init_app
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
WisBlock Blues Tracker
FW Ver 1.0.2
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
[USR_AT] Added 11 User AT commands
+EVT:RAK1906
+EVT:IMSI-864475046aaaaaa
[USR_AT] Valid Blues settings found, Blues Product UID = com.sixthsenseprocessware.craven:rak
[USR_AT] Selected SIM card: internal only
[BLUES] Found saved settings, override NoteCard internal settings!
[BLUES] Set Product ID and connection mode
[BLUES] Set SIM and APN
[BLUES] Set location mode off
[BLUES] Disable ATTN
[BLUES] Enable ATTN on motion
[BLUES] card.attn mode returned: {"set":true}
[BLUES] Arm ATTN on motion
[BLUES] Attach interrupt on motion
+EVT:RAK13102
[APP] restart_advertising
[APP] api_timer_start
[APP] Timer wakeup, start GNSS
[APP] GNSS inactive, start it
[BLUES] Set location mode continuous
[BLUES] Disable ATTN
[BLUES] Enable ATTN on location
[BLUES] card.attn mode returned: {"set":true}
[BLUES] Arm ATTN on location
[BLUES] Attach interrupt on location
[APP] ATTN triggered
[BLUES] card.attn mode returned: {"files":["location"],"set":true}
[BLUES] card.attn check returned: {"files":["location"],"set":true}
[BLUES] card.attn files: location
[BLUES] card.attn for LOCATION
[APP] GNSS wait finished
[BLUES] gnss_status >>GPS updated (21 sec, 38/38 dB SNR, 5/6 sats, HDOP 1.50) {gps-active} {gps-signal} {gps-sats} {gps}<<
[BLUES] GNSS is updated!
[BLUES] Got location Lat 43.585556 Long -79.607727
[BLUES] Last GNSS update was 1705156526
[BLUES] Found US/CA
[BLUES] Switch to band 5
[BLUES] Last card time was 1705156528
[BLUES] Set location mode off
[BLUES] Disable ATTN
[BLUES] Enable ATTN on motion
[BLUES] card.attn mode returned: {"set":true}
[BLUES] Arm ATTN on motion
[BLUES] Attach interrupt on motion
[BME] Start BME reading
[BME] RH= 35.62 T= 27.16 P= 973.950
[APP] Network not joined, skip sending over LoRaWAN
[APP] Get hub sync status:
[BLUES] Finished parsing
+EVT:TX_CELL_OK
[APP] Cellular count w/o Join 2
[APP] Join network failed
+EVT:JOIN_FAILED

ATC+BAND=?
ATC+BAND=4

OK

Device status:
   RAK4631
   Mode LPWAN
   Auto join enabled
   Network not joined
LPWAN status:
   Dev EUI xxxx09FFFE0Fxxxx
   App EUI yyyyyyyyyyyyyyyy
   App Key zzzzzzB55B098B37675A15CF11zzzzzz
   Dev Addr 26021FB4
   NWS Key 323D155A000DF335307A16DA.............
   Apps Key 3F6A66459D5EDCA63CBC461..............
   OTAA enabled
   ADR enabled
   Public Network
   Dutycycle disabled
   Join trials 3
   TX Power 0
   DR 3
   Class 0
   Subband 1
   Fport 2
   Unconfirmed Message
   Region EU868
   Send Frequency 3600

OK
OK

I havent used LORA AT commands very much…

i tried all the individual LoRaWAN Keys and IDs commands
The seems to work and the stored values are correct.

AT+BAND works, but is not stored, band reverts to 4(EU868) after ATZ reboot

others…

`AT+MASK=?
AT_ERROR

AT+CHE=?
AT_ERROR

AT+CHS=?
AT+CHS=0

OK`

The code to automatically select the band is “experiemental”, I think I need to take it out for now.

AT+MASK, AT+CHE and AT+CHS are only working in regions that have more than 8 channels available. They do not work in EU868.
Still strange that it always defaults to EU868, if the country is not in the code, it should not change the band at all.

Try to comment out lines 731 to 789 in blues.cpp.

Ok. Disabling the auto band code worked.

My band stayed at 5 (US915).
I then had to use AT+MASK=2 to connection to TTN.

Since your “getting started doc” on github uses Band5 US915
I suggest you add a MASK=xxx line/comment.

`        // Setup AppEUI
AT+APPEUI=70b3d57ed00201e1
        // Setup DevEUI
AT+DEVEUI=ac1f09fffe03efdc
        // Setup AppKey
AT+APPKEY=2b84e0b09b68e5cb42176fe753dcee79
        // Set automatic send interval in seconds
AT+SENDINT=60
        // Set data rate
AT+DR=3
        // Set LoRaWAN region (here US915)
AT+BAND=5
        // Set subBand where applicable
AT+MASK=2 
        // Reset node to save the new parameters
ATZ
        // After reboot, start join request
AT+JOIN=1,0,8,10`

Your auto region setting code seems to fail without a subband assignment on the bands where applicable. When it fails, the band reverts to EU868.

If you make a sub band assignment then your code works.

					else if (strcmp(str_value, "US") == 0 ||
							 (strcmp(str_value, "CA") == 0))
					{
						MYLOG("BLUES", "Found US/CA");
						if (g_lorawan_settings.lora_region != 5)
						{
							MYLOG("BLUES", "Switch to band 5");
							g_lorawan_settings.lora_region = 5;
							MYLOG("BLUES", "Switch to subband 2");
							g_lorawan_settings.subband_channels=2;
							init_lorawan(true);
						}

Yeah, as I said, it was “experimental” andf it worked fine when travelling from Philippines (AS923-3) to Japan (AS923-1).
I guess for most use cases it is not required at all.