Connecting a PeaceFair Pzem-004T to an Espressif ESP8266


#82

To be honest I wouldn’t bother with either at the moment and leave the Pzem disconnected.

I would build up the PCB correctly and run the app in demo mode to see if it will run without an EEPROM reset.

Do you have access to an Android device?

Just for you I could amend the firmware to remove the EEPROM clearing code but there are occasions when this feature is useful i.e. when switching your ESP to another project or you have a change to the WiFi credentials etc. I want to avoid this if at all possible though.


#83

Ok Costas, thank you for your patience. So What I will do is reflash once more, plug the Wemos D1 in the Pcb but remove all connections to the PZEM (TX, RX and power). I will remove the potentiometer. Then I will configure through the App again and press the “DEMO OFF” button on the screen in the SETUP Tab, right ?


#84

That’s right the label “DEMO OFF” isn’t great as it could indicate pressing the button will turn the DEMO OFF but what it actually means in the current status is DEMO OFF and pressing the button will change the label to DEMO ON.


#85

All set ! :slight_smile:

I will now leave it running like this without touching it and see what happens !


#86

Looks like you are not connected to the server now, right?

What did Terminal show when the system went down?


#87

Okay … we are about 5 minutes later … “ESPProMOn is Offline” … I give up for now … :disappointed_relieved:

Device is showing up again as ESPPromon SSID … so EPROM erased again … a,d there was no power interruption, Wifi is very strong …

Yes, I have access ro Android tablet …

Next attempt will be for after the weekend … Any suggestions ?


#88

It was ok … For a few minutes in Demo mode …


#89

The terminal showed 23 KWh, Cost …
Set API details.

Then nothing anymore


#90

One question I did want to ask is did you reboot the ESP after the last time you flashed it if you flashed it locally rather than via OTA.

This is important for all ESP sketches to ensure the ESP reboots.


#91

After flash I have never “manually rebooted it”… But I do disconnect it from power after flashing and then insert it in the PCB. So actually it gets rebooted after flashing because of power off, right ? I always flashed it locally, not via OTA.


#92

Yes that’s the same as a manual reboot and required after every local flash. It’s an ESP “bug”.

We have several Pzem system’s running here and other users that have been online for months without the EEPROM clearing so I don’t know what your problem is.

I will think about it and maybe send you a version of the firmware without the EEPROM reset feature. Whilst ever you are working locally with the Pzem then the feature is not required because you can simply flash an EEPROM clearing sketch but when it’s buried deep inside a consumer unit there is the possibility you might need the feature.


#93

A version of the firmware without the EEPROM reset feature would be nice indeed.


#94

@Tony your firmware with the hardware EEPROM reset disabled is available for download at https://peacefairapp.com/peacefair/ESPproMon222Tony.bin

Don’t forget to ensure you do a hard reset of the ESP8266 after every local flash.

We still have the app software EEPROM reset feature in the firmware.

We have set the hostname (not SSID) to ESPproMonTony and you should see this in your router. Run it in demo mode for say 1 hour without putting it in the PCB. It’s been running fine here on a $40 Android phone for the last 30 minutes without any problems.

If it clears the EEPROM within the hour try your Android tablet instead of the iPhone.

If all goes well you can put the WeMos in the PCB but leave the Pzem unplugged and run in demo mode for say another 30 minutes.

At this point we can proceed to connecting the Pzem but it will only work if you have the pot / resistor pair wired up correctly. 50:50 on a 10K pot will certainly not work.


#95

Super !! Thank You !!! Will test and let you know the results ASAP !


#96

Can’t seem to find the App for Android. Searched in the Play Store for ESPProMOn and for Blynk as well but not there ? Also logged in on Pc with my gmail account and installed it via the browser where I could find it but doesn’t install on my tablet. Maybe my Android tablet version is too old … Android 4.2.2


#97

First test results with IOS and the “spevcial” .bin file … Unfortunately same issue … after only a few minutes (Wemos NOT in PCB) it loses it’s connection with the App. repro steps :

Don’t forget to ensure you do a hard reset of the ESP8266 after every local flash.
We still have the app software EEPROM reset feature in the firmware.

 Flashed OK
 Unplugged Power, waited few seconds, plugged power in again

We have set the hostname (not SSID) to ESPproMonTony and you should see this in your router. Run it in demo mode for say 1 hour without putting it in the PCB. It’s been running fine here on a $40 Android phone for the last 30 minutes without any problems.

 Shows up on router as ESP_755F74
 Connected wit App to ESPProMon

At first App is ok, shows IP address, MAC address … Then App shows disconnect after a few minutes.


#98

The link for Android is https://play.google.com/store/apps/details?id=cc.blynk.appexport.esppromon


#99

I have an Android 4.2.2 phone and it works OK on that.

You mean you used your PC to install ESPproMon to your tablet?


#100

I think if you refresh the page to the router it will show ESPproMonTony.

Is it still clearing the EEPROM or just resetting the ESP?


#101

Yes … But in the meantime I managed to find another Android device (Samsung Tab) and went through the installation process again. A whole different experience than with IOS I must say … Here I first select a WIFI SSID (selection works, not in IOS) and then the App asks me to connect to a ESPProMon device which I did. The App is now running in Demo mode, naked, not in the PCB, not connected to anything … Will keep you posted as I see what happens !