@Tony looks like your system has made it safely through the night without clearing the EEPROM.
Absolutely !!! ! Just one remark … The voltage divider 1K/2K did not work for me so I currently have the PZEM connected directly to D6/D7 of the Wemos !
Next step : get the data to a portal (Thingspeak, EmonCMS … ?) and then build the final version in a nice looking box. Fibnal goal … get a dashboard with my consumption versus energy injection from my solar panels. Ideally, include every major energy absorbing device monitored individually. (Doing this already using Fifthplay but doesn’t integrate with anything unfortunately)
For many users it’s not a problem to connect the Pzem directly to the WeMos but it’s an extra precaution that we recommend. The ESP8266 community is divided, no pun intended, as to whether it’s safe to feed WeMos data pins with 5V. As you know it’s actually about 4.6 to 4.8V that is feeding the Pzem from the WeMos and I believe the return to the RX pin on the WeMos is possibly less than the actual input to the Pzem.
Globally many users, me included, have accidentally or intentionally made a direct connection and not observed any visible problems after many months of use. The benefit of a direct connection is that is a simple plug and play so you don’t have to adjust a pot or the resistors to get the ideal return voltage to the WeMos.
If a user only has 1 WeMos, has a lead time of 6 weeks for a replacement WeMos and is planning to bury the WeMos deep inside a consumer unit we would recommend a voltage divider.
If your WeMos is going to be fairly accessible and you have a spare then it’s probably fine to risk running it without the voltage divider.
Now Thingspeak, EmonCMS and Fifthplay - don’t enter any API keys via the app or you are almost certain to have problems. Things need to be set up in a very specific way with these 3rd party networks for the ESPproMon to accept the API key. If you do it wrong our servers and the 3rd party networks at best restrict your access and at worse close down your account.
I have provided some of the basic details of how to set up Thingspeak or EmonCMS but I still need to add further instructions. Thingspeak is easiest but EmonCMS is my personal preference.
I am not familiar with Fifthplay but I can check them out. Do you have a link to their API etc?
I know you are fairly familiar with Thingspeak but we need to go through the exact process before you enter any API keys in the app.
Assuming we can integrate Fifthplay into our app which would be your preference to use with our app between the 3 different networks?
As for the voltage divider, I will look into an alternative by putting a level shifter or similar between the two. But will also keep a spare Wemos D1 flashed on hand.
I tried to set up EmonCms (entered the API key and the node number) but get no results in their portal yet. As you advise against it, I will clear the key for now. Fifthplay AFAIK has no API available nor do they integrate with IFTTT or anaything else basically. So I will probably abandon them and get some plugs that measure energy consumption. Ideally again, I would like to integrate all in one single home automation portal. I am using Smartthings for home automation and Actiontiles as an interface for most stuff. Having energy consumption and solar panel production nicely in some dashboard would be great. I believe that solutions like yours will gain a lot more attention but there’s a huge lack of integration of all that stuff. Currently I have Smartthings, Philips Hue, Tado Smart thermostat, Solar Panel solution with API that I still need to examine, the Fiftplay plugs, IP cameras and lots of ESP based devices measuring and switching stuff.
The work you did in Blynk is amazing, big kudos for that !!! There’s still some stuff in there that I’m not sure of how to read/use but I’ll get around that soon enough. As for integration of all these devices and functionality, one central “hub” such as Actiontiles would be ideal since it represents visually all information about your home and it’s devices and let’s you inteact with them through a simple tablet with a browser that you can install somewhere permanently in the house as your control panel.
As you are aware Blynk has some excellent tools that we used to build the smartphone app and hopefully we can help with some of the integration.
The app is already way too complex for Joe Public and even the relatively simple task of flashing the initial firmware is not fool proof, as you have proved So we have to be careful to try and only add generic features to the app that will have broad appeal to many users.
I love the Peacefair Pzem, WeMos, 3rd party networks, Blynk and the way it’s all tied up in the ESPproMon app. Obviously as the app developer it’s a little easier for me to do the integration and make full use of the temperature sensor, RF transmitter, surveillance cameras and geo-location control etc as I wrote the firmware.
I do hope so as it’s taken quite a bit of effort to get to the stage we are at and there are lots of further work we could do if the industry shows some support for our app. Hopefully you can help us by providing reviews and ratings of the app on iTunes and the Google Play store etc.
ESPproMon already has a lot of this covered. The firmware already has basic code to bridge to additional ESP’s but again there is some much more we can do. The QR code you scan is just one of 5 different versions of the app that users can switch between and a quick firmware update can turn it into a totally different project.
Thanks for your comments.
I will get back to you shortly about EmonCMS integration.
I think we will take the discussion regarding EmonCMS integration to the dedicated thread at ESPproMon Integration
Just to clarify it’s only the Peacefair Pzem 004 and 004T that have a TTL port so you can’t easily hook up any of the other Peacefair models to an ESP8266.
We always recommend the split core current transformer (CT) and we feel it’s worth paying a few dollars more for the LED display.
The photo above is what you need to order or alternatively the same unit but without the LED display and case.
When we buy these units we purchase them direct from the manufacturer on AliExpress.
This is the link for their listing.
Regarding the flash of bin file, can i flash it using the ESP8266 Download Tool, or i can only flash using the esptool.py ??
You can use any flashing tool you are comfortable with.
I have this:
Is it safe to Start? And how do i know that the flash was well done?
Mean while, i was looking at the connections between the WeMos and the PZ.
I have no ideia where which is the VDD, Rx, Tx and GND…
And i have to buy and usb to micro usb adaptor. The PZ cable is only USB
Also, i read about the 5V and 3,3V. Do you advise to change the voltage to 3,3V ?? Whats a PCB?
No, set the SPI mode to DIO as per the screenshot I linked to.
You will see the progress of the flash and it’s pretty clear when it’s been done.
After the flash the WeMos should appear on your WiFi network as an access point called “ESPproMon”.
I will get back to you regarding the connections and the cable etc.
PCB means printed circuit board, basically the green board shown in the first image of the thread. We sell them but the system can be built without one and we recommend thorough breadboard testing before going live in an electrical consumer unit.
The USB cable you have is to use some fairly basic software that Pzem provides for PC use.
I was going to say you could hack the cable but its best to keep it as it is.
You need to solder the 8 pin headers on each side of the WeMos.
Do you have 4 dupont cables, preferably male one end to go into a breadboard and female to connect to the Pzem at the other. I’m assuming you have a breadboard.
Have you seen the required connections from the start of this thread?
I believe you wrote in the other thread that you have 2 WeMos i.e. one as a backup. We are 99% sure that as long as you wire it up correctly that 5V to 3.3V is not an issue. As you have a backup I would wire the cables directly without a voltage divider. If you only had 1 WeMos and it would take up to 6 weeks to get another from the Far East we would say add the voltage divider.
I did the flashing and the only SSID i get is MicroPython-1d8884.
I will buy from ali a breadboard and dupont cables, and then i get back.
Both wemos are for 2 solar appliances i have!!
That’s not from our firmware.
Try the flash again and what do you see in the router interface for the WeMos?
Did you buy 2 Pzem’s?
I am using this firmware:
Which router interface??
I have 2 PZEM’s. One is to monitor the power from the solar appliance, the other is to monitor the power from the grid provider.
That is the correct file but our firmware doesn’t have any references to MicroPython access points.
Upload a screenshot of the next flash that you do, showing the flash worked OK.
Maybe your WeMos supplier is sending them out with MicroPython flashed on them but that means you are not flashing our firmware correctly.
The router interface is a visual representation (known as a GUI) of the settings for the device.Normally accessed on 192.168.1.1 or something similar with a username and password. Some ISP’s lock down their routers so end users can’t use the GUI.
This is the after flash
When i scan for ssid there is the micropython ssid, also i did a scan in the router and i get the micropython ssid.
Of both WeMos, only 1 has the micropython ssid, the other has no ssid.
I see what the problem is.
As per the link to the screenshot I provided you need to:
- Click the box to the left of the path to the bin file.
- Add the address of 0x000000 in the box to the right of the path to the bin file.
The bin file should then be highlighted in green and you can flash again.
Copy of screenshot for reference, ignore the name of the bin file in the screenshot as that was just a bespoke bin file for a user to test.
Done! I flashed both Wemos sucessfully! Now i have to connect the wemos to the PZEM. When i receive the dupont cable i will return to more support!
I also tryed to setup the app, but in the final check it says it can’t connect, i believe that its the part i have to buy the token.
You don’t need to buy the token for the app to connect to the WeMos. Just keep trying. There is a guide on this site to help with this provisioning stage.
As you don’t have the dupont cables you can still run the app and it will produce simulated data.