Giter Club home page Giter Club logo

Comments (10)

lincomatic avatar lincomatic commented on May 31, 2024 1

SPIFFS works just the same on ESP32 as on ESP8266.. you just have to #include <SPIFFS.h>
call SPIFFS.begin(true) before you use it, to autoformat the partition.
You have to make sure to specify a SPIFFS partition in your partition CSV file, too.

from microocpp.

 avatar commented on May 31, 2024

Hi Matth-X,

I'm wondering in regards to the same thing, are there any plans to port the library to ESP32 soon?

Thanks!

from microocpp.

matth-x avatar matth-x commented on May 31, 2024

Hi,

To be honest, I already use it with the ESP32 but just haven't updated the example section yet. Have you tried including

/* ESP32 WiFi libraries */
#include <WiFi.h>
#include <WiFiMulti.h>
#include <WiFiClientSecure.h>

instead of

#include <ESP8266WiFi.h>
#include <ESP8266WiFiMulti.h>

?

What does the compiler output say?

Hope I could help you.

from microocpp.

Fyod avatar Fyod commented on May 31, 2024

The first issue was that when I saved the zip int Arduino libraries, it would not show up in the File -> Examples.
So I just created a new sketch and copied over the example.

The includes are like this

#include <Variants.h>
#include <Arduino.h>
#include <ArduinoJson.h>
#include <WiFi.h>
#include <WiFiMulti.h>
#include <ESP8266-OCPP.h>
#include "OneConnector_HW_integration.h"

The errors are

/Documents/Arduino/libraries/ArduinoOcpp/src/ArduinoOcpp/Core/Configuration.cpp:162:41: error: declaration of 'T ArduinoOcpp::Configuration<T>::operator=(T) noexcept' has a different exception specifier
 T Configuration<T>::operator=(T newVal) noexcept {

In file included from /Documents/Arduino/libraries/ArduinoOcpp/src/ArduinoOcpp/Core/Configuration.cpp:5:0:
Documents/Arduino/libraries/ArduinoOcpp/src/ArduinoOcpp/Core/Configuration.h:61:7: error: from previous declaration 'T ArduinoOcpp::Configuration<T>::operator=(T)'
     T operator=(T newVal);

/Documents/Arduino/libraries/ArduinoOcpp/src/ArduinoOcpp/Core/Configuration.cpp: In function 'bool ArduinoOcpp::configuration_init()':
/Documents/Arduino/libraries/ArduinoOcpp/src/ArduinoOcpp/Core/Configuration.cpp:752:5: error: 'SPIFFSConfig' was not declared in this scope
     SPIFFSConfig cfg;

/Documents/Arduino/libraries/ArduinoOcpp/src/ArduinoOcpp/Core/Configuration.cpp:753:5: error: 'cfg' was not declared in this scope
     cfg.setAutoFormat(true);

...

Cheers!

from microocpp.

matth-x avatar matth-x commented on May 31, 2024

Okay, those messages look kind of familiar to me ... can you download the branch "develop" instead of "master" and try it again? Unfortunately, the persistent storage does not work for the ESP32 at the moment and I will migrate to LittleFS in the long run. You have to manually turn it off by setting the build flag AO_DEACTIVATE_FLASH (the Readme in https://github.com/matth-x/ArduinoOcpp/tree/master/examples/ESP32 explains it).

Furthermore, please make sure that your IDE uses version 6.17.2 of ArduinoJson. You might have to downgrade it.

I have added an example file for the ESP32. I hope it works for you. Please let me know if everything worked and btw., thank you for your feedback!

from microocpp.

Fyod avatar Fyod commented on May 31, 2024

So I downloaded the development version and tried the ESP32 example file, still getting some errors, but the T operator error is gone.

/Users/xxx/Documents/Arduino/libraries/ArduinoOcpp/src/ArduinoOcpp/Core/Configuration.cpp: In function 'bool ArduinoOcpp::configuration_init()':
/Users/xxx/Documents/Arduino/libraries/ArduinoOcpp/src/ArduinoOcpp/Core/Configuration.cpp:753:5: error: 'SPIFFSConfig' was not declared in this scope
     SPIFFSConfig cfg;
     ^
/Users/xxx/Documents/Arduino/libraries/ArduinoOcpp/src/ArduinoOcpp/Core/Configuration.cpp:754:5: error: 'cfg' was not declared in this scope
     cfg.setAutoFormat(true);
     ^
/Users/xxx/Documents/Arduino/libraries/ArduinoOcpp/src/ArduinoOcpp/Core/Configuration.cpp:755:5: error: 'SPIFFS' was not declared in this scope
     SPIFFS.setConfig(cfg);
     ^
/Users/xxx/Documents/Arduino/libraries/ArduinoOcpp/src/ArduinoOcpp/Core/Configuration.cpp: In function 'bool ArduinoOcpp::configuration_save()':
/Users/xxx/Documents/Arduino/libraries/ArduinoOcpp/src/ArduinoOcpp/Core/Configuration.cpp:895:5: error: 'SPIFFS' was not declared in this scope
     SPIFFS.remove(CONFIGURATION_FN);
     ^

exit status 1
Error compiling for board ESP32 Dev Module.

Not of concern:

WARNING: library ArduinoOcpp claims to run on espressif8266 architecture(s) and may be incompatible with your current board which runs on esp32 architecture(s).

Multiple libraries were found for "WiFi.h"
 Used: /Users/xxx/Library/Arduino15/packages/esp32/hardware/esp32/1.0.6/libraries/WiFi
 Not used: /Applications/Arduino.app/Contents/Java/libraries/WiFi

from microocpp.

matth-x avatar matth-x commented on May 31, 2024

The library is not compatible with the SPIFFS implementation on the ESP32 yet. The workaround is to delete the code which uses SPIFFS commands. Basically, if you delete everything inside the precompiler statements

#ifndef AO_DEACTIVATE_FLASH
    ... //code which uses unsupported SPIFFS library. Delete this
#endif //ndef AO_DEACTIVATE_FLASH

you should be fine. They are in src/ArduinoOcpp/Core/Configuration.cpp and src/ArduinoOcpp/Tasks/SmartCharging/SmartChargingService.cpp.

from microocpp.

Fyod avatar Fyod commented on May 31, 2024

That worked, thanks!

from microocpp.

matth-x avatar matth-x commented on May 31, 2024

That's nice to hear! If you encounter more problems, please don't hesitate to report them.

from microocpp.

matth-x avatar matth-x commented on May 31, 2024

@lincomatic Thank you, your input is much appreciated. Now the develop branch runs directly on the ESP32 without editing something before.

from microocpp.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.