Help setting up Solar PV divert (EcoMode) on OpenEVSE WiFi

Great work guys: :+1:

I am currently trying to get this working with my hardware, but seem to be having problems getting my OpenEVSE and EmonPi to talk to each other.

I have flashed the latest EmonPi image to a new card, flashed the OpenEVSE control board with 4.8.0 and the ESP8266 HUZZAH with ESP8266_WiFi_v2.x-master.

I can access the web servers of both the EmonPi and the ESP8266 from my PC without a problem.

In the Services tab on the ESP8266 I am trying to enable “Energy Monitoring” and “MQTT”, but they always show “Connected: No”.

One thing that seems suspicious, in the System tab, it shown the WiFi Firmware version as “BUILD_TAG”. Should there be a number there? Could I have a corrupted ESP8266?

Any hints or suggestions of things to try would be greatly appreciated.

Ok, I eventually spotted you have a pre-compiled binary “firmware.bin” available here.
I uploaded that and am now seeing V 2.7.0.

But I still cant get it talking to the EmonPi. I’m pretty sure I’m just getting my names, addresses, nodes, topics etc all muddled. Finding it hard to be sure what to enter where:

The user name I created when I first logged into the EmonPi web interface it “testpi”
These are the feeds I have setup:

And these are the parameters I am try to use:

Do these look ok?

Ok, so my “Energy Monitoring” and “MQTT” panels are now showing “Connected: Yes” :grinning:

I’m not sure how/why it started working. I think I just wandered off and came back later and it said “Connected” :thinking:

But I still can’t enable Eco mode, the little slider thing just flips off again after a couple of seconds when I try to enable it.

So, I guess I still haven’t populated the MQTT panel parameters correctly.

I have read the setup document but I doesn’t say explicitly what to do and I don’t currently understand enough about how it actually works in order to figure it out.

Do I need to create a new virtual feed on EmonPi for solar surplus, in my case that would be “solar - use” or does it pull what it needs from the EmonPi, and of so how does it know weather I have a type 1 ot type 2 setup, in my case type 2.

I’m pretty much stuck now. :frowning_face:

Hi Cliff,

Sorry for the slow reply. Good work getting up and running.

Are you running our latest emonSD pre-build emonPi/raspberry Pi SD card: emonSD pre built SD card Download & Change Log · openenergymonitor/emonpi Wiki · GitHub. It should say what version your running in the Pi section of Emoncms admin.

The MQTT username and password is the MQTT server user name and password. The default for the emonPi (unless you have changed them) is username: “emonpimqtt” password: “emonpimwtt2016” as defined here: Service Credentials - Guide | OpenEnergyMonitor. The Mosquitto MQTT server running on the emonPi (port 1880) is not open to the outside word to security is not too much of an issue.

I would recomend OpenEVSE controller FW V4.12.3 from the openenergymonitor/open_evse repo, this has a number of fixes including a fix to enable charging at 6A. See changelog on the releleases page. The reason for the firmware fork is that we’re maintaining the UK/EU specific FW which has a number of minor customisation to be CE complaint e.g. 32A max, proximity pilot support, L2 default level.

Perfect, nice work :+1:

What do you see on the Emoncms inputs? It looks like that one stage in time the openevse managed to post to Emoncms (3.9 days ago)!

If you have a type 2 setup I would recomend using “Grid (+I/-E) topic” and entering the MQTT topic for your grid import / export CT (CT1 in this diagram). Make sure the CT is orientated so power is positive when importing and negative when exporting. You will need to be using an AC-AC voltage adaptor with the emonPi to determine direction of current. The openevse will divert any excess power not being used by your house into your EV e.g

That’s strange. Could you try and toggle the switch with dev console open in your browser (CTRL + SHIFT + I) on Chrome. You should see Message Event with data {"divertmode":2}. This means eco mode is active. eg.

Please let me know how you get on. I’m now following this thread so will receive notifications. I will try and get back to you quicker next time.

1 Like

Would it be possible for an idots guide on how to update the firmware on the controller?

Thanks @glyn.hudson for your response. :smile:

It’s showing emonSD-26Oct17. I think that is the latest?

Got it. Although I assume you meant name: emonpi not emonpimqtt and password: emonpimqtt2016 not emonpimwtt2016? according to that link :wink:

Ok Done. Wasn’t aware of that one.

That seems to be working now, updating every 30sec. I think the 3.9 days ago thing was because I imported a backup from my working system to this bench setup (it wasn’t working on that system either though).

Got it. I was wondering why I couldn’t enter anything into the “Grid (+I/-E) topic:” box. Now I know it’s because you have to delete from the “SolarPV-gen topic:” first before the other one becomes editable.

Again, this seems to be working now, although I’m sure I didn’t do anything to make it work. I think it’s just shy and doesn’t like doing anything while I’m watching and waits until I go away and do something else for a while. :smile:

Actually, I now think I’ve figured out what most of my problems are/were. My browser (Internet Explorer 11 on Windows 7) doesn’t update the pages properly, so it appeared to be ignoring me on certain things. Once I started configuring it through my iPhone it seems ok. :thinking:

