Eastron SDM 630 Energy

Moderators: grovkillen, Stuntteam, TD-er

Message
Author
frank
Normal user
Posts: 116
Joined: 15 Oct 2016, 20:17
Location: Nederland

Eastron SDM 630 Energy

#1 Post by frank » 16 Jul 2023, 14:02

I'm working on connecting an Eastron SDM630 modbus version 2 to an ESPeasy with P078 on it. This doesn't really work for me. The main issue is that there are know readings from the SDM630 Can someone help me?
This is how i set the esp up with hw serial off in the advanced menu:
Schermafbeelding 2023-07-16 134904.png
Schermafbeelding 2023-07-16 134904.png (66.24 KiB) Viewed 55416 times
This is how the connections are
setup.jpg
setup.jpg (1.07 MiB) Viewed 55416 times
This is the setup of the eastron
set adres.jpg
set adres.jpg (104.83 KiB) Viewed 55416 times
set baud.jpg
set baud.jpg (109.31 KiB) Viewed 55416 times
set pari.jpg
set pari.jpg (107.33 KiB) Viewed 55416 times
set stop.jpg
set stop.jpg (105.2 KiB) Viewed 55416 times
Last edited by frank on 16 Jul 2023, 16:08, edited 1 time in total.

User avatar
Ath
Normal user
Posts: 3522
Joined: 10 Jun 2018, 12:06
Location: NL

Re: Eastron SDM 630 Energy

#2 Post by Ath » 16 Jul 2023, 14:32

It might help if during boot you have the plugin disabled, and with a small delay, enable it from rules, like this:

Code: Select all

on System#Boot do
  TimerSet,1,10
endon
on Rules#Timer=1 do
  TaskEnable,Laadpaal
endon
Rationale: During boot the serial port is enabled, and assigned to the serial console. After a few hundred milliseconds, the settings are read, where the Serial console gets turned off, but often the plugin(s) are already being initialized, where this task fails to initialize as the serial console is still using/blocking the serial port. After the boot process decouples the serial port, (re)initializing the task will succeed in claiming the serial port and gets properly initialized :).
/Ton (PayPal.me)

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

Re: Eastron SDM 630 Energy

#3 Post by TD-er » 16 Jul 2023, 15:16

The picture of the baud rate is a bit unclear as the decimal dot (if any) isn't visible at this viewing angle.

So if there isn't a decimal dot, then you actually set it to 96000 baud.
This would be a really strange setting, but maybe you can verify there actually is a decimal dot, or the documentation mentions this situation?

Also the default serial port config would be something like "8N1", meaning No parity and 1 stop bit.

User avatar
Ath
Normal user
Posts: 3522
Joined: 10 Jun 2018, 12:06
Location: NL

Re: Eastron SDM 630 Energy

#4 Post by Ath » 16 Jul 2023, 15:20

Both the RE and DE connections are combined on GPIO 12 (D6), not sure if that's on purpose?
/Ton (PayPal.me)

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

Re: Eastron SDM 630 Energy

#5 Post by TD-er » 16 Jul 2023, 15:26

Ath wrote: 16 Jul 2023, 15:20 Both the RE and DE connections are combined on GPIO 12 (D6), not sure if that's on purpose?
Yep, one is the inverse of the other :)
DE/RE where the / should be read as "overline" :)

frank
Normal user
Posts: 116
Joined: 15 Oct 2016, 20:17
Location: Nederland

Re: Eastron SDM 630 Energy

#6 Post by frank » 16 Jul 2023, 16:00

Ath wrote: 16 Jul 2023, 14:32 It might help if during boot you have the plugin disabled, and with a small delay, enable it from rules, like this:

Code: Select all

on System#Boot do
  TimerSet,1,10
endon
on Rules#Timer=1 do
  TaskEnable,Laadpaal
endon
Rationale: During boot the serial port is enabled, and assigned to the serial console. After a few hundred milliseconds, the settings are read, where the Serial console gets turned off, but often the plugin(s) are already being initialized, where this task fails to initialize as the serial console is still using/blocking the serial port. After the boot process decouples the serial port, (re)initializing the task will succeed in claiming the serial port and gets properly initialized :).
That solved the booting issue. Thx did nothing for the not reading valuau's problem

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

Re: Eastron SDM 630 Energy

#7 Post by TD-er » 16 Jul 2023, 16:01

Have you looked at the "parity" setting?
I think that one might be wrong on your setup.

frank
Normal user
Posts: 116
Joined: 15 Oct 2016, 20:17
Location: Nederland

Re: Eastron SDM 630 Energy

#8 Post by frank » 16 Jul 2023, 16:02

TD-er wrote: 16 Jul 2023, 15:16 The picture of the baud rate is a bit unclear as the decimal dot (if any) isn't visible at this viewing angle.

So if there isn't a decimal dot, then you actually set it to 96000 baud.
This would be a really strange setting, but maybe you can verify there actually is a decimal dot, or the documentation mentions this situation?

Also the default serial port config would be something like "8N1", meaning No parity and 1 stop bit.
there is a decimal point between the 9 and the 6 so this is set to 9600 baud

frank
Normal user
Posts: 116
Joined: 15 Oct 2016, 20:17
Location: Nederland

Re: Eastron SDM 630 Energy

#9 Post by frank » 16 Jul 2023, 16:16

TD-er wrote: 16 Jul 2023, 16:01 Have you looked at the "parity" setting?
I think that one might be wrong on your setup.
i just tried every option (odd, even, none). No result

What should it be?

User avatar
Ath
Normal user
Posts: 3522
Joined: 10 Jun 2018, 12:06
Location: NL

Re: Eastron SDM 630 Energy

#10 Post by Ath » 16 Jul 2023, 16:20

And swapping the RX and TX wires, does that help?
/Ton (PayPal.me)

frank
Normal user
Posts: 116
Joined: 15 Oct 2016, 20:17
Location: Nederland

Re: Eastron SDM 630 Energy

#11 Post by frank » 16 Jul 2023, 16:31

Ath wrote: 16 Jul 2023, 16:20 And swapping the RX and TX wires, does that help?
just tried know difference

User avatar
Ath
Normal user
Posts: 3522
Joined: 10 Jun 2018, 12:06
Location: NL

Re: Eastron SDM 630 Energy

#12 Post by Ath » 16 Jul 2023, 20:11

What release of ESPEasy is being installed on your ESP (the name is at the right-bottom of nearly every page of the Web-UI)?
/Ton (PayPal.me)

frank
Normal user
Posts: 116
Joined: 15 Oct 2016, 20:17
Location: Nederland

Re: Eastron SDM 630 Energy

#13 Post by frank » 16 Jul 2023, 20:43

Ath wrote: 16 Jul 2023, 20:11 What release of ESPEasy is being installed on your ESP (the name is at the right-bottom of nearly every page of the Web-UI)?
The latest release: Git Build: mega-20230623

Build: ESP_Easy_mega_20230623_energy_ESP8266_4M1M Jun 23 2023

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

Re: Eastron SDM 630 Energy

#14 Post by TD-er » 16 Jul 2023, 22:00

frank wrote: 16 Jul 2023, 16:16
TD-er wrote: 16 Jul 2023, 16:01 Have you looked at the "parity" setting?
I think that one might be wrong on your setup.
i just tried every option (odd, even, none). No result

What should it be?
It should be "None"

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

Re: Eastron SDM 630 Energy

#15 Post by TD-er » 16 Jul 2023, 22:02

Is "Enable Serial Port Console" unchecked on the Tools->Advanced page?

frank
Normal user
Posts: 116
Joined: 15 Oct 2016, 20:17
Location: Nederland

Re: Eastron SDM 630 Energy

#16 Post by frank » 17 Jul 2023, 06:22

TD-er wrote: 16 Jul 2023, 22:02 Is "Enable Serial Port Console" unchecked on the Tools->Advanced page?
yes it is

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

Re: Eastron SDM 630 Energy

#17 Post by TD-er » 17 Jul 2023, 11:53

It looks like you're powering the MAX485 via 3V3.
Not all MAX485 chips work well at 3V3.

However you have the chip connected to the pins for Serial0.
These pins are also connected to the USB to serial chip on board.
I don't know if the MAX485 will output higher voltages on its TX pin when powered via 5V and if it does, whether you may damage the USB to serial chip.

Another thing you can try is to not let ESPEasy manage the DE/RE signal, but connect those pins all to the TX signal from the ESP.
Thus TX ESP to:
DI, DE, /RE

frank
Normal user
Posts: 116
Joined: 15 Oct 2016, 20:17
Location: Nederland

Re: Eastron SDM 630 Energy

#18 Post by frank » 17 Jul 2023, 17:41

TD-er wrote: 17 Jul 2023, 11:53 It looks like you're powering the MAX485 via 3V3.
Not all MAX485 chips work well at 3V3.

However you have the chip connected to the pins for Serial0.
These pins are also connected to the USB to serial chip on board.
I don't know if the MAX485 will output higher voltages on its TX pin when powered via 5V and if it does, whether you may damage the USB to serial chip.

Another thing you can try is to not let ESPEasy manage the DE/RE signal, but connect those pins all to the TX signal from the ESP.
Thus TX ESP to:
DI, DE, /RE
Done both. Know change

frank
Normal user
Posts: 116
Joined: 15 Oct 2016, 20:17
Location: Nederland

Re: Eastron SDM 630 Energy

#19 Post by frank » 17 Jul 2023, 17:51

the only thing that strikes me is that I see the following in the device settings list:

Checksum (pass/fail): 0/768

User avatar
Ath
Normal user
Posts: 3522
Joined: 10 Jun 2018, 12:06
Location: NL

Re: Eastron SDM 630 Energy

#20 Post by Ath » 17 Jul 2023, 20:31

frank wrote: 17 Jul 2023, 17:51 the only thing that strikes me is that I see the following in the device settings list:

Checksum (pass/fail): 0/768
That just is an indication of the number of receive failures, versus the successes (0), so it seems there is some data received, but it doesn't seem decodeable by the plugin. It's possible that the SDM630 doesn't send a checksum, causing these errors.

Can you connect the RS485 board to a serial to USB adapter, and use some terminal software like Putty to see what's really being output by the SDM630?
The plugin also emits some logging when reading data, you can see what's going on via the Tools/Log page, you will see the data prefixed with EASTRON, so that should be easy to find.
/Ton (PayPal.me)

frank
Normal user
Posts: 116
Joined: 15 Oct 2016, 20:17
Location: Nederland

Re: Eastron SDM 630 Energy

#21 Post by frank » 17 Jul 2023, 21:57

I have to look if i have such convertor. I will try tommorrow
thx for now

frank
Normal user
Posts: 116
Joined: 15 Oct 2016, 20:17
Location: Nederland

Re: Eastron SDM 630 Energy

#22 Post by frank » 17 Jul 2023, 22:16

could my problem be that my eastron SDM630 is a modbus V2?

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

Re: Eastron SDM 630 Energy

#23 Post by TD-er » 17 Jul 2023, 22:53

Isn't that "V2" just a revision of the meter itself and not the Modbus protocol?

And just to be sure, you do have a Modbus unit and not a version with M-Bus?

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

Re: Eastron SDM 630 Energy

#24 Post by TD-er » 17 Jul 2023, 22:56

There is a pending PR to extend the Eastron plugin to support all register types of all their meters.
I just updated the PR for it so it will generate a new test build.

In about 30 - 40 minutes a test build will be ready here: https://github.com/letscontrolit/ESPEas ... 5580511157

frank
Normal user
Posts: 116
Joined: 15 Oct 2016, 20:17
Location: Nederland

Re: Eastron SDM 630 Energy

#25 Post by frank » 17 Jul 2023, 23:05

TD-er wrote: 17 Jul 2023, 22:53 Isn't that "V2" just a revision of the meter itself and not the Modbus protocol?

And just to be sure, you do have a Modbus unit and not a version with M-Bus?
In the meter stands modbus and not mbus so i think i have A modbus version. You can see that on the pictures.

frank
Normal user
Posts: 116
Joined: 15 Oct 2016, 20:17
Location: Nederland

Re: Eastron SDM 630 Energy

#26 Post by frank » 17 Jul 2023, 23:05

TD-er wrote: 17 Jul 2023, 22:53 Isn't that "V2" just a revision of the meter itself and not the Modbus protocol?

And just to be sure, you do have a Modbus unit and not a version with M-Bus?
In the meter stands modbus and not mbus so i think i have A modbus version. You can see that on the pictures.

frank
Normal user
Posts: 116
Joined: 15 Oct 2016, 20:17
Location: Nederland

Re: Eastron SDM 630 Energy

#27 Post by frank » 18 Jul 2023, 17:21

TD-er wrote: 17 Jul 2023, 22:56 There is a pending PR to extend the Eastron plugin to support all register types of all their meters.
I just updated the PR for it so it will generate a new test build.

In about 30 - 40 minutes a test build will be ready here: https://github.com/letscontrolit/ESPEas ... 5580511157
I think the run didn't work well is see only bin's for the esp32 not for the esp8266

User avatar
Ath
Normal user
Posts: 3522
Joined: 10 Jun 2018, 12:06
Location: NL

Re: Eastron SDM 630 Energy

#28 Post by Ath » 18 Jul 2023, 21:29

The build did fail, because of the bigger size of the added code.
I've created a local build with the LIMIT_BUILD_SIZE compile-time option enabled, so it will fit.
Here's the updated ESP8266 Energy build:
ESP_Easy_mega_20230718_energy_ESP8266_4M1M.zip
(1.17 MiB) Downloaded 260 times
/Ton (PayPal.me)

frank
Normal user
Posts: 116
Joined: 15 Oct 2016, 20:17
Location: Nederland

Re: Eastron SDM 630 Energy

#29 Post by frank » 19 Jul 2023, 18:46

I loaded the new bin. The esp is now rebooting every 2 minit. The reason is Exception (97) en the load is continues at 100%

PLUGIN_READ: timer, id: 0

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

Re: Eastron SDM 630 Energy

#30 Post by TD-er » 19 Jul 2023, 21:04

OK, I have to search for my Eastron modules... No idea in which box it will be...

PieterS
Normal user
Posts: 87
Joined: 27 Mar 2018, 17:18
Location: NL

Re: Eastron SDM 630 Energy

#31 Post by PieterS » 28 Jul 2023, 16:28

Ath wrote: 18 Jul 2023, 21:29 The build did fail, because of the bigger size of the added code.
I've created a local build with the LIMIT_BUILD_SIZE compile-time option enabled, so it will fit.
Here's the updated ESP8266 Energy build:
ESP_Easy_mega_20230718_energy_ESP8266_4M1M.zip
I flashed a ESP8266 NodeMCU with this code. It sends a SSID with the Energy but I have no idea about the password :roll:

And where can I find more info about this plugin?

Thnx

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

Re: Eastron SDM 630 Energy

#32 Post by TD-er » 28 Jul 2023, 16:37

Default password for the WiFi access point of the ESP is:
"configesp"

PieterS
Normal user
Posts: 87
Joined: 27 Mar 2018, 17:18
Location: NL

Re: Eastron SDM 630 Energy

#33 Post by PieterS » 28 Jul 2023, 17:18

@Gijs: Thanks.

Even when I select as Model Type the Eastron SDM630, the output is for a single fase meter.

Is there a change to get more detailed info for every fase? I want to send the data to Domoticz.

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

Re: Eastron SDM 630 Energy

#34 Post by TD-er » 28 Jul 2023, 19:45

There is a pending pull request to add all registers for all Eastron modules.
I merged in the latest changes and triggered a new build, which sould be ready in about an hour: https://github.com/letscontrolit/ESPEas ... 5694781174

N.B. you need a GitHub account to download those GitHub Actions builds.

User avatar
Ath
Normal user
Posts: 3522
Joined: 10 Jun 2018, 12:06
Location: NL

Re: Eastron SDM 630 Energy

#35 Post by Ath » 28 Jul 2023, 19:58

The current release version of the plugin in ESPEasy doesn't yet support all available data, but there is an open pull request on Github that aims to add those. The last build of that PR unfortunately failed, and that was because of a .bin size issue with the Energy build... guess that new build will also fail on that :shock:

I've created a local build of the ESP8266 Energy configuration, that I squeezed a bit by activating the LIMIT_BUILD_SIZE option, that limits a few features and removes debug-logging from ESPEasy, to make it fit in available .bin size:
ESP_Easy_mega_20230728_energy_ESP8266_4M1M.zip
(1.17 MiB) Downloaded 259 times
Update via the Tools/Firmware Update button, and choose either the .bin or the .bin.gz file (that's a bit smaller to upload).
/Ton (PayPal.me)

PieterS
Normal user
Posts: 87
Joined: 27 Mar 2018, 17:18
Location: NL

Re: Eastron SDM 630 Energy

#36 Post by PieterS » 28 Jul 2023, 21:41

TD-er wrote: 28 Jul 2023, 19:45 There is a pending pull request to add all registers for all Eastron modules.
I merged in the latest changes and triggered a new build, which sould be ready in about an hour: https://github.com/letscontrolit/ESPEas ... 5694781174

N.B. you need a GitHub account to download those GitHub Actions builds.
Thnx Gijs. I have a GitHub account and will give it a try tomorrow.

PieterS
Normal user
Posts: 87
Joined: 27 Mar 2018, 17:18
Location: NL

Re: Eastron SDM 630 Energy

#37 Post by PieterS » 28 Jul 2023, 21:48

Ath wrote: 28 Jul 2023, 19:58 The current release version of the plugin in ESPEasy doesn't yet support all available data, but there is an open pull request on Github that aims to add those. The last build of that PR unfortunately failed, and that was because of a .bin size issue with the Energy build... guess that new build will also fail on that :shock:

I've created a local build of the ESP8266 Energy configuration, that I squeezed a bit by activating the LIMIT_BUILD_SIZE option, that limits a few features and removes debug-logging from ESPEasy, to make it fit in available .bin size:
ESP_Easy_mega_20230728_energy_ESP8266_4M1M.zip

Update via the Tools/Firmware Update button, and choose either the .bin or the .bin.gz file (that's a bit smaller to upload).
Update successfull. Now I can choose lots of values. But next question: how do I send more than 4 values to Domoticz?

User avatar
Ath
Normal user
Posts: 3522
Joined: 10 Jun 2018, 12:06
Location: NL

Re: Eastron SDM 630 Energy

#38 Post by Ath » 28 Jul 2023, 21:57

PieterS wrote: 28 Jul 2023, 21:48 But next question: how do I send more than 4 values to Domoticz?
ESPEasy only supports max. 4 values when sending from a task, but from rules you can send as many values as you want, you 'just' have to craft the json for Domoticz manually.
Alternative would be to configure multiple tasks with the SDM630 and send different values to different IDX devices of Domoticz. There's no way of sending 'the next 4 values' to Domoticz (not supported both by Domoticz and ESPEasy, as in technically impossible).
/Ton (PayPal.me)

PieterS
Normal user
Posts: 87
Joined: 27 Mar 2018, 17:18
Location: NL

Re: Eastron SDM 630 Energy

#39 Post by PieterS » 29 Jul 2023, 15:39

Ath wrote: 28 Jul 2023, 19:58 The current release version of the plugin in ESPEasy doesn't yet support all available data, but there is an open pull request on Github that aims to add those. The last build of that PR unfortunately failed, and that was because of a .bin size issue with the Energy build... guess that new build will also fail on that :shock:

I've created a local build of the ESP8266 Energy configuration, that I squeezed a bit by activating the LIMIT_BUILD_SIZE option, that limits a few features and removes debug-logging from ESPEasy, to make it fit in available .bin size:
ESP_Easy_mega_20230728_energy_ESP8266_4M1M.zip

Update via the Tools/Firmware Update button, and choose either the .bin or the .bin.gz file (that's a bit smaller to upload).
I have the Modbus-version
Flashed the 8266 with the above version
made a rule for delay at boot
"Enable Serial Port Console" unchecked on the Tools->Advanced page
Connected the MAX485TTL to RS485 converter Module like @frank did in the start of this thread. Only difference is I powerd the module to Vin , not 3V3..

but did no success with reading the SDM630. Even swapped the wires between de module and the meter.. :?

Image

Image

Image

Image

I can read the meter on a Raspberry Pi 4 connected by a RS485 to USB with settings on 9600 baud and a Python-script to send it to Domoticz. At that method I get the output I need but not very satisfied with that line-up.. I hope to go to MQTT. And a wireless solution.

This is part of the log in Domoticz from the Pythonscript:

Image

Any idea why there is no input from the meter?

Thanks.

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

Re: Eastron SDM 630 Energy

#40 Post by TD-er » 29 Jul 2023, 16:35

How are the DE/RE pins wired?
Connected to the TX pin from the ESP?
How are RX and TX wired to the MAX485 module? Are you sure they aren't swapped?

How long is the cable from the MAX485 module to the Eastron?

Does the Eastron have a modbus address set?

Is serial config on the Eastron correct? (8N1 as in 8 bits, no parity, 1 stop bit)

You could also connect to the USB serial port of that module and connect to it using some terminal program like Putty as you should see what ESPEasy is sending. (set baud rate in that program to same baud rate as the Eastron module)

Just as a test, you could set the MAX485 module to other pins and use SW serial.
N.B. another user reported he now has lots of errors when using SW serial, but at least you should see some data being received in the task. Either the pass counter or the fail counter should increase.

PieterS
Normal user
Posts: 87
Joined: 27 Mar 2018, 17:18
Location: NL

Re: Eastron SDM 630 Energy

#41 Post by PieterS » 29 Jul 2023, 18:05

TD-er wrote: 29 Jul 2023, 16:35 How are the DE/RE pins wired?
Connected to the TX pin from the ESP?
How are RX and TX wired to the MAX485 module? Are you sure they aren't swapped?

How long is the cable from the MAX485 module to the Eastron?

Does the Eastron have a modbus address set?

Is serial config on the Eastron correct? (8N1 as in 8 bits, no parity, 1 stop bit)

You could also connect to the USB serial port of that module and connect to it using some terminal program like Putty as you should see what ESPEasy is sending. (set baud rate in that program to same baud rate as the Eastron module)

Just as a test, you could set the MAX485 module to other pins and use SW serial.
N.B. another user reported he now has lots of errors when using SW serial, but at least you should see some data being received in the task. Either the pass counter or the fail counter should increase.
Thnx Gijs for quick answers. I not a real technician so some words are not very familiar. Sorry if I misunderstand you. I will do my best.

How are the DE/RE pins wired?
Connected to the TX pin from the ESP?


I solderd RE and DE together.. And connected 1 wire to D6 on the ESP. Because Frank connected two wires to D6. No idea if that is meant as TX of the ESP..
EDIT at 19:35: Now I connect DI of the MAX485 module to pin TX (GPIO1) on the NedMCU and give it a new try. My source says: https://microcontrollerslab.com/rs485-s ... -tutorial/ Pin DI This is the driver input. It is connected with the TX pin of the microcontroller.
Edit at 19:49: No success either. :cry:

How are RX and TX wired to the MAX485 module? Are you sure they aren't swapped?

I disconnected the 2 wires between Eastron and RS485 2 USB. That system works OK. I checked before: D+=red cable D-=yellow cable. I connected the red cable (D+) to terminal block A, the yellow cable (D-) to terminal block B.
That works oke for RS485 to USB... But I changed the wires as a test earlier today. No luck.

How long is the cable from the MAX485 module to the Eastron? About 50 cm.
This is the situation with the RS485 to USB and Py. I disconnect the cable from RS485 and replace it to the MAX485 module.

Image

Does the Eastron have a modbus address set?
I guess so. But I am not sure about it. This are the settings in Domoticz.. That does the job.

Image

No idea about Stopbits and Parity. This meter is new and I did not change any settings in it.

You could also connect to the USB serial port of that module and connect to it using some terminal program like Putty as you should see what ESPEasy is sending. (set baud rate in that program to same baud rate as the Eastron module)

I do not understand what you mean..
1. What pins are the USB serial port on the NodeMCU?
2. I have to connect them to a Raspberry Pi?
I found a diagram in this link: https://www.industrialshields.com/blog/ ... module-137
Is that correct?
3. What command do I give in Putty?

Thanks for your effort to help me.

Pieter

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

Re: Eastron SDM 630 Energy

#42 Post by TD-er » 29 Jul 2023, 20:27

OK, that's a lot of uncertainties...

I advice you'll bookmark this table: https://espeasy.readthedocs.io/en/lates ... on-esp8266
As it is a good guide on what pin can be used for what and which one has pull-up or -down resistors present etc.

Also it helps in translating this incredibly impractical D-notation into GPIO numbers.
I know some boards use this D-notation, but not all do.
So it only adds to the confusion.

Let's assume you have HW serial0 setup in the task in ESPEasy.

So GPIO-1 (TX) should then be connected to DI, DE/RE
GPIO-3 (RX) should be connected to RO of the MAX485 board.

If you have DE/RE not connected to the TX pin, but to another GPIO pin (e.g. GPIO-12 or D6 as you mentioned), you also need to set this in the task config for the DE/RE pin.

Since HW Serial0 is connected to the onboard USB to serial chip, you should be able to see the data sent by the ESP.
That's why I suggested to use some tool like Putty for this.
But if you never used such a tool, then forget it as it will only add to the confusion.

In your Domoticz screenshot the DeviceID is set to 1, so that should also be set in ESPEasy.
I don't know what the default settings are on the Eastron device, so you should look in the menu of the Eastron to make sure what serial port settings are set.
Also assuming defaults is also a bit tricky when debugging, so maybe a good idea to check this anyway.
No idea if Domoticz also might have changed some settings...

PieterS
Normal user
Posts: 87
Joined: 27 Mar 2018, 17:18
Location: NL

Re: Eastron SDM 630 Energy

#43 Post by PieterS » 30 Jul 2023, 13:03

TD-er wrote: 29 Jul 2023, 20:27 OK, that's a lot of uncertainties...

I advice you'll bookmark this table: https://espeasy.readthedocs.io/en/lates ... on-esp8266
As it is a good guide on what pin can be used for what and which one has pull-up or -down resistors present etc.

Also it helps in translating this incredibly impractical D-notation into GPIO numbers.
I know some boards use this D-notation, but not all do.
So it only adds to the confusion.

Let's assume you have HW serial0 setup in the task in ESPEasy.

So GPIO-1 (TX) should then be connected to DI, DE/RE
GPIO-3 (RX) should be connected to RO of the MAX485 board.

If you have DE/RE not connected to the TX pin, but to another GPIO pin (e.g. GPIO-12 or D6 as you mentioned), you also need to set this in the task config for the DE/RE pin.

Since HW Serial0 is connected to the onboard USB to serial chip, you should be able to see the data sent by the ESP.
That's why I suggested to use some tool like Putty for this.
But if you never used such a tool, then forget it as it will only add to the confusion.

In your Domoticz screenshot the DeviceID is set to 1, so that should also be set in ESPEasy.
I don't know what the default settings are on the Eastron device, so you should look in the menu of the Eastron to make sure what serial port settings are set.
Also assuming defaults is also a bit tricky when debugging, so maybe a good idea to check this anyway.
No idea if Domoticz also might have changed some settings...
I know some boards use this D-notation, but not all do.
My board (Lolin NodeMcu V3) has a mixture.. :x

Your suggestion for wiring looks different as the above from frank.
But I will give it a try.

Let's assume you have HW serial0 setup in the task in ESPEasy.
In my Task Settings is selected: HW Serial0: GPIO-3 (D9) <- TX/ GPIO 1 (D10) -> RX

So GPIO-1 (TX) should then be connected to DI, DE/RE
GPIO-3 (RX) should be connected to RO of the MAX485 board.


Sorry, I am not sure..
But I connect those 3 pins together on the RS485 module to one pin, TX-pin, on the NodeMCU??
and
I connect RO on the RS485 module to the RX-pin on the NodeMCU?

And of course 5V and GND.

We park the rest for later. ;)

Thnx for your correction/confirmation.

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

Re: Eastron SDM 630 Energy

#44 Post by TD-er » 30 Jul 2023, 16:33

Yep, the DE and /RE (/ meaning it is electrically inverted) pins change communication direction on the RS485.
So you can join both DE and /RE and pull it down for listening and pull it up for sending.
If you assign a separate GPIO pin for toggling this, you have to set it in the task settings of course.

However, since the TX line of the ESP is "low" while not sending, you can just join the TX signal together with the data in and the DE/RE pins and achieve the same result.

N.B. there are use cases where this trick will not work, but for your setup I don't see why it shouldn't work.

PieterS
Normal user
Posts: 87
Joined: 27 Mar 2018, 17:18
Location: NL

Re: Eastron SDM 630 Energy

#45 Post by PieterS » 31 Jul 2023, 13:56

Sorry for delay. Thnx for information.

Is serial config on the Eastron correct? (8N1 as in 8 bits, no parity, 1 stop bit)
I checked the settings in te SDM630:
Image
Image
Image
Image

Did not find BIT-length in the Eastron....
This are Task Settings:

Image

So you can join both DE and /RE and pull it down for listening and pull it up for sending.

I joined DE and RE on the RS485 and connected them to the TX-pin of the NodeMCU.
I connect RO to the RX-pin

Image

I tested this config, but no luck..

What about the DI on the RS485? Should it be connected? And to what pin on the NodeMCU?

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

Re: Eastron SDM 630 Energy

#46 Post by TD-er » 31 Jul 2023, 14:01

DI should be connected to the TX and you could then the DE/RE connect to GPIO-12 if you like.


So 2 options:
1) What you have right now, but also connect DE/RE to the DI pin (add some jumper to the pins on the other side of that board)
2) Disconnect the yellow wire from the TX and connect it to GPIO-12 (D6) and connect the TX to DI

I think the first option is the simplest to test right now.
Just short the 3 pins DI, DE, /RE

PieterS
Normal user
Posts: 87
Joined: 27 Mar 2018, 17:18
Location: NL

Re: Eastron SDM 630 Energy

#47 Post by PieterS » 31 Jul 2023, 14:40

Thnx Gijs,

I tried both options..
First the easy way with a jumper DI+DE/RE. No luck.

So the second option:
I removed the jumper
Yellow wire (DE+RE) to GPIO-12 (D6) and DI to TX.

Image

No luck..

Image

What else are my possibilities?

PieterS
Normal user
Posts: 87
Joined: 27 Mar 2018, 17:18
Location: NL

Re: Eastron SDM 630 Energy

#48 Post by PieterS » 31 Jul 2023, 14:50

What about Putty? I am familiar with SSH on a Raspberry..

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

Re: Eastron SDM 630 Energy

#49 Post by TD-er » 31 Jul 2023, 14:51

I assume you did connect the A/B line too and only had it disconnected for the picture?

What 'fail/success' values did you see on the web page?
On the previous page you at least showed there were some messages received, even though they were wrong.

I assume you have the serial log and serial console disabled on the tools->Advanced page.

I know there are some MAX485 chips out there that don't work well when powered by 3.3V (or not at all)
So you might want to power it via 5V, however since the USB to serial chip on the ESP board is also connected to the RX/TX pins of the ESP, I don't know what will happen to that chip when you power the MAX485 with 5V.

