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.
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).
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.
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.
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.
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
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
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.