ESPEasy P1 wifi gateway GPIO Idx

Moderators: grovkillen, TD-er, Stuntteam

Post Reply
Message
Author
DomoticaRob
Normal user
Posts: 38
Joined: 17 Jan 2018, 18:43

ESPEasy P1 wifi gateway GPIO Idx

#1 Post by DomoticaRob » 08 Dec 2018, 23:18

I can't fill in the GPIO port and Idx in Devices.

What do I do wrong?


P1_2.png
P1_2.png (21.17 KiB) Viewed 8836 times
P1_1.png
P1_1.png (25.47 KiB) Viewed 8836 times

Domosapiens
Normal user
Posts: 306
Joined: 06 Nov 2016, 13:45

Re: ESPEasy P1 wifi gateway GPIO Idx

#2 Post by Domosapiens » 09 Dec 2018, 01:37

Suggestion to poster: what version ?

Suggestion to Dev's: Show version in white area of the header.
30+ ESP units for production and test. Ranging from control of heating equipment, flow sensing, floor temp sensing, energy calculation, floor thermostat, water usage, to an interactive "fun box" for my grandson. Mainly Wemos D1.

DomoticaRob
Normal user
Posts: 38
Joined: 17 Jan 2018, 18:43

Re: ESPEasy P1 wifi gateway GPIO Idx

#3 Post by DomoticaRob » 09 Dec 2018, 06:05

I'm sorry, I forgot.

Version:

ESP_Easy_mega-20181112_normal_ESP8285_1024.bin

On a ESP8266 ESP-01.

User avatar
grovkillen
Core team member
Posts: 3584
Joined: 19 Jan 2017, 12:56
Location: Hudiksvall, Sweden
Contact:

Re: ESPEasy P1 wifi gateway GPIO Idx

#4 Post by grovkillen » 09 Dec 2018, 08:01

We're planning on doing a issue/forum poster function that will copy all info and do the screenshots. I hope that will make the opening post better.
ESP Easy Flasher [flash tool and wifi setup at flash time]
ESP Easy Webdumper [easy screendumping of your units]
ESP Easy Netscan [find units]
Official shop: https://firstbyte.shop/
Sponsor ESP Easy, we need you :idea: :idea: :idea:

Domosapiens
Normal user
Posts: 306
Joined: 06 Nov 2016, 13:45

Re: ESPEasy P1 wifi gateway GPIO Idx

#5 Post by Domosapiens » 09 Dec 2018, 10:13

Here v2.0.0-dev12 running
Looks the same as your P1_1.png

P1 connected to Rx
Set Serial log level to 0
No IDX needed for Domoticz (if you use that??)
TCP Port 8088
Create "P1 Smart Meter with LAN interface" in the HW interface of Domoticz
TCP Port 8088

I use this connection diagram
P1 smart meter ser2net.JPG
P1 smart meter ser2net.JPG (196.28 KiB) Viewed 8818 times
OLED is useless for local P1 values.
30+ ESP units for production and test. Ranging from control of heating equipment, flow sensing, floor temp sensing, energy calculation, floor thermostat, water usage, to an interactive "fun box" for my grandson. Mainly Wemos D1.

DomoticaRob
Normal user
Posts: 38
Joined: 17 Jan 2018, 18:43

Re: ESPEasy P1 wifi gateway GPIO Idx

#6 Post by DomoticaRob » 09 Dec 2018, 21:59

Hello Domosapiens,

Thanks for your reply.

I have made what is in your connection diagram. Instead of your Wemos I use a ESP-01 board.
When I measure with my osciloscoop on point (2) and (3) I see every second a burst of ones and zeros. At point (3) it's inverted.

Where do I set the Serial log level to 0?

If I create "P1 Smart Meter with LAN interface" I see it in the Hardware list, but not in the 'Overige' tab.

Can I use Putty to see if the ESP-01 gives characters? If yes, how do I configure Putty?

Image
Hardware.png
Hardware.png (84.95 KiB) Viewed 8805 times
Overige.png
Overige.png (73.23 KiB) Viewed 8805 times
Attachments
Putty.png
Putty.png (17.01 KiB) Viewed 8805 times

