OpenEVSE to cloud MQTT

I was able to set up my OpenEVSE to my wifi and created my Emoncms - user login account

But the guide is not clear on how to link the hardware to the cloud …

Also How do I access the hardware again ? I tried OpenEVSE.local and it did not work…

Am I supposed to place the device API somewhere?

:thinking::face_with_raised_eyebrow::face_with_monocle:

Hello @Niko-La did you follow the guide here? OpenEVSE / EmonEVSE Setup Guide — OpenEnergyMonitor 0.0.1 documentation

Some routers can be a bit unreliable with host names, it may be on http://openevse without the .local. If that does not work, try scanning your home network with an app called ‘fing’ to see if it can find it on your network.

If hostname lookup e.g http://openevse does not work, you can also use the IP address.

The OpenEVSE will display the local IP address on the LCD a few seconds after power up

@TrystanLea thanks for suggesting ‘Fing’. Great little app. I was able to find the charger ip and connect to it.

@glyn.hudson I was able to connect to the mqtt. Whenever the charger power on or off my mqtt client msg shows “connect” and “disconnected”

However when i send a RAPI command over mqtt such as reset, changed lcd color,
or set chargre rate, I do not see the charger performing those commands. I do see the command show up in my openevse/rapi/in suscription though.

Are you saying the MQTT disconnects each time you reboot the charger?

Could you post a screenshot of your MQTT setup from the the OpenEVSE Wifi setup web page?

I am getting a mqtt msg saying connected when the charger boots up & connects to wifi. When I unplug the power to the charger I get “disconnected” on my mqtt client. I assume this is coming from the websever or emoncms and not the actual device?
Here is the messages my mqtt client get from the suscription

I have attached the OpenEVSE mqtt screenshot. Its on an free open client for testing purposes.

Fyi.
My OpenEVSE firmware is 5.0.1
Online Web Wifi GUI says Version: V2.7.8

When the charger boots up it is not showing an ip address.
I have also attached my feed to emoncms

edit: added the link to charger boot up video
https://send.firefox.com/download/10650f1f8630c25a/#0ndhaN1pz_1dj5ilJDK-mQ

Edit 2:. Tried to send rapid command using the openevse.local/rapi

Tried to set current, get current read and temperature read from Evse . No response

I would think this is not a mqtt issue after this troubleshoot.

Finally I tried doing it via http post/get api this is the console response

That all looks good.

If the power is removed from the OpenEVSE I would expect it to disconnect from MQTT since the WiFi module in the OpenEVSE would not have any power and therefore not able to maintain the WiFi & MQTT connection. Is this what you mean?

the OpenEVSE is obviously successfully connected to your network since it has Internet access. It looks to me like the Wifi module is not able to communicate with the OpenEVSE EV controller. This would explain why the values in Emoncms are zero and RAPI commands are not working. I would recommend checking the serial connection between the OpenEVSE WiFi module and the controller, see Services - EmonCMS - OpenEVSE

When the WiFi module is correctly connected you should see “OpenEVSE Wifi” and IP address displayed on the LCD at startup.

Your also running a very old Wifi version, I would recommend updating to V2.8.1. This can be done via the web interface: Releases · OpenEVSE/ESP8266_WiFi_v2.x · GitHub

You are correct. It was a faulty rx-tx wire to the esp. And I did update to the latest esp-wifi firmware

So the good news is RAPI commands are working through the webapp. Able to disable , enable and set current.

Unfortunately, even though MQTT says connected and on the base “openevse” the intial connected, disconnected msg are showing up on my mobile mqtt client. The actual RAPI commands are not working over mqtt

These are my client publication and subscription



In an unreleated suggestion, it would be grest if the webserver can be hosted in the cloud so it can be accessed from anywhere outside the home network without messing around with router ip exposing or rever tunneling. Apologies if this is already possible.

And looking at the schematic, is the Atmega328 needed with the esp there? I realize openevse was build before without wifi and the wifi was added after. But if it was built again an esp alone is enough I would think.

Edit:

Page 4 prerequisites says “MQTT Broker on the network”

:face_with_raised_eyebrow::thinking:. My broker is hivemq not local.

“If the power is removed from the OpenEVSE I would expect it to disconnect from MQTT since the WiFi module in the OpenEVSE would not have any power and therefore not able to maintain the WiFi & MQTT connection. Is this what you mean?”

Blizzard the only mqtt msg are connect and disconected … :thinking::grimacing:

Great!

Did you upgrade to V2.8.1?

Could you post a screenshot of your MQTT setup?

The ATmega328 is required to handle the communication with the EV, this is safety critical and required analogue inputs from CT sensors. Isolating the safety critical EV communication from the WiFi gateway is a design decision.

This should not be a problem.

Running version 2.8.1

This is

I can set up a mosquitto mqtt broker in the cloud and check if that will help?

Thanks, that looks correct. Do you see “MQTT Connected: Yes” on the Services page?

Does MQTT dashboard not require a username / password?

What is the reason for using MQTT dashboard? I would recommend using local MQTT broker if possible since it’s not very secure to us an unencrypted cloud server. Do you have an emonPi? If so it has an integrated MQTT server. If not a MQTT server could be setup on a RasPi.

What is your goal with this setup? Do you want to get the data into Emoncms or do you have other uses for MQTT data?

I will setup a broker in my ubuntu pc and try it out.

The purpose is 2 reasons

  1. connect to node-red for more advanced automation logic
  2. send rapi commands using mqtt outside of local network

Is it possible to open up the openevse.local to be accessed outside of the local network?
either by

A) setting up the wifi gui using nodejs on a cdn and linking it to the openevse ?
B) easy reverse portforward? althought openevse.local only works on pc browsers and not on firefox or chome on mobile

thanks

@glyn.hudson

Setup a local mosquitto broker on my ubuntu.

Seems like the data is coming in every 30s fine


However this is the outcome of the test/rapi/in commands

when the message is " " i am not seeing it on test/rapi/in/$GP or test/rapi/in/$GV etc

i am not seeing anything in test/rapi/out/#


Pretty confusing issue.

@glyn.hudson is this a firmware issue ? I have run multiple mqtt brokers. nothing is showing up in the rapi/out but i see my commands in rapi/in

I’ve just tested myself and MQTT RAPI is working as intended. I like using MQTT Lense Chrome extension. MQTT server was running on my PC as localhost

Interesting.
Ya got it working on localhost broker and cloud broker.

Took a whilw to figure out that $FD $FE commands repsone come in /state suscription as 1 and 255 and not in /rapi/out

Ah, nice work. I guess this is because there is no RAPI response to these commands.