-
Notifications
You must be signed in to change notification settings - Fork 118
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
Integration of ArduinoOcpp #182
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Some initial comments
src/MongooseOcppSocketClient.cpp
Outdated
MongooseOcppSocketClient::MongooseOcppSocketClient(String &ws_url) { | ||
this->ws_url = String(ws_url); | ||
|
||
if (DEBUG_OUT) Serial.print(F("[MongooseOcppSocketClient] Create connection to ")); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For OpenEVSE code, use the MicroDebug library for debug, handles compiling out the code as well as viewing via the web interface
src/evse_man.h
Outdated
@@ -39,12 +40,13 @@ typedef uint32_t EvseClient; | |||
#define EvseManager_Priority_Timer 100 | |||
#define EvseManager_Priority_Boost 200 | |||
#define EvseManager_Priority_Ohm 500 | |||
#define EvseManager_Priority_Ocpp 700 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
May need to be higher to override the manual control
src/evse_man.h
Outdated
#define EvseManager_Priority_Manual 1000 | ||
#define EvseManager_Priority_Limit 1100 | ||
#define EvseManager_Priority_Error 10000 | ||
|
||
#ifndef EVSE_MANAGER_MAX_CLIENT_CLAIMS | ||
#define EVSE_MANAGER_MAX_CLIENT_CLAIMS 10 | ||
#define EVSE_MANAGER_MAX_CLIENT_CLAIMS 11 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Shouldn't need to change this
readme.md
Outdated
@@ -1,556 +1,4 @@ | |||
# OpenEVSE WiFi Gateway v4 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please restore the original Readme
platformio.ini
Outdated
@@ -42,6 +43,8 @@ lib_deps = | |||
MicroTasks@0.0.1 | |||
ESP32 AnalogWrite@0.2 | |||
lorol/LittleFS_esp32@1.0.5 | |||
https://github.com/matth-x/ArduinoOcpp |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you publish to the Platform IO registry?
@@ -33,7 +33,8 @@ version = -DBUILD_TAG=4.0.0 | |||
monitor_speed = 115200 | |||
lib_deps = | |||
ArduinoJson@6.15.1 | |||
ArduinoMongoose@0.0.15 | |||
; ArduinoMongoose@0.0.15 | |||
https://github.com/matth-x/ArduinoMongoose |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Will need updating when ArduinoMongoose PR is merged and released
src/MongooseOcppSocketClient.cpp
Outdated
} | ||
|
||
MongooseOcppSocketClient::~MongooseOcppSocketClient() { | ||
if (DEBUG_OUT) Serial.print(F("[MongooseOcppSocketClient] Close and destroy connection to ")); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please use the DBUG... macros, debug is not always sent to Serial
src/app_config.cpp
Outdated
@@ -293,6 +312,28 @@ config_save_mqtt(bool enable, int protocol, String server, uint16_t port, String | |||
config.commit(); | |||
} | |||
|
|||
void | |||
config_save_ocpp(bool enable, String server, String ocpp_chargeBoxId, String ocpp_idTag, String tx_start_point, bool ocpp_suspend_evse, bool ocpp_energize_plug) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Shouldn't need to write specific functions to save, should be handled by the generic code
src/ocpp.cpp
Outdated
return 50; | ||
} | ||
|
||
void ArduinoOcppTask::poll() { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You shouldn't need a poll function, can all be in loop
src/web_server.cpp
Outdated
// url: /saveocpp | ||
// ------------------------------------------------------------------- | ||
void | ||
handleSaveOcpp(MongooseHttpServerRequest *request) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Shouldn't be adding explicit endpoint for OCPP, should use the generic config code
Thank you, I implemented all changes from your comments. Everything looked very reasonable to me. |
Hi @matth-x Nice work with this OCPP implementation 👍 I've had a go at testing it, I've been able to successfully connect it to an OCPP server. However, I've not had any luck sending commands to the unit, but this is probably because I'm not too familiar with using Steve and the options available on OpenEVSE OCPP config page. Would it be possible to arrange a video chat with you to go over the feature? I think it would be good to add some pop-out info boxes on the UI, to help explain what all the options do. I've been unable to push a remote start transaction, Steve throws error "User ID Tag is required", but doesn't list any tags for me to select, the tag I've created a beta build (V4.1.0) with includes your OCPP PR: https://github.com/OpenEVSE/ESP32_WiFi_V4.x/releases/tag/4.1.0 |
Hi Glyn, thank you for the compliment :) Yes, some documentation on the configurations would definitely be a good idea. We can have a call next week, I send you the possible time slots per pm. The ID Tag is used to identify the user who is about to start the charging session. In our case that function is obsolete (because the CP doesn't have an RFID reader) but SteVe requires a valid user entry in its DB nevertheless. You can activate it in the ID Tag page by searching for the blocked ones (SteVe creates a "default entry" for each unknown tag) and setting its maximal concurrent usages from 0 to 1. |
First draft integration of OCPP 1.6. This code is able to make a test-connection to SteVe, and to handle some basic OCPP operations (Start- and StopTransaction, MeterValues, SmartCharging)