Please include the following information, in order for us to help you as effectively as possible.
What product do you wish to discuss? RAK4631, RAK3372, RAK11200, RAK11310, RAK11722?
RAK4631, RAK11722
What firmware are you using? (RUI3 or Arduino BSP or other IDE (e.g. STM32CubeIDE)?
RUI3
What firmware version? Can it be obtained with AT+VER=?
V 4.1.1
I want to know if it is possible to wake up rak4631 when it is in master mode using RS232 communication interfaces.
I am a little confused about this type of protocol, currently I must use a periodic timer to query the slave, but I want it to work so that when the slave is configured to automatically send data, the master in this mode listens without causing problems in tasks or loops.
For example, with the mangenic contact we can do this function by reading the relay status, would it be possible to do this by detecting the UART when it sends the data, wake up or if you have a better idea, welcome.
I am not a Modbus expert, but from what I know, a Slave cannot initiate a data transfer. This is always requested from the Master.
There can be multiple Slaves on the bus, how would it avoid collisions if any Slave would start sending data whenever it wants.
UART1 is disabled when Low Power Mode is enabled with api.system.lpm.set(1). The device will not wake up on received data.
There is no callback for data received on UART1. The only option is to poll the UART1 and check whether data is enable.
I don’t know a method that could do what you want to do.
Verifying other posts Carlos Woman indicates that it is possible but it is not clear to me
It will be possible what is indicated in the sent link
This connection diagram and what I need to do is that when Beevision 270 sends data through the RS232 port, the Rak4631-R wakes up, obtains the data and can process it to make decisions and send LNS.
verifying the RAK19007 has an RS232 input available to receive this data.
If I declared api.system.lpm.set(0) the device would never enter deep sleep mode and would always be waiting for when it receives UART1 data to process and send it?
Based on the image you’ve shown, there is no Modbus involved in your BeeVision. Maybe it supports modbus but not on what you’ve shown.
@beegee told you already the approach. You have to poll the data form the UART. There is no asynchronous callback that you can use.
One more thing is why not initiate data collection using get# as mentioned in the image. You can sleep then wake up in specific interval then get the data.
Beevision only handles RS232 to send data, the software has an automatic trigger to send this data without using the get# command which I understand works for testing.
Using RUI3 it is possible to make a code that is always waiting for data via UART1 and then process the data and send it to LNS.
I have been working with RUI3 based on events and it is a problem because going to sleep and only waking up at your predetermined time does not guarantee that I do not lose the data.
Have a different pin to check RX line then trigger the wake up, then the UART capturing of bytes will be done on the callback. Not sure if the fan out of the Beevision is enough.
Have an external MCU then use the RAK module only for transmission via AT commands.
Use a low level code on nRF52840 that will initialize the RX pin first as interrupt source then on wake up, immediately switch to UART RX. I am guessing on this one. I am not even sure if this works.