Domosapiens
Normal user
Posts: 306
Joined: 06 Nov 2016, 13:45

Re: ESPEasy P1 wifi gateway GPIO Idx

#7 Post by Domosapiens » 09 Dec 2018, 23:19

When I measure with my oscilloscope on point (2) and (3) I see every second a burst of ones and zeros. At point (3) it's inverted.
Good!
Where do I set the Serial log level to 0?
ESP Easy, Tools, Advanced, Serial log level
Check Domoticz tab Devices, filter on P1, you should see 2 devices: Energy and Gas.
If they have a green arrow, click on it, to make it blue.
Then they should appear in the Utility Tab (refresh it!)
Can I use Putty to see if the ESP-01 gives characters? If yes, how do I configure Putty?
Yes, but one connection at the time! If Putty is connected, then no Domoticz and the other way around
Reboot the ESP in-between
Stop/Start the P1 in Domoticz to re-start the connection
30+ ESP units for production and test. Ranging from control of heating equipment, flow sensing, floor temp sensing, energy calculation, floor thermostat, water usage, to an interactive "fun box" for my grandson. Mainly Wemos D1.

DomoticaRob
Normal user
Posts: 38
Joined: 17 Jan 2018, 18:43

Re: ESPEasy P1 wifi gateway GPIO Idx

#8 Post by DomoticaRob » 10 Dec 2018, 21:38

Many thanks, it works, super.

Is there a possibility to see in Domoticz also the other data from the smart meter? For example, the cummulative data. Can I program something with lua or DZVents?


P1_3.png
P1_3.png (18.92 KiB) Viewed 8769 times
P1_4.png
P1_4.png (87.75 KiB) Viewed 8769 times

Domosapiens
Normal user
Posts: 306
Joined: 06 Nov 2016, 13:45

Re: ESPEasy P1 wifi gateway GPIO Idx

#9 Post by Domosapiens » 10 Dec 2018, 22:11

Can I program something with lua or DZVents?

Yes you can ;)
30+ ESP units for production and test. Ranging from control of heating equipment, flow sensing, floor temp sensing, energy calculation, floor thermostat, water usage, to an interactive "fun box" for my grandson. Mainly Wemos D1.

DomoticaRob
Normal user
Posts: 38
Joined: 17 Jan 2018, 18:43

Re: ESPEasy P1 wifi gateway GPIO Idx

#10 Post by DomoticaRob » 10 Dec 2018, 22:27

Hahahahah, yes you are right.

I found something that was made by McMellow:

Code: Select all

--https://www.domoticz.com/forum/viewtopic.php?f=59&t=20382&p=158563&sid=3f9e4bd3012129d745aa0c1900b53461#p158563

--[[  dzVents script to Parse P1 Smart Meter Electricity value into seperated Meter Readings.

]]--  The following need updated for your environment get the 'Idx' or 'Name' of the Device tab.

local fetchIntervalMins = 1                 -- (Integer) (Minutes, Range 5-60) How often SE file is fetched
local P1data = 33                           -- Electra, P1 Smart Meter device
local idxu1 = 42                            -- Meter Usage low, Virtual device, counter incremental
local idxu2 = 43                            -- Meter Usage High, Virtual device, counter incremental
local idxr1 = 44                            -- Meter Return Low, Virtual device, counter incremental
local idxr2 = 45                            -- Meter Return High, Virtual device, counter incremental
local idxcons = 74                          -- Meter Actual Usage, Virtual device, counter incremental
local idxprod = 75                          -- Meter Actual Production, Virtual device, counter incremental

local ScriptVersion = '0.1.6'

