RAK3172 Wakeup by RF?

With RUI_4.0.5_RAK3172-E and P2P mode, Is it posible to wakeup by radio? How to do?

If you setup the device correct, it will automatically wake-up on a received data packet.

If using AT command interface in LoRa P2P mode:

AT+PRECV=xxxxx

xxxxx larger than 0 will set the LoRa transceiver into RX mode and if a valid packet arrived, it will give feedback over UART2 with

+EVT:RXP2P:-112:1:1234

More details about AT+PRECV ==> AT Command Manual | RAKwireless Documentation Center

When using custom firmware based on RUI3 API:
Define callback functions:

/**
 * @brief LoRa P2P callback if a packet was received
 *
 * @param data
 */
void recv_cb(rui_lora_p2p_recv_t data)
{
	Serial.printf("P2P RX, RSSI %d, SNR %d\r\n", data.Rssi, data.Snr);
	for (int i = 0; i < data.BufferSize; i++)
	{
		Serial.printf("%02X", data.Buffer[i]);
	}
	Serial.print("\r\n");
}

/**
 * @brief LoRa P2P callback if a packet was sent
 *
 */
void send_cb(void)
{
	Serial.println("P2P TX finished");
}

Initialize the callbacks and set P2P RX mode:

	api.lora.registerPRecvCallback(recv_cb);
	api.lora.registerPSendCallback(send_cb);

	// Enable RX mode (always with TX allowed)
	api.lora.precv(65533);

Keep in mind that in RX mode, the LoRa transceiver is not in sleep mode. You have to expect a current consumption of several mA.
However, the MCU itself can go into sleep mode.

2 Likes

I just realized that in RX mode, the LoRa transceiver is not in sleep mode, Thank you.

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