Can't compile LMIC for TTGO OLED module

(Jimgi) #1

I am trying to compile the standard OTTA LMIC Matthijs Kooijman examples from GitHub. If I enable verbose mode in the IDE, it appears to compile but not to link.
I obtained the library from here:
I haven’t actually changed anything in the code, assuming that it should compile even if I have chosen the incorrect board type, so long as I don’t try to download.
The header files included are:

#include <lmic.h>
#include <hal/hal.h>
#include <SPI.h>

// This EUI must be in little-endian format, so least-significant-byte
// first. When copying an EUI from ttnctl output, this means to reverse
// the bytes. For TTN issued EUIs the last bytes should be 0xD5, 0xB3,
// 0x70........

The errors I get are as shown below.
Have I missed something obvious?

Build options changed, rebuilding all
Archiving built core (caching) in: C:\Users\Jim\AppData\Local\Temp\arduino_cache_807155\core\core_esp32_esp32_ttgo-lora32-v1_FlashFreq_80,UploadSpeed_921600,DebugLevel_none_3327137c8228851dded9ef697d9464f4.a
sketch\ttn-otaa.ino.cpp.o:(.literal._Z7do_sendP7osjob_t+0x0): undefined reference to `LMIC'

sketch\ttn-otaa.ino.cpp.o:(.literal._Z7do_sendP7osjob_t+0x14): undefined reference to `LMIC_setTxData2'

sketch\ttn-otaa.ino.cpp.o:(.literal._Z5setupv+0x10): undefined reference to `os_init'

sketch\ttn-otaa.ino.cpp.o:(.literal._Z5setupv+0x14): undefined reference to `LMIC_reset'

sketch\ttn-otaa.ino.cpp.o:(.literal._Z4loopv+0x0): undefined reference to `os_runloop_once'

sketch\ttn-otaa.ino.cpp.o: In function `do_send(osjob_t*)':

E:\Projects_New\ESP32\LMIC\arduino-lmic-master\examples\ttn-otaa/ttn-otaa.ino:138: undefined reference to `LMIC_setTxData2'

sketch\ttn-otaa.ino.cpp.o: In function `setup()':

E:\Projects_New\ESP32\LMIC\arduino-lmic-master\examples\ttn-otaa/ttn-otaa.ino:157: undefined reference to `os_init'

E:\Projects_New\ESP32\LMIC\arduino-lmic-master\examples\ttn-otaa/ttn-otaa.ino:157: undefined reference to `LMIC_reset'

sketch\ttn-otaa.ino.cpp.o: In function `loop()':

E:\Projects_New\ESP32\LMIC\arduino-lmic-master\examples\ttn-otaa/ttn-otaa.ino:172: undefined reference to `os_runloop_once'

collect2.exe: error: ld returned 1 exit status

exit status 1
Error compiling for board TTGO LoRa32-OLED V1.

(Deux Vis) #2

What exactly is the board you use ? TTGO have many different products with an OLED.

What extension have you installed to include support for that “TTGO OLED module” ?

What board do you target in the arduino IDE ?

(Jimgi) #3

Thanks for getting back to me.
The board that I am using is the Wemos TTGO LORA32 868/915Mhz ESP32 LoRa OLED 0.96 Inch Blue Display.

This product is a SX1276 chip based on ESP32 WIFI increased OLED, namely LoRa remote modem, 868-915MHz frequency, high sensitivity is over-148dBm, + 20dBm output power, high reliability, long transmission distance.
the onboard 32MB Flash wi-fi antenna, 0.96 inch blue oled display, lithium battery charging circuit, CP2102 interface and USB serial chip, the perfect support for Arduino development environment, can be used for program checking and product development is very easy and fast.

I can compile and run the OLED display without any problem via the Arduino IDE.
This works with the TTGO Lora32-OLED V1 board definition in the IDE. I have tried a few others, with the same result.

The defines in config.h apprear to be set up for this chip, with the euro868 frequency band.

What do you mean by extension to support the TTGO OLED module?


(Jimgi) #4

Finally solved this. Deleted the libraries and re-installed LMIC using the Arduino IDE, and everything compiled as expected.
The TTGO ESP32 board is pretty good. Will post an example application on Github soon if anyone is interested.


Hello Jimgi

Looks Great you get them online:
I’m intresting in what yout want to build on it, looking forwar on you post here/or on github


I just installed Pax counter on that kind off device