Closed Navjot0005 closed 1 year ago
Hi @Navjot0005,
The ConnectorPluggedInput tells the OCPP library if the EV is plugged at the EVSE at the moment. In your code its value is always false so the library assumes that nothing is ever plugged. Remove setConnectorPluggedInput
and try it again.
Please reopen if you have follow up questions.
Hi @matth-x thanks for the reply. Now I can start and stop transaction remotely thanks for the support. Please can you tell me how this ocppPermitsCharge() will be true? Because I want to turn the relays ON here.Pls suggest
if (ocppPermitsCharge()) { //OCPP set up and transaction running. Energize the EV plug here
}
@matth-x Ok got it. It will be true when charging starts. Thanks very much @matth-x .
Hi @matth-x @pedro-fuoco , I working on ArduinoOcpp library and facing issue with transaction. I connected with CMS everything is ok. But when i give command from cms to start transaction remotely the status is changing from available to preparing but after some time it says timeout.
Below is the code i am using // matth-x/MicroOcpp // Copyright Matthias Akstaller 2019 - 2023 // MIT License
include
if defined(ESP8266)
include
include
ESP8266WiFiMulti WiFiMulti;
elif defined(ESP32)
include
else
error only ESP32 or ESP8266 supported at the moment
endif
include
include <ArduinoOcpp/Core/Configuration.h>
define STASSID
define STAPSK
/charge HQ/
/steve instance/
void setup() {
if defined(ESP8266)
elif defined(ESP32)
else
error only ESP32 or ESP8266 supported at the moment
endif
// setEnergyMeterInput([](){int EnergyMeter;return EnergyMeter;}, 1);
//addMeterValueInput([]{return 120;}, "Voltage", "V", nullptr, nullptr); addMeterValueInput([](){return 10;}, "Power.Active.Import", "kW", nullptr, nullptr, 1); addMeterValueInput([](){return 100;}, "Energy.Active.Import.Register", "kWh", nullptr, nullptr, 1);
addMeterValueInput([](){return 120;}, "Voltage", "V", nullptr, "L1", 1);
addMeterValueInput([](){return 120;}, "Current.Import", "A", nullptr, "L1", 1);
std::shared_ptr filesystem = ArduinoOcpp::makeDefaultFilesystemAdapter(ArduinoOcpp::FilesystemOpt::Use_Mount_FormatOnFail);
ArduinoOcpp::configuration_init(filesystem);
ArduinoOcpp::declareConfiguration<const char *>( "MeterValuesSampledData", "DEFAULT VALUE", CONFIGURATION_FN); //declare configuration and use the default value parameter (replace with required value) ArduinoOcpp::configuration_save(); //again, not really necessary
setSmartChargingCurrentOutput([](float limit) { //set the SAE J1772 Control Pilot value here Serial.printf("[main] Smart Charging allows maximum charge rate: %.0f\n", limit); });
}
void loop() {
}
Below is the ESP32 side log
[AO] info (ArduinoOcpp.cpp:376): Added ConnectorPluggedInput. Transaction-management is in auto mode now [AO] info (Connection.cpp:56): Connected to url: /ocpp16/205894 [AO] info (BootNotification.cpp:83): request has been Accepted [AO] info (StatusNotification.cpp:49): New status: Available (connectorId 0) [AO] info (StatusNotification.cpp:49): New status: Available (connectorId 1) [AO] info (SmartChargingService.cpp:523): New limit for connector 1, scheduled at = 2023-09-06T09:38:07.565Z, nextChange = 2037-01-01T00:00:00.000Z, limit = {-1.000000,-1.000000,-1} [AO] warning (MeteringService.cpp:73): could not find metering device for Current.Offered [AO] warning (ChangeConfiguration.cpp:153): validation failed for key=MeterValuesSampledData value=Current.Import,Current.Offered,Energy.Active.Import.Register,Power.Active.Import,Voltage [AO] info (TriggerMessage.cpp:29): Execute for message type StatusNotification, connectorId = -1 [AO] info (StatusNotification.cpp:49): New status: Available (connectorId 0) [AO] info (StatusNotification.cpp:49): New status: Available (connectorId 1) [AO] info (StatusNotification.cpp:49): New status: Preparing (connectorId 1) [AO] info (Connector.cpp:193): Session mngt: timeout [AO] info (StatusNotification.cpp:49): New status: Available (connectorId 1)
@matth-x Please guide me the path.