gropi75 / SEM32

SEM32 (Solar Energy Manager 32) based on ESP32 for Soyosource Inverter, Huawei r4850g2 power supply and 48V battery
MIT License
11 stars 3 forks source link

"pio run" failed #30

Closed zwim closed 10 months ago

zwim commented 11 months ago

pio run produces the following error(s).

output.txt

Can you give me a hint to solve the problem?

gropi75 commented 11 months ago

Do You have git installed? Seems Your issue is similar to that one, which is discussed here.

zwim commented 11 months ago

Yes git is installed. And the link is of no help. I have deinstalled and reinstalled platformio in the recommended way, but the same error exists. I have found https://github.com/espressif/arduino-esp32/discussions/8572 which gives the same error as I have. But the solution proposed there does not help either. :(

zwim commented 11 months ago

OK, I believe I am one step further now: Totally uninstalled platformio, removed .platformio-Folder, reinstalled and changed in platform.ini:

platform = https://github.com/Jason2866/platform-espressif32.git#Arduino/IDF5
platform_packages = framework-arduinoespressif32 @ https://github.com/Jason2866/esp32-arduino-lib-builder/releases/download/1643/framework-arduinoespressif32-release_v5.1-f45a4361b2.zip

and

lib_ignore =
        ESP Async WebServer     ; force the use of the esphome version
        AsyncTCP                        ; force the use of the esphome version
        LittleFS_esp32          ; force the use of the ESP32 built into the core version

and now I am getting only errors about a missing CAN.h for the esp32dev target.

Where does CAN.h come from?

(For the BSC target, there are errors with xtensa-esp32-elf-g++: error: unrecognized command line option '-std=gnu++2b'; did you mean '-std=gnu++2a')

gropi75 commented 11 months ago

I used the CAN library from sandeepmistry. But there were some issues depending on the revision of Your ESP32. The best is, if You modify the ESP32SJA1000.cpp:

< ... modifyRegister(REG_BTR1, 0x80, 0x80); // SAM = 1 // modified !!!!!!! //writeRegister(REG_IER, 0xff); // enable all interrupts //enable all interrupts (BUT NOT BIT 4 which has turned into a baud rate scalar!) writeRegister(REG_IER, 0xEF); ...

Next days I will try to update my respository with that.

gropi75 commented 11 months ago

see above

zwim commented 11 months ago

Hmm. I think closing this might be a bit to early, as I still have issues in compiling the thing. :(

gropi75 commented 11 months ago

@zwim Can You give some details?

zwim commented 11 months ago

I get errors like .pio/libdeps/esp32dev/AsyncTCP/src/AsyncTCP.cpp:79:8: error: 'xQueueHandle' does not name a type; did you mean 'QueueHandle_t'? Huawei R4850G2 .pio/libdeps/esp32dev/ESPAsyncWebSrv/src/AsyncWebSocket.cpp:1264:3: error: 'mbedtls_sha1_finish_ret' was not declared in this scope; did you mean 'mbedtls_sha1_finish'? and so on.

gropi75 commented 11 months ago

Strange. I downloaded from github my repo as zip, unzipped. Than I renamed the secrets_dummy.h to secrets.h and copied the updated CAN library to .\lib\CAN. In vscode I use the platformio plugin. So I did not downloaded the library by hand, platformio did that for me. I attach the log. Can You compare with Yours? BTW: If You want a faster compilation, You can set to compile either the BSC or the esp32dev variant.

log.txt

zwim commented 11 months ago

Thanks for the log.txt

my log.txt ``` Processing esp32dev (platform: https://github.com/platformio/platform-espressif32.git; board: nodemcu-32s; framework: arduino) ---------------------------------------------------------------------------------------------------------------------------------------------- Verbose mode can be enabled via `-v, --verbose` option CONFIGURATION: https://docs.platformio.org/page/boards/espressif32/nodemcu-32s.html PLATFORM: Espressif 32 (6.4.0+sha.f6ec392) > NodeMCU-32S HARDWARE: ESP32 240MHz, 320KB RAM, 4MB Flash DEBUG: Current (cmsis-dap) External (cmsis-dap, esp-bridge, esp-prog, iot-bus-jtag, jlink, minimodule, olimex-arm-usb-ocd, olimex-arm-usb-ocd-h, olimex-arm-usb-tiny-h, olimex-jtag-tiny, tumpa) PACKAGES: - framework-arduinoespressif32 @ 3.0.0+sha.4b3aebe - tool-esptoolpy @ 1.40501.0 (4.5.1) - tool-openocd-esp32 @ 2.1100.20220706 (11.0) - toolchain-xtensa-esp32 @ 8.4.0+2021r2-patch5 KeyError: 'framework-arduinoespressif32-libs': File "/home/moscht/.platformio/penv/lib/python3.11/site-packages/platformio/builder/main.py", line 173: env.SConscript("$BUILD_SCRIPT") File "/home/moscht/.platformio/packages/tool-scons/scons-local-4.5.2/SCons/Script/SConscript.py", line 598: return _SConscript(self.fs, *files, **subst_kw) File "/home/moscht/.platformio/packages/tool-scons/scons-local-4.5.2/SCons/Script/SConscript.py", line 285: exec(compile(scriptdata, scriptname, 'exec'), call_stack[-1].globals) File "/home/moscht/.platformio/platforms/espressif32/builder/main.py", line 346: target_elf = env.BuildProgram() File "/home/moscht/.platformio/packages/tool-scons/scons-local-4.5.2/SCons/Util/envs.py", line 242: return self.method(*nargs, **kwargs) File "/home/moscht/.platformio/penv/lib/python3.11/site-packages/platformio/builder/tools/piobuild.py", line 61: env.ProcessProgramDeps() File "/home/moscht/.platformio/packages/tool-scons/scons-local-4.5.2/SCons/Util/envs.py", line 242: return self.method(*nargs, **kwargs) File "/home/moscht/.platformio/penv/lib/python3.11/site-packages/platformio/builder/tools/piobuild.py", line 121: env.BuildFrameworks(env.get("PIOFRAMEWORK")) File "/home/moscht/.platformio/packages/tool-scons/scons-local-4.5.2/SCons/Util/envs.py", line 242: return self.method(*nargs, **kwargs) File "/home/moscht/.platformio/penv/lib/python3.11/site-packages/platformio/builder/tools/piobuild.py", line 342: SConscript(env.GetFrameworkScript(name), exports="env") File "/home/moscht/.platformio/packages/tool-scons/scons-local-4.5.2/SCons/Script/SConscript.py", line 662: return method(*args, **kw) File "/home/moscht/.platformio/packages/tool-scons/scons-local-4.5.2/SCons/Script/SConscript.py", line 598: return _SConscript(self.fs, *files, **subst_kw) File "/home/moscht/.platformio/packages/tool-scons/scons-local-4.5.2/SCons/Script/SConscript.py", line 285: exec(compile(scriptdata, scriptname, 'exec'), call_stack[-1].globals) File "/home/moscht/.platformio/platforms/espressif32/builder/frameworks/arduino.py", line 41: SConscript( File "/home/moscht/.platformio/packages/tool-scons/scons-local-4.5.2/SCons/Script/SConscript.py", line 662: return method(*args, **kw) File "/home/moscht/.platformio/packages/tool-scons/scons-local-4.5.2/SCons/Script/SConscript.py", line 598: return _SConscript(self.fs, *files, **subst_kw) File "/home/moscht/.platformio/packages/tool-scons/scons-local-4.5.2/SCons/Script/SConscript.py", line 285: exec(compile(scriptdata, scriptname, 'exec'), call_stack[-1].globals) File "/home/moscht/.platformio/packages/framework-arduinoespressif32/tools/platformio-build.py", line 40: FRAMEWORK_LIBS_DIR = platform.get_package_dir("framework-arduinoespressif32-libs") File "/home/moscht/.platformio/penv/lib/python3.11/site-packages/platformio/platform/_packages.py", line 32: pkg = self.get_package(name) File "/home/moscht/.platformio/penv/lib/python3.11/site-packages/platformio/platform/_packages.py", line 29: return self.pm.get_package(spec or self.get_package_spec(name)) File "/home/moscht/.platformio/penv/lib/python3.11/site-packages/platformio/platform/_packages.py", line 21: owner=self.packages[name].get("owner"), ========================================================= [FAILED] Took 0.49 seconds ========================================================= ```

It seems that I use some newer libraries than you: PLATFORM: Espressif 32 (6.4.0+sha.f6ec392) > NodeMCU-32S, - framework-arduinoespressif32 @ 3.0.0+sha.4b3aebe

gropi75 commented 11 months ago

Pls. try to compile just the bsc variant or replace in the platformio.ini on line 57: platform = https://github.com/tasmota/platform-espressif32/releases/download/2022.12.0/platform-espressif32.zip

Is there any difference?

gropi75 commented 10 months ago

Can not be reproduced.