And now nature is playing a cruel joke on me. I’ve been several days trying to get this to work during which time I have had bright sunny days. Now I’m ready to test it, it’s overcast and snowing :frowning_face:

Many thinks for your reply. I will let you know how it goes next time the sun puts in an appearance.

I’m not sure if its possible to do over-the-air updates. If not I think you have to use an ISP programmer, or maybe through the serial port with an FTDI adapter and Arduino.
I used an Atmel AVR-ISP Mk2 and did it through AvrStudio IDE.
Do you have any programming kit available?

Hi Cliff

Sure do, I have one from the shop Programmer - USB to serial UART - Shop | OpenEnergyMonitor


Yes :+1:

Doh, yes your totally right. My mistake, the link is correct :see_no_evil: .
I will correct my post above.


Great. Oh dear, sorry to hear it’s not working on IE 11. We’ve tested on Edge, I’m afraid I don’t have easy access to a windows PC to test. I’ll try and setup a VM, although I don’t think IE 11 compatibility will be high on the dev list. Recommend updating if possible. Bit if it’s an easy fix I’ll do my best.

Same here, not a good day for solar. Lots of wind though, the UK grid was over 40% from wind today :smiley:

Let me know how you get on when the sun comes out.

You will need an ISP programmer. OpenEVSE have a guide to updating the controller FW:

Although if your using Linux i would recomend using AVRdude.

sudo avrdude -p atmega328p -c avrispmkII -P usb -e -U flash:w:XXXXXX.hex

Replace XXX with the name of the FW file and avrispmkII with the name of your ISP programmer. e.g. the ISP programmer sold via the openevse shop is stk500v2

Hi Glyn,

I would flash via windows and on the OpenEV page it says you need to download you will need 3 files: flash.bat, open_evse.hex and eeprom_24.bin.

I understand the flash.bat file and that i need to replace the open_evse.hex with your version but do i need the eepron_24.bin?

also can i just connect the openenergy programmer to the FTDI serial?

I think I remember reading somewhere that the code is very large and so the bootloader had to be removed to make room. So as Glyn said, you will need an ISP programmer. This would connect via the 6-pin connector with pins mosi, miso etc…
I believe you can use another Arduino, if you have one, as an ISP programmer, but I’ve never tried that.

40%! wow that’s impressive :open_mouth:

On a side note, I noticed that since loading 4.12.3.EU, the display starts to shimmer after a couple of minutes.
I’ve looked at the code and traced it to the timer used to provide the 2 minute forced display update required by the spec.
It’s just a missing line that updates the time variable each time it’s triggered. It’s inside loop() and should be:

  // Force LCD update (required for CE certification testing) to restore LCD if corrupted.
  if ((millis()-lastlcdreset)>120000) 
    lastlcdreset = millis();  // <--- MISSING LINE

I haven’t done any sort of collaborative code before, so I’m not sure what I should do. Do I just report it here or should I sign up for a github account and contribute it there somehow?

Oh good spot. I’ll fix this

Done: please could you try the latest release vD4.12.3.EU1 which includes the fix: Release 4.12.3.EU1 · openenergymonitor/open_evse · GitHub

I’ve marked this as a pre-release, I will do thorough testing on Monday when I’m in the lab. Thanks for reporting.

FYI: The usual way to report an issue is via github issues or if you wanted to submit a code request change the usual way is a github pull request.

Correct, this is exactly why. Also the openevse team did not want to make it too easy to change the openevse FW since it has important safety controls.

The eepron_24.bin is just the openevse config. I would skip flashing this to use the default config.

Yes, you can use this to read the serial and provide DC 5V power to the board, but an ISP programmer will need to be used to flash the open_evse FW.

Yup, the shimmer effect has gone now. Thanks.

Thanks, I will look into that for next time.
After pestering you with my dumb questions, it feels good to be able to contribute something back. :smile:

1 Like

Great, good to hear.

Indeed, thank you very much :+1: . It’s not pestering, any questions you have usually indicate a lack of documentation/explanation on our part.

Yay! Was blessed with some sun beams today, so was able to test it. It’s definitely doing something :smile:

I didn’t start logging the OpenEVSE amps until after I started, so missed some at the beginning.
The solar was pretty erratic, so it was a harsh first test, but I’m certainly pleased with the results.

1 Like

Yeah! That’s working perfectly :tada:

The charging rate is adjusted every 10s in 1A increments so it will track the solar PV output very closely.

Thanks Glyn. Got some more ev changing in today. Still working great. :+1:

I think, for sure the docs should strongly discourage using IE as it’s not currently supported.
If you just take the Session Status box, using my Apple iPhone or Android tablet, It instantly updates from “Not Connected” to “EV Connected” to “Charging” as it should. But with IE, no matter how much I try to refresh the page the status never changes. It’s the same with Windows 7 and 10.

I’m pretty sure if I’d known about this before, following your doc would have got me up and running without any problems.