timmbogner / Farm-Data-Relay-System

A system that uses ESP-NOW, LoRa, and other protocols to transport sensor data in remote areas without relying on WiFi.
MIT License
526 stars 116 forks source link

Compiling error with LoRa in Arduino #90

Closed timmbogner closed 2 years ago

timmbogner commented 2 years ago

Just got this while reorganizing. I can't seem to tag you properly, Jeff, but I assume you'll see this 🙃

sketch\4_UART_Gateway.ino.cpp.o:(.literal._Z7getLoRav+0x90): undefined reference to `transmitLoRa(unsigned short*, SystemPacket*, unsigned char)'
sketch\4_UART_Gateway.ino.cpp.o: In function `getLoRa()':
C:\Users\webma\OneDrive\Documents\Arduino\libraries\ArduinoJson\src/ArduinoJson/Misc/SafeBoolIdiom.hpp:15: undefined reference to `transmitLoRa(unsigned short*, SystemPacket*, unsigned char)'
C:\Users\webma\OneDrive\Documents\Arduino\libraries\ArduinoJson\src/ArduinoJson/Misc/SafeBoolIdiom.hpp:15: undefined reference to `transmitLoRa(unsigned short*, SystemPacket*, unsigned char)'
C:\Users\webma\OneDrive\Documents\Arduino\libraries\ArduinoJson\src/ArduinoJson/Misc/SafeBoolIdiom.hpp:15: undefined reference to `transmitLoRa(unsigned short*, SystemPacket*, unsigned char)'
collect2.exe: error: ld returned 1 exit status

BTW, if I'm not mistaken you followed that note I made in the code about making the transmitLoRa() function equivalent to esp_now_send(). Much appreciated!

aviateur17 commented 2 years ago

Should have been resolved in PR #88 commit fdc941658ec3ab7d08dee555ef6d00dc8367fe80. Try adding function prototypes near the top of the file.

// Function prototypes
void transmitLoRa(uint16_t*, DataReading*, uint8_t);
void transmitLoRa(uint16_t*, SystemPacket*, uint8_t);
static uint16_t crc16_update(uint16_t, uint8_t);

In the dev branch, line #263 of fdrs_functions.h has the function prototypes. Can you check your fdrs_functions.h files and make sure they have the prototypes present on line #263?

aviateur17 commented 2 years ago

As in the other issue, it seems somehow the void transmitLoRa(uint16_t, SystemPacket, uint8_t); function itself was missing. Hopefully adding it back to fdrs_functions.h resolves the issue.

timmbogner commented 2 years ago

I believe it is fixed now. If I were a betting man, I'd bet this was my own fault. Thanks for your patience!