Background: This thread speaks to an effort to get a RAK19007/RAK11310 to operate as a relay within a LoRaP2P flood-messaging network. The relay component is part of a larger project that seeks to bring inexpensive data transport in situations where third-party services are not available, cost-effective, or reliable. It is also an attempt to avoid the higher costs of LoRaWAN. It is possible to build a grassroots network for less than $US100. Have already successfully built such a network but the transceiver is no longer manufactured. So, am trying to transition to RAKwireless. All documentation and software for this project is posted at GitHub.
Problem:
Unable to get RAK11310 to alternate between transmit and receive within the same program. Able to do one or the other but not both within the same program.
In this thread: , @_beegee said, “For RAK11310: Set up both RX and TX parameters. Then enable RX while listening and if you want to transmit, just do the TX and on the TX finished callback switch RX on again. The PingPong example of the library does exactly that [operation of transceiver for alternating between transmitting and receiving], however, it is written generic for ESP32/nRF52/RP2040 and might need some changes or simplifications.”
Downloaded the PingPong example and tried to build it on my device. These error messages occurred: CompilationErrors.docx (14.3 KB)
In an effort to find correspondence between the undefined variables and the RAK11310, I looked at the datasheet. Not being deep into electronics, I could not clearly identify a correspondence between the undefined variables and the schematic labeling. I am reluctant to blindly accept the suggested substitutions.
RAK11310 is very powerful and makes an excellent network node. Has anyone had success getting it to alternate between receive and transmit within the same program?
I understand that it is not easy for some people to handle and understand how to change an existing code to work with another platform.
The errors you shared are obvious to me, you didn’t change the example to work with WisBlock modules.
There are a special initialization functions for RAK4631, RAK11200/RAK13300 and RAK11300 in the library documentation that make it easier to use the library with these Core modules.
To make it easier for the unexperienced, I added a simple LoRa P2P RX TX example to the library.
My experience is at the application level, building logical constructs that automation devices can carry out. It is true that I am inexperienced with RAKwireless devices. I missed seeing the link to the library documentation within the product-page documentation. (Did a lot of searching before posting a question.) Became stuck when the transceiver examples did not demonstrate transmit and receive within the same program. Even with the library documentation, I would never have arrived at the program you demonstrated.
From reading various internet forums, I am not the first to be confused by RAKwireless documentation. RAKwireless helping new customers work through that confusion does a lot to broaden the customer base and make RAKwireless devices usable in a widening range of applications. This customer-focus can only aid RAKwireless’ growth and stability.
I appreciate and am grateful for the guidance received. RAKwireless introduced RAK11310 as a more-meaty automation device and LoRa transceiver. That is very attractive as it allows flood-messaging networks to expand their capabilities. Am looking forward to continuing to work with this device. Those who contribute their advice are noted in the project’s documentation as it evolves to demonstrate LoRaP2P flood-messaging networks and their potential applications. One such application connects a camera to RAK19007/RAK11310 and sends the image over a flood-messaging network. This project is not just for myself as all its documentation and software are all posted on GitHub.
Many thanks for this @beegee. I did make a wee change to account for a busy channel so that the receiver would restart. Will eventually add code to ensure the message gets sent when the channel is not busy.
void OnCadDone(bool cad_result)
{
time_t duration = millis() - cad_time;
if (cad_result)
{
Serial.printf("RAK11310 CAD returned channel busy after %ldms --> Skip sending\n", duration);
Radio.Rx(RX_TIMEOUT_VALUE);
digitalWrite(LED_BLUE, LOW);
}
else
{
Serial.printf("RAK11310 Channel available after %ldms --> send now\n", duration);
Radio.Send((uint8_t *)tx_payload, 9);
}
}