Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Compile errors with PlatformIO #118

Open
tk5ep opened this issue Aug 4, 2023 · 11 comments
Open

Compile errors with PlatformIO #118

tk5ep opened this issue Aug 4, 2023 · 11 comments

Comments

@tk5ep
Copy link

tk5ep commented Aug 4, 2023

HI, I'm trying to compile the ESP-1ch-Gateway with PlatformIO, but I get these errors :

C:/Users/Admin/Documents/PlatformIO/Projects/ESP-1ch-Gateway-master/src/_txRx.ino:309:44: error: call of overloaded 'abs(uint32_t)' is ambiguous

`c:\users\admin.platformio\packages\toolchain-xtensa-esp32\xtensa-esp32-elf\include\c++\8.4.0\bits\std_abs.h:78:3: note: candidate: 'constexpr long double std::abs(long double)'

abs(long double __x)
^~~

c:\users\admin.platformio\packages\toolchain-xtensa-esp32\xtensa-esp32-elf\include\c++\8.4.0\bits\std_abs.h:74:3: note: candidate: 'constexpr float std::abs(float)'
abs(float __x)
^~~

c:\users\admin.platformio\packages\toolchain-xtensa-esp32\xtensa-esp32-elf\include\c++\8.4.0\bits\std_abs.h:70:3: note: candidate: 'constexpr double std::abs(double)'
abs(double __x)
^~~

c:\users\admin.platformio\packages\toolchain-xtensa-esp32\xtensa-esp32-elf\include\c++\8.4.0\bits\std_abs.h:61:3: note: candidate: 'long long int std::abs(long long int)'
abs(long long __x) { return __builtin_llabs (__x); }
^~~

c:\users\admin.platformio\packages\toolchain-xtensa-esp32\xtensa-esp32-elf\include\c++\8.4.0\bits\std_abs.h:56:3: note: candidate: 'long int std::abs(long int)'
abs(long __i) { return __builtin_labs(__i); }
^~~`

*** [.pio\build\Gateway_38\src\ESP-sc-gway.ino.cpp.o] Error 1

Does anyone has a solution?

Also, I would like to use a NodeMCU v3 board. Any luck to succeed ?

Thanks, Patrick.

@MihaMarkic
Copy link

I've downloaded code as zip, compiled (on Windows) and it succeeds. Did you change anything? Using latest code?

@tk5ep
Copy link
Author

tk5ep commented Aug 5, 2023

Hi Miha,

Thanks for responding.
I've downloaded the version which is on the main page and haven't changed anything at all for a first test.

I use VSC 1.81.0 on Windows 10.

@MihaMarkic
Copy link

By your error log it might be a problem with xtensa stuff.
I'm using these board settings, try using them and see if it compiles

platform = espressif32
board = ttgo-lora32-v1
framework = arduino

@tk5ep
Copy link
Author

tk5ep commented Aug 6, 2023

Same results.

I tried to compile with the Arduino IDE. I also get a lot of errors despite all my corrections (libraries, wrong declarations)

I'm close to give up and I'm still looking for a working SCPF to make tests on the 433 MHz band.

@MihaMarkic
Copy link

MihaMarkic commented Aug 6, 2023

You have more libraries than me, odd, here are my (under lib directory)

aes
ArduinoJson
esp32-http-update
ESP8266_and_ESP32_Oled_Driver_for_SSD1306_display
ESP8266_Oled_Driver_for_SSD1306_display
gBase64
LoRaCode
Streaming
Time
TinyGPSPlus-1.0.2b
WiFiManager-development

and here is my only dependency declared in platformio.ini file

lib_deps =
  # RECOMMENDED
  # Accept new functionality in a backwards compatible manner and patches
  sandeepmistry/LoRa @ ^0.8.0

Try deleting your lib directory for starters and use my board configuration, I assume it will be recreated with just necessary libraries.

@tk5ep
Copy link
Author

tk5ep commented Aug 6, 2023

Thanks for taking the time to try to help me.
Removing the libraries didn't help. I can't imagine how VSC can put the right libraries if there are no libs deps declared.
I'm not a PlatformIO specialist, so I'm a bit stucked.

With an empty lib folder, I compiled several times and resolved the library errors, one by one.
I ad to change some library names in the main sketch and load newer library versions until it worked.

Now it compiles further but I have this error :
*** [.pio\build\TK5EP\firmware.elf] Implicit dependency C:\Users\Admin.platformio\platforms\espressif32\builder\lib_deps' not found, needed by target .pio\build\TK5EP\firmware.elf'.

The libraries loaded are :
Dependency Graph
|-- AES-128_V10
|-- ArduinoJson @ 6.14.0
|-- ArduinoOTA @ 2.0.0
|-- DNSServer @ 2.0.0
|-- ESPmDNS @ 2.0.0
|-- FS @ 2.0.0
|-- base64 @ 1.0.0
|-- SPI @ 2.0.0
|-- SPIFFS @ 2.0.0
|-- Streaming @ 5.0.0
|-- Time @ 1.6
|-- TinyGPSPlus @ 1.0.2
|-- WebServer @ 2.0.0
|-- WiFi @ 2.0.0
|-- WiFiManager @ 2.0.16-rc.2

Can you check if you have the same libs and versions ? (except for the WiFImanager I ihad to change, it didn't find a function in the original one)

Thanks,

@tk5ep
Copy link
Author

tk5ep commented Aug 6, 2023

I managed to succeed to compile for a TTGO board.

But as soon as I change some settings in the 2 config files, it's going mad !
Dependency problems, some errors, etc...

Did you succeed to flash a TTGO board and make a gateway working ?

If yes, can you send me your confignode.h and configGway.h ?

But I think, I will give up. :-(

@tk5ep
Copy link
Author

tk5ep commented Aug 6, 2023

SUCCESS ! I managed to compile and make the gateway work, after a lot of testing and tweaking.
I had to scratch my head how to configure the whole stuff (WiFi settings, gateway ID, etc...)

I use a TTGO T-beam 1.21 module.

It needed some time, but it finally works. I had to use the original config files and made only a very few adjustements.

The gateway reports to our local Chirpstark server.

But for the moment I can't decode my sensor board made with a demo sender software on an Arduino and sandeepmistry library.
Maybe a pin configuration ?

Does someone have a sketch for Arduino that works to send LoRaWan packets ?

Thanks,

@Bobkatze
Copy link

Bobkatze commented Aug 24, 2023

Can you share your Projectfile? I have been trying to compile it for the T-Beam V1.1, and have fixed some errors, but still cant compile and progress further with my current one.
EDIT: Nevermind, I successfully compiled it under arduino and got it running.
Did you manage to make the OLED display show information? Mine just remains empty.

@tk5ep
Copy link
Author

tk5ep commented Aug 25, 2023

Hi Bob,

Glad to hear that you managed to compile successfully.
Unfortunately, it looks like there is no support for this outdated package.

Yes, OLED works perfectly. I understand you have a T-beam I have a T3.
Did you correctly set the OLED type in configGway.h ? # define _OLED 1 as to be adjusted to the Oled type.

What band and frequency will you use ?

I can see my Gway receives packets, and forward them. But I can't see them on the Chirpstack server.
I need to be a bit more skilled in that.

Also decoding SF12 doesn't work, SF7 works perfectly.

@klaus-liebler
Copy link

My solution for the same compilation problem was in _txRx.ino:316:

if (abs((int32_t)(freqs[gwayConfig.ch].dwnFreq - fff)) < 100000) {

So, just add a typecast to int32_t.

HTH, regards Klaus

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants