reaper7 / SDM_Energy_Meter

reading SDM72 SDM120 SDM220 SDM230 SDM630 modbus energy meters from arduino (esp8266, esp32, avr)
240 stars 97 forks source link

Multiple SDM with a single ESP32 #56

Closed maxdd closed 3 years ago

maxdd commented 3 years ago

Hello, I admit i have low knowledge on how the library works but i know about master/slave Modbus concept. I was wondering whether a "multiple sdm environment" can work on a single esp32. The idea is to monitor multiple AC line and i was wondering whether it will be sufficient to connect a single RS485-TTL board as such

and if it will be sufficient to have different slave addresses

Regards,

reaper7 commented 3 years ago

yes, one esp + one converter is enough and of course different slave address on each meter

maxdd commented 3 years ago

where do you normally source this devices? from aliexpress it takes quite a lot. I briefly looked through the code but haven't seen any api to set the slave address or anything else. I guess the library needs to be extended according to

image

and all the 4XXXXX registers, right? What do you normally use?

reaper7 commented 3 years ago

I bought one device a long time ago, I don't have the others.

I set the slave address and transmission parameters on the meter, the SDM220 has this functionality.

This lib allow only read from 3X input registers.

maxdd commented 3 years ago

Ok, i might as well extend this library when i decide to dive in my project

reaper7 commented 3 years ago

on github you will find libraries that fully support the modbus protocol