ricaun / LoRaWanPacket

LoRaWanPacket Encode / Decoder
MIT License
10 stars 2 forks source link

Confused about LoRaWanPacket.print () #7

Open PanduHalimie31 opened 2 years ago

PanduHalimie31 commented 2 years ago

Hello, Excuse me. I'm currently learning about sending an up-link data with RFM95 to Antares.

I'm confused about how does LoRaWanPacket.print() works because when i try LoRaWanPacket.println() it's not working. I basically want to send a data with a new line instead of continuing the last line with .print(). Tried few other methods but the answer still the same as before.

Sorry for bothering and Thank you in advance.

Samuel-ZDM commented 1 year ago

Hi!

To send an uplink message, you must create the send package.

In the examples, there is a function that assembles the package and sends it. The LoRa_sendMessage() function shows you how to do it.

void LoRa_sendMessage() { busy = 1; LoRa_TxMode(); LoRaWanPacket.clear(); PayloadNow(LoRaWanPacket); if (LoRaWanPacket.encode()) { LoRa.beginPacket(); LoRa.write(LoRaWanPacket.buffer(), LoRaWanPacket.length()); LoRa.endPacket(true); } }