RAK3172 EVB and Arduino Uno

If you can’t get it into boot mode, there are a few possible reasons, most likely

  • Setup Serial as RAK_CUSTOM_MODE, which disables the AT commands
  • Application code crashes, MCU halts, no more response to AT commands

Before you flash with Arduino IDE, connect through the terminal and send AT+BOOT to the device. It should respond with <BOOT_MODE>
Then try to flash your application.

Thanks beegee. I have another question.

Does RAK3172 has the ability to be controlled via the TTN when to start/stop the operation?

That operation do you want to start or stop?
You can use downlinks from TTN to send data to the RAK3172. Whether the payload of this downlinks is data or a command depends on your implementation. The RAK3172 cannot be controlled directly by these downlinks. You have to implement the parsing of the downlink data in your application, either on the RAK3172 or on your Arduino UNO (not sure what you are using right now).

Im just using the RAK3172 for my project. I want to control when to start or stop the operation of my project but im not sure how to do it.

What do you mean with “operation of my project”?

Here is an example how to receive downlinks from the LoRaWAN server (TTN, Chirpstack, …) and process the received payload ==> RUI3-Relay-Class-C.
The example is opening or closing a relay.

For example, the PM sensor will start collecting data every 5 minutes. I plan to start the operation from 8 AM and stop it at 5 PM. Since it will be remotely deployed.

In this case I would use LoRaWAN timereq to sync the time once a day (or more often, you need to test).
Then use the internal time of the RAK3172 to check if it is between 8am and 5pm and do the measurements and send sensor data only in this time.

I have no simple example how to do it. But it is used in the RAK10706-Signal-Meter

If you want to do it from LNS, you need a backend application, e.g. NodeRED that initiates a downlink to the device with a command to start or stop measuring.
But in Class A, such a downlink is only received after the device has sent an uplink.
In Class C the device will receive the downlink immediately, but Class C has a higher pwoer consumption.

Got it. My code has encountered errors. I have installed the “https://raw.githubusercontent.com/RAKWireless/RAKwireless-Arduino-BSP-Index/main/package_rakwireless_com_rui_index.json” and installed the RUI3 library but my code appears like this:

C:\Users\Elaine Krystel\AppData\Local\Temp.arduinoIDE-unsaved2025710-25404-k4nab9.b3foo\sketch_aug10b\sketch_aug10b.ino:2:10: fatal error: RAKwireless_RUI3.h: No such file or directory
2 | #include “RAKwireless_RUI3.h”
| ^~~~~~~~~~~~~~~~~~~~
compilation terminated.
exit status 1

Compilation error: RAKwireless_RUI3.h: No such file or directory

RAKwireless_RUI3 library is for Arduino based devices, not for RUI3 devices. The library is not required for RUI3 devices.

To get access to the RUI3 API you do not need any other library, just use the calls as described in our RUI3 API documentation.

Do I need an additional webhook integration if I used time synchronization with TTN?

I never tried to generate downlinks from TTN.
I have it working on Chirpstack LNS, it should be similar in TTN.

In my case I am using a NodeRED instance.
NodeRED connects to the MQTT broker of the LNS.
If required, NodeRED publishes a MQTT subject that triggers an downlink to the device.
This MQTT subject has to be in the correct format, it usually includes LNS application ID, device ID, fPort and the payload.

I don’t have an example how this has to be look like with TTN. There might be other options either, you might check the TTN documentation how to create downlinks.

maybe I can just use NodeRED to control the RAK3172 when to start or stop. is that possible?

Sure, you need to find out how to trigger downlinks to the device through MQTT. I am sure there is somewhere a guide how to do it.

Hi Bernd!

Why is it that after I flash the firmware RAK3172-E in STM32, and try to send AT command, the device won’t respond OK?

What baud rate did you set?
TX/RX lines connected correct (TX–RX and RX–TX)
Arduino Uno (the ones I know) have 5V level on the UART, in this case you should use level-shifters
Commands must end with a CR LF sequence

  1. After i finished flashing the firmware, I tried to send AT command using Arduino IDE, but it does not respond. and when I try to upload a sketch, It says its not in the bootloader mode and cannot detect the baudrate

What firmware did you flash?
What BSP are you using to compile your firmware?

RAK3172-E latest final.hex… i am using arduino idea to upload my sketch on the device

If your code crashes, it could be the UART is blocked.

Use STM32CubeProgrammer and flash the factory firmware on the RAK3172, then try again.

In your code, make sure you have a delay of 5 seconds in your setup(), so that in case your code crashes, you can send an AT+BOOT command to recover it before the code crashes.

Do i need to press the reset button after flashing the firmware?