return {
    active = true,
	logging = {
	    -- level = domoticz.LOG_DEBUG,    -- Uncomment this line to override the dzVents global logging setting
		marker = 'SME '.. ScriptVersion
	},
	on = {
		devices = { P1data }
	},
	
	execute = function(domoticz, triggerItem)
	    if (triggerItem.isDevice) then
	    
        -- Get values from device P1Data of the Smart Meter
	    local SMdata = domoticz.devices(P1data).rawData
	    
	    -- Update the device and Debug meassages with the accessory values from table SMdata
        domoticz.devices(idxu1).updateCounter(SMdata[1])
        domoticz.log('Gebruik laag  = '.. SMdata[1], domoticz.LOG_DEBUG)
        domoticz.devices(idxu2).updateCounter(SMdata[2])
	    domoticz.log('Gebruik hoog  = '.. SMdata[2], domoticz.LOG_DEBUG)
        domoticz.devices(idxr1).updateCounter(SMdata[3])
	    domoticz.log('Levering laag = '.. SMdata[3], domoticz.LOG_DEBUG)
        domoticz.devices(idxr2).updateCounter(SMdata[4])
        domoticz.log('Levering hoog = '.. SMdata[4], domoticz.LOG_DEBUG)
        domoticz.devices(idxcons).updateCounter(SMdata[5])
	    domoticz.log('Actuele Gebruik = '.. SMdata[5], domoticz.LOG_DEBUG)
	    domoticz.devices(idxprod).updateCounter(SMdata[6])
        domoticz.log('Actuele Levering = '.. SMdata[6], domoticz.LOG_DEBUG)
        end
    end -- execute
}

DomoticaRob
Normal user
Posts: 38
Joined: 17 Jan 2018, 18:43

Re: ESPEasy P1 wifi gateway GPIO Idx

#11 Post by DomoticaRob » 10 Dec 2018, 22:34

P1_5.png
P1_5.png (58.28 KiB) Viewed 8764 times

Domosapiens
Normal user
Posts: 306
Joined: 06 Nov 2016, 13:45

Re: ESPEasy P1 wifi gateway GPIO Idx

#12 Post by Domosapiens » 10 Dec 2018, 23:51

Good find Rob!
30+ ESP units for production and test. Ranging from control of heating equipment, flow sensing, floor temp sensing, energy calculation, floor thermostat, water usage, to an interactive "fun box" for my grandson. Mainly Wemos D1.

gert3d
Normal user
Posts: 8
Joined: 12 Nov 2017, 21:46

Re: ESPEasy P1 wifi gateway GPIO Idx

#13 Post by gert3d » 11 Oct 2019, 22:27

I followed the advices above and got readings using Putty from the P1 port of the smart meter: T210-D ESMR5

ESP-Easy version ESP_Easy_mega-20191003_normal_ESP8266_4M1M.bin on a node-MCU, circuit and parameters as shown by Domosapiens and DomoticaRob, Domoticz (running on a Synology DS212J) : P1 Smart Meter with LAN interface with parameters as shown
Runs perfectly

But have a queston about DZVents script: how to use this?

DomoticaRob
Normal user
Posts: 38
Joined: 17 Jan 2018, 18:43

Re: ESPEasy P1 wifi gateway GPIO Idx

#14 Post by DomoticaRob » 12 Oct 2019, 17:05

What do you mean with 'How to use this'?

What is your purpose?

djksage
Normal user
Posts: 4
Joined: 08 Dec 2019, 16:55

Re: ESPEasy P1 wifi gateway GPIO Idx

#15 Post by djksage » 08 Dec 2019, 17:16

Hello,

i need a small help,

i add on domoticz P1 Smart Meter with LAN interface and on log i have :

2019-12-08 16:58:57.521 Status: P1MeterTCP: attempt connect to 192.168.1.22:8088
2019-12-08 16:58:57.524 Status: P1MeterTCP: connected to: 192.168.1.22:8088

but nothing on tab Devices, i don't have P1XXX when i filter all list

On espeasy i flash it with laast and 2.0.0-dev12, i make all describe on this post

i tried to make ssh connection on espeasy, but no way for conneting

for connection i ordered pcb, schematics is here http://www.esp8266thingies.nl/wp/ (tried V4 and 5V same result)

so how start for debug

thanks fo your help ;)

TD-er
Core team member
Posts: 2636
Joined: 01 Sep 2017, 22:13
Location: the Netherlands
Contact:

Re: ESPEasy P1 wifi gateway GPIO Idx

#16 Post by TD-er » 08 Dec 2019, 19:15

