Skip to content
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

Energy, Power, Current, Voltage value are always 0 #36

Open
vcba79 opened this issue Nov 13, 2024 · 5 comments
Open

Energy, Power, Current, Voltage value are always 0 #36

vcba79 opened this issue Nov 13, 2024 · 5 comments

Comments

@vcba79
Copy link

vcba79 commented Nov 13, 2024

Hi,

I am evaluating this simulator. Simulator and web are built smoothly but energy, power, current, voltage
in web are always 0, before charge and after charge. I searched around but can not find a solution. Do I
have to modify any file to get those values displayed? I modify evse.h and evse.cpp and those values
can display constantly but setchargingprofile will not limit power value.

any hint?

Thanks,

@vcba79
Copy link
Author

vcba79 commented Nov 14, 2024

I found this patch will display values after charging started. Please correct me if I am doing wrong.

diff --git a/src/evse.cpp b/src/evse.cpp
index a0261d6..3310300 100644
--- a/src/evse.cpp
+++ b/src/evse.cpp
@@ -119,14 +119,13 @@ void Evse::setup() {
}

void Evse::loop() {

 auto curStatus = getChargePointStatus(connectorId);

 if (status.compare(MicroOcpp::cstrFromOcppEveState(curStatus))) {
     status = MicroOcpp::cstrFromOcppEveState(curStatus);
 }
  • bool simulate_isCharging = ocppPermitsCharge(connectorId) && trackEvPluggedBool->getBool() && trackEvsePluggedBool->getBool() && trackEvReadyBool->getBool() && trackEvseReadyBool->getBool();
  • bool simulate_isCharging = ocppPermitsCharge(connectorId) && trackEvPluggedBool->getBool() && trackEvReadyBool->getBool() && trackEvseReadyBool->getBool();

    simulate_isCharging &= limit_power >= 720.f; //minimum charging current is 6A (720W for 120V grids) according to J1772

diff --git a/src/evse.h b/src/evse.h
index eaf37dc..bf028d5 100644
--- a/src/evse.h
+++ b/src/evse.h
@@ -26,11 +26,11 @@ private:
std::string trackEvseReadyKey;

 const float SIMULATE_POWER_CONST = 11000.f;
  • float simulate_power = 0;
  • float simulate_power = 1;
    float limit_power = 11000.f;
    const float SIMULATE_ENERGY_DELTA_MS = SIMULATE_POWER_CONST / (3600.f * 1000.f);
  • unsigned long simulate_energy_track_time = 0;
  • float simulate_energy = 0;
  • unsigned long simulate_energy_track_time = 10;

  • float simulate_energy = 1;

    std::string status;
    public:

scottaric added a commit to voltaric/MicroOcppSimulator that referenced this issue Nov 20, 2024
Remove this check to get the simulator to emit simulated data when "plugged in".  See matth-x#36
@huntc
Copy link

huntc commented Dec 6, 2024

@scottaric - any reason to not make your commit a PR? Thanks.

@srobinet
Copy link

srobinet commented Dec 6, 2024

@huntc I'm not a collaborator (yet). I'm not entirely sure if this will have any side-effects or is bypassing any other kind of simulated functionality, but it has indeed allowed me to proceed with what I needed to do. I'll work towards lining up a PR.

@scottaric
Copy link

@huntc FIgured out how to do a pull request - my first time on a fork.

#38

@vcba79
Copy link
Author

vcba79 commented Dec 21, 2024

After more experience on this package, I am sure what cause this problem. Bundled web has 3 button EvReady, EvseReady, EvPlugged to get charger prepared and EvsePlugged is always false if we check evse api in bundled web.

So '&& trackEvsePluggedBool->getBool() ' will cause problem, my probelm solved after remvoe this code in evse.cpp. Any other modification is not necessary.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants