ESPEasy P1 wifi gateway GPIO Idx

Moderators: grovkillen, Stuntteam, TD-er

Post Reply
Message
Author
DomoticaRob
Normal user
Posts: 45
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 49732 times
P1_1.png
P1_1.png (25.47 KiB) Viewed 49732 times

Domosapiens
Normal user
Posts: 307
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: 45
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: 3621
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: 307
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 49714 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: 45
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 49701 times
Overige.png
Overige.png (73.23 KiB) Viewed 49701 times
Attachments
Putty.png
Putty.png (17.01 KiB) Viewed 49701 times

Domosapiens
Normal user
Posts: 307
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: 45
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 49665 times
P1_4.png
P1_4.png (87.75 KiB) Viewed 49665 times

Domosapiens
Normal user
Posts: 307
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: 45
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: 45
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 49660 times

Domosapiens
Normal user
Posts: 307
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
New 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: 45
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
New 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: 8643
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
New 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: 1064
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
New 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: 1064
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: 1064
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
New 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: 1064
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: 8643
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 41417 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 41417 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 41417 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 41417 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 41417 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 41417 times

User avatar
ThomasB
Normal user
Posts: 1064
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: 1064
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: 1064
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 41223 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 41223 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 41223 times

User avatar
ThomasB
Normal user
Posts: 1064
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

romix
Normal user
Posts: 16
Joined: 30 Dec 2015, 17:52

Re: ESPEasy P1 wifi gateway GPIO Idx

#33 Post by romix » 16 Aug 2020, 18:17

ThomasB wrote: 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.
————-

The drawing indeed shows the dsmr4.x version.
The current pcb uses all six pins on the RJ-11. It can be powered by the esmr5 meter. A 3300uf 16v elco buffers for the peak currents drawn by the esp8266. For most meters you need three resistors for data as shown in the png on esp8266 thingies, the 2k2 serving as a pull-up on the data lime. The fourth resistor in the pcb is for the statusled on D6, which will not do anything in the mega version of espeasy.

Masterke1971
New user
Posts: 2
Joined: 09 Sep 2020, 11:25

Re: ESPEasy P1 wifi gateway GPIO Idx

#34 Post by Masterke1971 » 09 Sep 2020, 11:28

djksage wrote: 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.
:(
i have the same problem, this it is no domoticz issue, i am searching for the correct mega 1M-bin file for belgium meters to flash my P1 wifi device
any idea?

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

Re: ESPEasy P1 wifi gateway GPIO Idx

#35 Post by TD-er » 09 Sep 2020, 13:51

Have you tried the latest build/code?
The proposed fix has already been merged.

Not entirely sure it is already present in the last build, but you can also test this test build I made for a completely different issue, but it has the latest code in it: https://www.dropbox.com/s/7xl4a8pcbzjd0 ... 0.zip?dl=0

Masterke1971
New user
Posts: 2
Joined: 09 Sep 2020, 11:25

Re: ESPEasy P1 wifi gateway GPIO Idx

#36 Post by Masterke1971 » 09 Sep 2020, 23:17

you have a dead link.

i am using this 1.

Build Time:⋄ Aug 12 2020 23:49:47
Binary Filename:⋄ ESP_Easy_mega_20200812_normal_ESP8285_1M

what version are you referring to?
thx!

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

Re: ESPEasy P1 wifi gateway GPIO Idx

#37 Post by TD-er » 09 Sep 2020, 23:27

It was a build I made today (and updated, which broke the Dropbox link)
Here is the latest build of that pull request: https://www.dropbox.com/s/gdkjkba50dwhs ... 0.zip?dl=0

It is a test build for pull request #3250, which is about Generic HTTP Advanced controller.
So if as long as you don't need that controller (which you don't for testing P1 WiFi gateway), then it is a fine build to test whether your issue already has been fixed.

galadriann
New user
Posts: 3
Joined: 16 Jun 2022, 11:34

Re: ESPEasy P1 wifi gateway GPIO Idx

#38 Post by galadriann » 10 Jul 2022, 18:39

