SX12XXLT LoRa library - Function to collect data

I have been using SX12XXLT LoRa library for LoRa p2p and it has been working well so far. However, I want to assign the received value to a variable in addition to displaying it on the serial monitor.

I am using another library for the transmitter and I cannot seem to figure out a way to assign the received value to a variable so I can process it (perform calculations etc).

For example, if I send "123456" from the transmitter, I want to store the message on an array or a string format on the receiver's end rather than simply displaying it. For the "packet_is_OK()" function, is there another function I can use other than 'printASCIIPacket'

Thank you.

Often causes problems if you try to mix library versions, best to avoid it where possible.

123456 is a uint32_t integer, so why not have the transmitter send it as a uint32_t (4 bytes) wherupon it can be read directly from the LoRa receivers buffer as a uint32_t.

123456 is a uint32_t integer, so why not have the transmitter send it as a uint32_t (4 bytes) wherupon it can be read directly from the LoRa receivers buffer as a uint32_t.

I will give it a try, thank you for the recommendation.

See also the examples in the \LowMemory folder, where there are examples of reading variables direct from the LoRa device, you do need to know the order and type of variables in the received packet, example;

 LoRa.startReadSXBuffer(0);               //start buffer read at location 0
  LoRa.readBufferChar(receivebuffer);      //read in the character buffer
  latitude = LoRa.readFloat();             //read in the latitude
  longitude = LoRa.readFloat();            //read in the longitude
  altitude = LoRa.readUint16();            //read in the altitude
  satellites = LoRa.readUint8();           //read in the number of satellites
  voltage = LoRa.readUint16();             //read in the voltage
  temperature = LoRa.readInt8();           //read in the temperature
  RXPacketL = LoRa.endReadSXBuffer();      //finish packet read, get received packet length
1 Like

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