LoRa Device Definitions at WisBlock-Kit-2.ino at Arduino Example

Please include the following information, in order for us to help you as effectively as possible.

I bought a Wisblock Kit 2: Detect change of location for a set time interval with WisBlock Kit 2 – RAKwireless Store. It comes with a RAK19007, RAK4631, RAK1904 and RAK12500.

My environment is:

Blockquote

BootLoader
UF2 Bootloader 0.4.2 lib/nrfx (v2.0.0) lib/tinyusb (0.10.1-293-gaf8e5a90) lib/uf2 (remotes/origin/configupdate-9-gadbb8c7)
Model: WisBlock RAK4631 Board
Board-ID: WisBlock-RAK4631-Board
Date: Dec 1 2021
SoftDevice: S140 6.1.1

Arduino BSP or PlatformIO

Windows 11

Blockquote

In the Arduino IDE I am using the @beegee example WisBlock-Kit-2.ino. I am trying to find in the code where to configure the LoRa configurations:

  1. RF: Frequency, Sub-band, Channels
  2. Authentication mode: OTAA/ABP
  3. IDs/Keys: Device EUI, APP EUI.

@beegee , where could I find to location to configure these informations? The RAK4630 is for Arduino, then it don´t support AT commands as RUI3.

I decide to work with Arduino BSP, because most of example that I found they are for this IDE. I think that the development for RUI3 would take more time to learn how to work with the RUI3 APIs in for Arduino/PlatformIO. What do you think about it? I mean, what do you think it is the best way to develop for long term? I am saying this because soon I will have thousand of devices to configure and the device individual configurations inside the code, it is not a good idea.

Regards,

Cláudio

Hi Claudio,

If you are using the SX126x-Arduino library, there are examples for the LoRaWAN settings in the library itself and in the README file (not easy to read, I know).
For the RAK4630, I think the easiest way is to start with the LoRaWAN_OTAA_ABP.ino example.

In details to your three questions:

(1) RF: Frequency, Sub-band, Channels

Set by choosing the LoRaWAN region and ‘lmh_init()’ call (see (2)). For the subbands, there is a command lmh_setSubBandChannels(1) to select the subband (0 to 15). It makes only sense to use it in US915, AU915 and CN470.

(2) Authentication mode: OTAA/ABP
Set with the lmh_init() call.

lmh_init(&lora_callbacks, lora_param_init, true, CLASS_A, LORAMAC_REGION_AS923_3);

(3)IDs/Keys: Device EUI, APP EUI.
Set by API calls:

	// Setup the EUIs and Keys
	lmh_setDevEui(nodeDeviceEUI);
	lmh_setAppEui(nodeAppEUI);
	lmh_setAppKey(nodeAppKey);

When using RUI3, many things are similar (of course the SPI calls are different), some are different.

Personally I find it easier to work with RUI3 (if my selected device has enough flash).
But (German stubbornness) most of the time I am writing my apps with my WisBlock-API-V2 for the RAK4630.
Supports AT commands that are mostly compatible to RUI3, takes care of all LoRaWAN stuff and is targeting low power consumption.
But its usage is not straight forward and needs some learning why there is no setup() and no loop() :grin:

Thank you very much by your support. It is very important to be able to go ahead in our project.

Have a nice Sunday. (GMT-3 - Rio de Janeiro) :slight_smile:

Regards,

Cláudio

Good afternoon,

Your codes are very good! Then I am using them as a “starting point” to develop some features in a future version, for example, to turn on the sleep mode base on accelormeter information, I mean if the device has no movement based on accelormeter information, the firmware will put the hardware in a sleep mode. The hardware will wake up, for example, after 10 seconds of movements.

The problem is that I am seeing no informations in a payload, after the boot process in the original code: https://github.com/beegee-tokyo/WisBlock-API-V2/tree/main/examples/WisBlock-Kit-2. I mean, I using Arduino IDE to compile/load and everything is working fine.

I am doing a behavior comparinson with the Field Tester-P, because the hardware is very similar, and the original firmware is working perfectly.

Any ideas?

Do you want that I open a new ticket ?

Have a nice weekend!

Regards,

Claudio

The code should put the accelerometer data in the payload.
Is the payload complete empty? Do you get any interrupts from the accelerometer?

Good morning,

The join process is done with success, but after that, nothing happen. Take a look below:

This is the console log:

Blockquote
RAK4630 Console

CLEAR

10:54

AT+VER=RUI_4.1.0_RAK4631

10:54

OK

10:57

DISCONNECTED

10:57

RECONNECTED

10:57

AT+NWM=1

10:57

OK

10:57

AT+NWM=1

10:57

OK

10:57

AT+NJM=1

10:57

OK

10:57

AT+BAND=6

10:57

OK

10:57

AT+APPEUI=AC1F09FF00000001

10:57

OK

10:57

AT+APPKEY=4B4170706C69636174696F6E204B6579

10:57

OK

10:57

AT+APPSKEY=D67A0444B4E3930B854DA240BBCEFC3F

10:57

OK

10:57

AT+DEVADDR=260B71D5

10:57

OK

10:57

AT+DEVEUI=AC1F09FFFE0CE7F6

10:57

OK

10:57

AT+NETID=000013

10:57

OK

10:57

AT+NWKSKEY=4337D9150BBFD41311C966EEF25BF1AC

10:57

OK

10:57

AT+CFM=1

10:57

OK

10:57

AT+CFS=0

10:57

OK

10:57

AT+JOIN=1:1:8:0

10:57

OK

10:57

AT_COMMAND_NOT_FOUND

10:57

[SCAN] Found sensor on I2C1 0x18

10:57

[SCAN] Found sensor on I2C1 0x42

10:57

[GNSS] RAK12500 found on I2C

10:57

[GNSS] Rate 1

10:57

AT+NJS=1

10:57

OK

10:57

AT+RECV=0:

10:57

OK

10:57

AT_COMMAND_NOT_FOUND

10:57

[AT_CMD] GNSS 4 digit Cayenne LPP

10:57

[SETUP] RAKwireless RUI3 Location Tracker Node

10:57

[SETUP] Setup LoRaWAN credentials with AT commands

10:57

[SETUP] Then start join with AT+JOIN=1:1

10:57

[SETUP] Custom AT command Success

10:57

[MOD] +EVT:RAK12500 OK

10:57

Current Work Mode: LoRaWAN.

10:57

AT+ADR=0

10:57

OK

10:57

AT+CLASS=A

10:57

OK

10:57

AT+DCS=1

10:57

OK

10:57

AT+DR=3

10:57

OK

10:57

AT+PNM=1

10:57

OK

10:57

AT+JN1DL=5

10:57

OK

10:57

AT+RX1DL=5

10:57

OK

10:57

AT+JN2DL=6

10:57

OK

10:57

AT+RX2DL=2

10:57

OK

10:57

AT+RX2DR=8

10:57

OK

10:57

AT+RX2FQ=923300000

10:57

OK

10:57

AT+TXP=0

10:57

OK

10:57

AT+PGSLOT=0

10:57

OK

10:57

AT_NO_CLASSB_ENABLE

10:57

AT_NO_CLASSB_ENABLE

10:57

AT_NO_CLASSB_ENABLE

10:57

AT+LTIME=00h00m01s on 01/01/1970

10:57

OK

10:57

AT_COMMAND_NOT_FOUND

10:57

AT+CHS=0

10:57

OK

10:57

AT+CHE=1

10:57

OK

10:57

AT_COMMAND_NOT_FOUND

10:57

AT+ARSSI=0:0,1:0,2:0,3:0,4:0,5:0,6:0,7:0,64:0

10:57

OK

10:57

AT_COMMAND_NOT_FOUND

10:57

AT+LINKCHECK=0

10:57

OK

10:57

AT+RETY=0

10:57

OK

10:57

AT+TIMEREQ=0

10:57

OK

10:57

0:00000000:00000000000000000000000000000000:00000000000000000000000000000000:000000000:00:0,0:00000000:00000000000000000000000000000000:00000000000000000000000000000000:000000000:00:0,0:00000000:00000000000000000000000000000000:00000000000000000000000000000000:000000000:00:0,0:00000000:00000000000000000000000000000000:00000000000000000000000000000000:000000000:00:0

10:57

OK

10:57

AT_COMMAND_NOT_FOUND

10:57

AT_COMMAND_NOT_FOUND

10:57

AT+LPM=0

10:57

OK

10:57

AT_COMMAND_NOT_FOUND

10:57

AT_COMMAND_NOT_FOUND

10:57

AT_COMMAND_NOT_FOUND

10:57

AT_COMMAND_NOT_FOUND

10:58

AT+BUILDTIME=20231208-231949

10:58

OK

10:58

AT+CLIVER=1.5.11

10:58

OK

10:58

AT+ALIAS=

10:58

OK

10:58

OK

10:58

ATC+GNSS=4 digit Cayenne LPP

10:58

OK

10:58

ATC+SENDFREQ=0s

10:58

OK

10:58

Device Status:

10:58

Module: RAK4630

10:58

Version: RUI_4.0.6_RAK4631

10:58

Send time: 0 s

10:58

Network mode LoRaWAN

10:58

Network joined

10:58

Region: 6

10:58

Region: AU915

10:58

OTAA mode

10:58

DevEUI = AC1F09FFFE0CE7F6

10:58

AppEUI = AC1F09FF00000001

10:58

AppKey = 4B4170706C69636174696F6E204B6579

10:58

OK

The original code will send data on two occasions:
(1) frequently, interval set with ATC+SENDINT
(2) on detection of movement from the RAK1904, it will start the GNSS module and try to get a location, then send the result.

I see in your code ATC+SENDFREQ=0s. Can you change this to e.g. 30 seconds by sending a ATC+SENDFREQ=30 and see if it starts sending.
The Fieldtester firmware does not use an accelerometer. You will need to add the functions to initialize the RAK1904 and the functionality to react to the trigger and then start the GNSS module to get a location.

Thanks, I will test it tomorrow.

Cláudio

This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.