djksage wrote:
08 Dec 2019, 17:16
[...]
i tried to make ssh connection on espeasy, but no way for conneting
[...]
SSH connection to ESPeasy will not work.
There is no ssh service running on the device.
You can connect to it via http (not https) and configure the plugin.
Did you configure the device in Domoticz?

djksage
Normal user
Posts: 4
Joined: 08 Dec 2019, 16:55

Re: ESPEasy P1 wifi gateway GPIO Idx

#17 Post by djksage » 10 Dec 2019, 18:40

Hello,

yes on domoticz :

Image

and on domoticz logs :

Code: Select all

2019-12-10 18:36:15.621 Status: P1MeterTCP: attempt connect to 192.168.1.22:8088
2019-12-10 18:36:15.675 Status: P1MeterTCP: connected to: 192.168.1.22:8088 
on esp :

Image
Image

Les is blinking on pcb and when i try to filter on hardware tab i find nithing :

Image

Thanks for your help

User avatar
ThomasB
Normal user
Posts: 691
Joined: 17 Jun 2018, 20:41
Location: USA

Re: ESPEasy P1 wifi gateway GPIO Idx

#18 Post by ThomasB » 10 Dec 2019, 18:54

Your P1Meter plugin settings are for a DSMR 4.0/4.2 compatible meter. Any chance your meter is a DSMR 2.2 meter instead?

- Thomas

djksage
Normal user
Posts: 4
Joined: 08 Dec 2019, 16:55

Re: ESPEasy P1 wifi gateway GPIO Idx

#19 Post by djksage » 10 Dec 2019, 18:59

ThomasB wrote:
10 Dec 2019, 18:54
Your P1Meter plugin settings are for a DSMR 4.0/4.2 compatible meter. Any chance your meter is a DSMR 2.2 meter instead?

- Thomas
no is a 5.0 sagemcom T211-D

User avatar
ThomasB
Normal user
Posts: 691
Joined: 17 Jun 2018, 20:41
Location: USA

Re: ESPEasy P1 wifi gateway GPIO Idx

#20 Post by ThomasB » 10 Dec 2019, 19:20

no is a 5.0 sagemcom T211-D
Ok, then your P1Meter plugin settings seem reasonable.

I believe that the gateway plugin was written before DSMR 5.x was released. Have you searched to see if anyone has had success using DSMR 5 with the plugin?

Maybe the Web log (set to debug) will show something useful. Beyond that, I've run out of ideas to help out.

- Thomas

User avatar
ThomasB
Normal user
Posts: 691
Joined: 17 Jun 2018, 20:41
Location: USA

Re: ESPEasy P1 wifi gateway GPIO Idx

#21 Post by ThomasB » 10 Dec 2019, 20:01

Have you searched to see if anyone has had success using DSMR 5 with the plugin?
I searched and found a ESPEasy user that had success with DSMR5. See gert3d's post here (the entire thread has good info too):
viewtopic.php?t=6168#p39893

So this user's feedback confirms that the plugin is compatible with DSMR5.

- Thomas

djksage
Normal user
Posts: 4
Joined: 08 Dec 2019, 16:55

Re: ESPEasy P1 wifi gateway GPIO Idx

#22 Post by djksage » 11 Dec 2019, 23:57

Hello,

i know maybee why, i have a belgium meter and on log i see this:

Code: Select all

P1 error: DATA corrupt, discarded input.
:(

User avatar
ThomasB
Normal user
Posts: 691
Joined: 17 Jun 2018, 20:41
Location: USA

Re: ESPEasy P1 wifi gateway GPIO Idx

#23 Post by ThomasB » 12 Dec 2019, 01:05

P1 error: DATA corrupt, discarded input.
The Data Corrupt log error means that a non-ascii character was received.
Do you see any other log messages that relate to the P1 meter? Or do you only see Data Corrupt log messages?
i have a belgium meter ...
FWIW, I found some information that says the Belgium meters need to use a patched version of domoticz. Details are here:
https://github.com/domoticz/domoticz/pull/3603

- Thomas

TD-er
Core team member
Posts: 2636
Joined: 01 Sep 2017, 22:13
Location: the Netherlands
Contact:

Re: ESPEasy P1 wifi gateway GPIO Idx

#24 Post by TD-er » 12 Dec 2019, 09:06

Maybe we can patch this in ESPEasy before sending?

drako
Normal user
Posts: 11
Joined: 24 Apr 2019, 18:22

Re: ESPEasy P1 wifi gateway GPIO Idx

#25 Post by drako » 16 May 2020, 13:01

Hi, I would like to troubleshoot my setup. It seems to work but no data is coming out.
What I have:
Iskra AM550-ED1.01 SRM5.0 (E0043) year 2017
RJ12 - 6 Pins Dupont-Jumper Adapter - P1 Kabel Compatible (colours doesn’t match with any of provided in examples so I used pin output descriptions)
NodeMCU v3 (2x 1K resistors and BC547)

Before soldering anything I tried it out on a breadboard, this is the setup:
Screenshot below.
VIN --------------------- > Pin 1 (5v)
G --------------------- > Pin 6 (should be ground, btw i also tried Pin 3)
BC547 Emitter -------- > G
BC547 Base ------------ > 1K resistor ------- > Pin 5 (should be data out)
BC547 Collector ------ > RX & 1K resistor ( 1K resistor ------ > 3v)
When connected to P1 everything seems to work, NodeMCU is powered by the meter but no data.
Even with Web Log Level ‘Debug’ nothing in log.

My starting point was this site https://infi.nl/nieuws/hobbyproject-sli ... aar-later/ (on this site i found instructions and fritzing diagram) and then a lot of google.

Any advice?

Screenshots of Setup, ESPEasy & Domoticz settings & log files:
Attachments
Screen Shot 2020-05-16 at 12.53.22.png
Screen Shot 2020-05-16 at 12.53.22.png (505.08 KiB) Viewed 521 times
Screen Shot 2020-05-16 at 12.31.04.png
Screen Shot 2020-05-16 at 12.31.04.png (50.92 KiB) Viewed 521 times
Screen Shot 2020-05-16 at 12.30.42.png
Screen Shot 2020-05-16 at 12.30.42.png (42.92 KiB) Viewed 521 times
Screen Shot 2020-05-16 at 12.29.35.png
Screen Shot 2020-05-16 at 12.29.35.png (44.61 KiB) Viewed 521 times
Screen Shot 2020-05-16 at 12.30.18.png
Screen Shot 2020-05-16 at 12.30.18.png (77.26 KiB) Viewed 521 times
Screen Shot 2020-05-16 at 12.30.04.png
Screen Shot 2020-05-16 at 12.30.04.png (19.94 KiB) Viewed 521 times

User avatar
ThomasB
Normal user
Posts: 691
Joined: 17 Jun 2018, 20:41
Location: USA

Re: ESPEasy P1 wifi gateway GPIO Idx

#26 Post by ThomasB » 16 May 2020, 18:51

Before soldering anything I tried it out on a breadboard, this is the setup:
Screenshot below.
VIN --------------------- > Pin 1 (5v)
G --------------------- > Pin 6 (should be ground, btw i also tried Pin 3)
BC547 Emitter -------- > G
BC547 Base ------------ > 1K resistor ------- > Pin 5 (should be data out)
BC547 Collector ------ > RX & 1K resistor ( 1K resistor ------ > 3v)
Did you also connect Pin 2 as shown in the docs? I don't see it in your list.

- Thomas

drako
Normal user
Posts: 11
Joined: 24 Apr 2019, 18:22

Re: ESPEasy P1 wifi gateway GPIO Idx

#27 Post by drako » 17 May 2020, 11:40

Hi Thomas, thank you for your replay.

No I didn't tried that yet. If I read it correctly, Pin 2 should be connected as following:

Pin 2 ---- > 2K2 resistor --- > 5v on one end of resistor,
other end should be connected to Pin 5 before 1K resistor.

I will order 2K2 resistor and probably could test it on tuesday.

User avatar
ThomasB
Normal user
Posts: 691
Joined: 17 Jun 2018, 20:41
Location: USA

Re: ESPEasy P1 wifi gateway GPIO Idx

#28 Post by ThomasB » 17 May 2020, 19:07

No I didn't tried that yet. If I read it correctly, Pin 2 should be connected as following:
Pin 2 ---- > 2K2 resistor --- > 5v on one end of resistor,
other end should be connected to Pin 5 before 1K resistor.
Yes, a 2.2K resistor typically connects Pin 5 (RXD) to 5V.

But Pin 2 (the Ready-to-Send signal) needs 5V, so Pin 2 would connect to Pin 1 (5V). It does not appear you've connected Pin 2.

These details are shown in this discussion.
https://www.letscontrolit.com/forum/vie ... 168#p33682

For reference, here is the meter interface in a ESMRv5.0 P1 Port type meter:
http://domoticx.com/wp-content/uploads/ ... ematic.png

It would be wise if you provided a link to the information source you are using so we can see the circuit drawing you are following.

Edit: You've chosen to power your ESPBoard from the meter's 5V output. Be sure to consult the meter mfg's specifications to ensure it can safely supply the max current needed by your external circuitry.


- Thomas

drako
Normal user
Posts: 11
Joined: 24 Apr 2019, 18:22

Re: ESPEasy P1 wifi gateway GPIO Idx

#29 Post by drako » 17 May 2020, 23:05

Hi Thomas,

Thank you for your feedback, it provides clear picture how should this be connected.

The first source is https://infi.nl/nieuws/hobbyproject-sli ... aar-later/ it is in Dutch
diagram from the source https://infi.nl/files/nieuws/_medium/We ... tch_bb.png

The first source used other site it is also in Dutch but has better diagram http://www.esp8266thingies.nl/wp/
diagram from the second source http://www.esp8266thingies.nl/wp/wp-con ... .43.23.png


Edit: You've chosen to power your ESPBoard from the meter's 5V output. Be sure to consult the meter mfg's specifications to ensure it can safely supply the max current needed by your external circuitry.
-What additional power sources do you advice to use? (just in case)

User avatar
ThomasB
Normal user
Posts: 691
Joined: 17 Jun 2018, 20:41
Location: USA

Re: ESPEasy P1 wifi gateway GPIO Idx

#30 Post by ThomasB » 17 May 2020, 23:41

The fritz board drawing seems odd, only two resistors installed. But the author also shows his final PCB, which has four resistors.
The drawing in the second source is about the same as the one in the discussion link I provided before, so it seems legit. The 5V power is not provided by the meter, an external 5V supply is used.
What additional power sources do you advice to use? (just in case)
The typical EPSEasy project is powered by a good quality 5VDC regulated supply, such as a USB wall wart. Although common ESP82266 boards draw up to about 250mA, the power supply should be rated for at least 1A to avoid brownout problems. I usually add an electrolytic cap directly on the pads for the ESP8266 module's power input (for example, 470uF/10V).

Your utility meter may be able to reliably provide the 5VDC needed to power everything. But I suggest you consult its data sheet to confirm it can handle the current your project needs.

- Thomas

drako
Normal user
Posts: 11
Joined: 24 Apr 2019, 18:22

Re: ESPEasy P1 wifi gateway GPIO Idx

#31 Post by drako » 19 May 2020, 13:07

Hi Thomas,

Thank you for you support. The solution was to connect Pin 2 as described in discussion above. Now I can start soldering, building housing and add some dashboards.

-Drako
Attachments
Screen Shot 2020-05-19 at 13.02.40.png
Screen Shot 2020-05-19 at 13.02.40.png (70.98 KiB) Viewed 327 times
Screen Shot 2020-05-19 at 13.02.28.png
Screen Shot 2020-05-19 at 13.02.28.png (57.25 KiB) Viewed 327 times
Screen Shot 2020-05-19 at 13.02.04.png
Screen Shot 2020-05-19 at 13.02.04.png (150.59 KiB) Viewed 327 times

User avatar
ThomasB
Normal user
Posts: 691
Joined: 17 Jun 2018, 20:41
Location: USA

Re: ESPEasy P1 wifi gateway GPIO Idx

#32 Post by ThomasB » 19 May 2020, 17:43

Great to hear you solved the problem.

- Thomas

Post Reply

Who is online

Users browsing this forum: No registered users and 15 guests