So maybe -just as a test- it is better to connect the DI and RO pins not to the RX/TX pins on the board, but rather use GPIO 5 (D1) and GPIO-4 (D2) and configure these as software serial port.
N.B. these pins are default configured for I2C, so make sure to remove them from the I2C config on the Hardware page.

I picked GPIO-5 and -4 as those are the ones not having any strange issues.
You can also pick GPIO-13 (D7), GPIO-14 (D5) and you already have GPIO-12 (D6) connected.

PieterS
Normal user
Posts: 87
Joined: 27 Mar 2018, 17:18
Location: NL

Re: Eastron SDM 630 Energy

#50 Post by PieterS » 31 Jul 2023, 16:05

I assume you did connect the A/B line too and only had it disconnected for the picture?
Yes, I did.. I also connected power to the nodeMCU.

On the previous page you at least showed there were some messages received, even though they were wrong.
I think you mean the lines which start with EASTRON: (1,4)

What 'fail/success' values did you see on the web page?

Image

I assume you have the serial log and serial console disabled on the tools->Advanced page.
Yes I did disabled that setting
Image

I know there are some MAX485 chips out there that don't work well when powered by 3.3V (or not at all)
In the tests of last Friday I had a NodeMCU with 5V on Vin. But that one is blown.. Now I use a Lolin. That has no 5V on Vin.. So I have no choice at the moment.. I orderd 2 new Amica's. Maybe I receive them tomorrow.

To be sure, I use a different (brandnew) MAX485 TTL to RS485 module (I have 2 of them) for the tests today.
The red light on the old one still works. But I am not sure.

So maybe -just as a test- it is better to connect the DI and RO pins not to the RX/TX pins on the board, but rather use GPIO 5 (D1) and GPIO-4 (D2) and configure these as software serial port.
I will give it a try.
But can you explain: configure these as software serial port


Thanks again.

Post Reply

Who is online

Users browsing this forum: No registered users and 32 guests