Comments (10)
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.
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.
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.
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.
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.
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.
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.
That worked, thanks!
from microocpp.
That's nice to hear! If you encounter more problems, please don't hesitate to report them.
from microocpp.
@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)
- Does PlatformIO + MicroOcpp not support IP addresses?
- Change WiFi interface for Ethernet HOT 1
- undefined reference to `setup()'
- How to implement/Use Authorization Cache HOT 1
- Support for binary data over websockets HOT 4
- BeginTransaction process with 2 connectors HOT 5
- addMeterValueInput Doesn't Work HOT 1
- Bug in void mocpp_initialize(const char *backendUrl,... HOT 4
- Issue with Inconsistent Responses for StopTransaction Requests HOT 3
- Meter values in ESP-IDF HOT 1
- Use of AuthorizeRemoteTxRequests Configuration Key HOT 2
- Error on Make - Invalid Initialization of Reference HOT 1
- Always Disconnected Problem
- Offline Behavior: Session Data Persistence HOT 4
- Saving the charging summary HOT 7
- Function to define the current limit of a EVSE HOT 4
- Commercially Available Options HOT 2
- FreeVending Mode for Two conectors Simultaneously HOT 2
- cppcheck fail (cppcheck --force src/MicroOcpp) HOT 3
- Charge profile limiting not working if current is set (tested with the simulator)
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from microocpp.