All,
For those who are coming here, the Lua scripts have evolved with a completely different syntax..
Here is what I did to display 2 meters with total produced and consumed:

Code: Select all

local GenerationDeviceName = "P1data"
local ConsumptionDeviceName = "Total Consumption"
local ConsumptionIDX = 8
local ProductionDeviceName = "Total Production"
local ProductionIDX = 3

Debug = "YES" 

local ScriptVersion = '0.2'
function update(device, id, power, energy, index)
	commandArray[index] = {['UpdateDevice'] = id .. "|0|" .. power .. ";" .. energy}
end 

-- split function
function string:split( inSplitPattern, outResults )
  if not outResults then
    outResults = { }
  end
  local theStart = 1
  local theSplitStart, theSplitEnd = string.find( self, inSplitPattern, theStart )
  while theSplitStart do
    table.insert( outResults, string.sub( self, theStart, theSplitStart-1 ) )
    theStart = theSplitEnd + 1
    theSplitStart, theSplitEnd = string.find( self, inSplitPattern, theStart )
  end
  table.insert( outResults, string.sub( self, theStart ) )
  return outResults
end
--local myTable = myString:split(", ")
--for i = 1, #myTable do
   --print( myTable[i] ) -- This will give your needed output
--end

commandArray = {}
	
	-- Generated
	PowerGeneration = otherdevices[GenerationDeviceName]
	local values = PowerGeneration:split(";")
	local TotalConsummed = values[1] + values[2]
	local TotalProduced = values[3] + values[4]
	
	if Debug=="YES" then
		print("  ----- PowerGeneration = " .. PowerGeneration);
		print("  ----- P = " .. TotalConsummed .. " W");
		--print("  ----- EnergyGeneration = " .. EnergyGeneration .. " Wh");
	end
    if devicechanged[GenerationDeviceName] then
		update(ConsumptionDeviceName, ConsumptionIDX, TotalConsummed, 0, 1)
		update(ProductionDeviceName, ProductionIDX, TotalProduced, 0, 1)
	end
	
return commandArray

sincze
Normal user
Posts: 38
Joined: 15 Jul 2016, 12:54

Re: ESPEasy P1 wifi gateway GPIO Idx

#39 Post by sincze » 26 Jul 2023, 16:49

I hope I may ask this question.
I recently updated my EspEasy version since 2018 to "mega-20230623".

As I was awaiting a new 3-fase smartmeter.
To prevent a 1 time big bang implementation I tried to make it work with mega-20230623 and the old DSMR2.2 meter.

I noticed P044 Communication - P1 Wifi Gateway.

After installing my new ESP8266 I enabled this plugin and it worked just fine with Domoticz.(P1 via LAN)
I did not try to TELNET into the plugin it just worked.

However I noticed I made a slight mistake with the chosen ESP as it had range issues.
So I needed to replace it with a different one.
After replacing and reflashing (copying the settings from the range issue esp to this new one) the plugin did not provide data to domoticz.
I tried telnet but I got no data, only connection

I changed the whole setup back to the old range issued esp and ... no data.
No telnet data as well.

I was completely shocked. So I tried the following:
Plugin: Communication - Serial Server

Entered the correct Baudrate and voila .... data appeared in Domoticz with the DSMR2 meter.

So what I don't understand is why it did work before and did not work afterwards.
In advanced settings I checked:
- Serial Log Level: None
- Serial Console Settings: (not checked)

So why would plugin44 not work anymore. I have no clue.

I can only conclude that digitally everything is okay as I have data with 1 plugin but not with the other.
(I don't use these plugins simultaneously of course)

WIth the New meter ZIV DSMR5.0 I know the package size is bigger and faster compared to DSMR2.0 so if that is going to work with the "Communication - Serial Server" would be a mystery to me. I can see data with the Plugin: Communication - Serial Server but Domoticz tells me there is a CRC error.

Would love to know if the P044 Communication - P1 Wifi Gateway would solve this for me. Any suggestions ??

Post Reply

Who is online

Users browsing this forum: No registered users and 20 guests