Compilation error in cpp

I am trying to establish LoRa P2P scripts for TTN Uno devices and am using those by weigu.lu. I have copied all the files and have tried to compile the simple_send and the simple_receive scripts and get the following from each. Seems to be an issue with defining Serial1 and Serial2. (This is just the tail end as it's quite a long message, but repetitive). Help! How can I address this please?

LoRa_RN2483_p2p.cpp:513:5: note: suggested alternative: 'Serial'
Serial1.print("sys get ");
^~~~~~~
Serial
C:\Users\Bob Johnson\Documents\Arduino\libraries\LoRa_RN2483_p2p-main\LoRa_RN2483_p2p.cpp:518:5: error: 'Serial2' was not declared in this scope
Serial2.print("sys get ");
^~~~~~~
C:\Users\Bob Johnson\Documents\Arduino\libraries\LoRa_RN2483_p2p-main\LoRa_RN2483_p2p.cpp:518:5: note: suggested alternative: 'Serial'
Serial2.print("sys get ");
^~~~~~~
Serial

Using library LoRa_RN2483_p2p at version 0.0.2 in folder: C:\Users\Bob Johnson\Documents\Arduino\libraries\LoRa_RN2483_p2p-main
exit status 1

Compilation error: exit status 1

A Uno doesn't have a Serial1.
Or a Serial2.

Thanks for the quick response. Can I just edit the .cpp file to remove the references to Serial1 and Serial2, leaving Serial only? I wondered why there were 3 serial definitions?

Obviously this code is not for Uno. You can replace all the Serials with one, but the code is unlikely to work after that

It seems that this library is for ESP32 only.

For Uno/Nano use this library:

Thanks. I've looked at that but there is nothing I can use to modify for a very simple P2P LoRa application. I have 2 TTN (uno and Leonardo) boards but there is no TTN gateway within reach (sadly). Any hints on where I could start please? (I'm new if you hadn't already guessed!)

Sorry, I know nothing about TTN.
I just try to fix your compilation issue

Thanks for trying. I guess I'll try asking a different question more focussed on the main intent (LoRa P2P). I appreciate your help.

Solved! The "The Things Uno" Lora module actually works as a Leonardo!

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