# Read the SDM220 modbus with the minimalmodbus python module

**URL:** <https://community.openenergymonitor.org/t/read-the-sdm220-modbus-with-the-minimalmodbus-python-module/4819>\
**Category:** Hardware\
**Tags:** modbus\
**Created:** [15 August 2017 09:20 UTC](https://community.openenergymonitor.org/t/read-the-sdm220-modbus-with-the-minimalmodbus-python-module/4819 "2017-08-15T09:20:36Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![Joaquin\_Lopez](https://community.openenergymonitor.org/user_avatar/community.openenergymonitor.org/joaquin_lopez/32/2012_2.png) [@Joaquin\_Lopez](https://community.openenergymonitor.org/u/Joaquin_Lopez)\
**Post date:** [15 August 2017 09:20 UTC](https://community.openenergymonitor.org/t/read-the-sdm220-modbus-with-the-minimalmodbus-python-module/4819/1 "2017-08-15T09:20:36Z")

</div>

Hello Bill,

I have a new fresh installation of an emonCMS in my own raspberry pi.  
I have an USB-RS485 converter and a Eastron SDM220 modbus energy monitor.

My intention is to capture the data and integrate it into the emonCMS.

I’ve read several posts where you pointed to the solution using the minimalmodbus python module and a script you’ve made.  
Please, could you explain the steps to implement this solution into the emoncms?

Regards,  
Joaquin.

---

<div class="post-metadata">

**Author:** ![Bill.Thomson](https://community.openenergymonitor.org/user_avatar/community.openenergymonitor.org/bill.thomson/32/1834_2.png) [@Bill.Thomson](https://community.openenergymonitor.org/u/Bill.Thomson)\
**Post date:** [15 August 2017 14:13 UTC](https://community.openenergymonitor.org/t/read-the-sdm220-modbus-with-the-minimalmodbus-python-module/4819/2 "2017-08-15T14:13:16Z")

</div>

Hi Joaquin,

I use [this](http://www.ebay.com/itm/For-XP-RS485-Vista-Support-OS-B3-USB-Raspberry-Converter-Adapter-To-RS485-/252987628320?epid=24002975678&hash=item3ae73cdb20:g:7IUAAOSwceNZPrG~) RS-485 to USB adapter to feed data from an Elkor WattsOn power transducer to a Raspberry Pi.

I’m not a programmer, so I used what I knew how to work with, to get data from the RPi to emonCMS.

A Python script that uses the minimalmodbus module reads the RS-485 data from the RPi USB port and writes it to a text file mounted on a tmpfs partition. (a ramdisk, so-to-speak)

A bash script reads the text file and uses `curl` to send the data to emonCMS.

I’ll send you the files later today (I’m at work ATM). Hopefully, they’ll give you a place to start.

Regards,

Bill

---

<div class="post-metadata">

**Author:** ![Joaquin\_Lopez](https://community.openenergymonitor.org/user_avatar/community.openenergymonitor.org/joaquin_lopez/32/2012_2.png) [@Joaquin\_Lopez](https://community.openenergymonitor.org/u/Joaquin_Lopez)\
**Post date:** [15 August 2017 16:36 UTC](https://community.openenergymonitor.org/t/read-the-sdm220-modbus-with-the-minimalmodbus-python-module/4819/3 "2017-08-15T16:36:36Z")

</div>

Thanks Bill!

> **···**
>
> On mar., 15 ago. 2017 16:14 Bill Thomson \< noreply@community.openenergymonitor.org\> wrote:
> 
> > Bill.Thomson [https://community.openenergymonitor.org/u/bill.thomson](https://community.openenergymonitor.org/u/bill.thomson) Bill  
> > Thomson [https://community.openenergymonitor.org/u/bill.thomson](https://community.openenergymonitor.org/u/bill.thomson)  
> > August 15
> > 
> > Hi Joaquin,
> > 
> > I use this  
> > [http://www.ebay.com/itm/For-XP-RS485-Vista-Support-OS-B3-USB-Raspberry-Converter-Adapter-To-RS485-/252987628320?epid=24002975678&hash=item3ae73cdb20:g:7IUAAOSwceNZPrG~](http://www.ebay.com/itm/For-XP-RS485-Vista-Support-OS-B3-USB-Raspberry-Converter-Adapter-To-RS485-/252987628320?epid=24002975678&hash=item3ae73cdb20:g:7IUAAOSwceNZPrG~)  
> > RS-485 to USB adapter to feed data from an Elkor WattsOn power transducer  
> > to a Raspberry Pi.
> > 
> > I’m not a programmer, so I used what I knew how to work with, to get data  
> > from the RPi to emonCMS.
> > 
> > A Python script that uses the minimalmodbus module reads the RS-485 data  
> > from the RPi USB port and writes it to a text file mounted on a tmpfs  
> > partition. (a ramdisk, so-to-speak)
> > 
> > A bash script reads the text file and uses curl to send the data to  
> > emonCMS.
> > 
> > I’ll send you the files later today (I’m at work ATM). Hopefully, they’ll  
> > give you a place to start.
> > 
> > Regards,
> > 
> > ## Bill
> > 
> > Visit Message  
> > [https://community.openenergymonitor.org/t/read-the-sdm220-modbus-with-the-minimalmodbus-python-module/4819/2](https://community.openenergymonitor.org/t/read-the-sdm220-modbus-with-the-minimalmodbus-python-module/4819/2)  
> > or reply to this email to respond.
> > 
> > To unsubscribe from these emails, click here  
> > [https://community.openenergymonitor.org/email/unsubscribe/1223200ac8db08bf001a1275f8100a25ace2187f9a9a2b0f7c11210086bce4de](https://community.openenergymonitor.org/email/unsubscribe/1223200ac8db08bf001a1275f8100a25ace2187f9a9a2b0f7c11210086bce4de)  
> > .

---

<div class="post-metadata">

**Author:** ![Bill.Thomson](https://community.openenergymonitor.org/user_avatar/community.openenergymonitor.org/bill.thomson/32/1834_2.png) [@Bill.Thomson](https://community.openenergymonitor.org/u/Bill.Thomson)\
**Post date:** [16 August 2017 01:24 UTC](https://community.openenergymonitor.org/t/read-the-sdm220-modbus-with-the-minimalmodbus-python-module/4819/4 "2017-08-16T01:24:40Z")

</div>

Here’s the Python script and bash file…

[read\_meter.py](https://community.openenergymonitor.org/uploads/default/original/2X/5/58e25099ff7e081d4643961345377d1a4b1e61fc.py) (2.3 KB)  
[send-to-eorg.sh](https://community.openenergymonitor.org/uploads/default/original/2X/f/fdcd79eccc2680dd7df40f2ccaa0815ce5570ed2.sh) (1.2 KB)

_Note: You’ll need version 2.1.2 of Advanced Python Scheduler._  
_APS version 3.x is not compatible with the script as written._

This should help with getting to know modbus: [About Modbus | Simply Modbus Software](http://www.simplymodbus.ca/faq.htm)

---

<div class="post-metadata">

**Author:** ![Joaquin\_Lopez](https://community.openenergymonitor.org/user_avatar/community.openenergymonitor.org/joaquin_lopez/32/2012_2.png) [@Joaquin\_Lopez](https://community.openenergymonitor.org/u/Joaquin_Lopez)\
**Post date:** [16 August 2017 17:20 UTC](https://community.openenergymonitor.org/t/read-the-sdm220-modbus-with-the-minimalmodbus-python-module/4819/5 "2017-08-16T17:20:53Z")

</div>

Thank you Bill,

both, the python file and the bash script are self-explanatory 🙂

I understand them, but what I need now is to discover how to integrate  
the data into my own emoncms that is installed in the same raspberry  
pi I use to collect the modbus data.

Into the emoncms I have to define the items that will receive the  
data, isn’t it?  
Do you know how to do it?  
Another possibility would be to use the [emoncms.org](http://emoncms.org) platform as you’ve done.

Regads,  
Joaquin

> **···**
>
> 2017-08-16 3:24 GMT+02:00, Bill Thomson : \> \> \> Here's the Python script and bash file... \> \> [read\_meter.py](https://community.openenergymonitor.org/uploads/default/original/2X/5/58e25099ff7e081d4643961345377d1a4b1e61fc.py) \> (2.3 KB) \> [send-to-eorg.sh](https://community.openenergymonitor.org/uploads/default/original/2X/b/b55cdce1692a0a1bb8a1e2fae5d13d1b89f2fd89.sh) \> (1.2 KB) \> \> \> \> \> \> --- \> [Visit \> Message](https://community.openenergymonitor.org/t/read-the-sdm220-modbus-with-the-minimalmodbus-python-module/4819/4) \> or reply to this email to respond. \> \> To unsubscribe from these emails, [click \> here](https://community.openenergymonitor.org/email/unsubscribe/d14cc024d2acf514770245beeb8a39151a5cd59b74f35b1322efd8fd504ff748). \>

---

<div class="post-metadata">

**Author:** ![Bill.Thomson](https://community.openenergymonitor.org/user_avatar/community.openenergymonitor.org/bill.thomson/32/1834_2.png) [@Bill.Thomson](https://community.openenergymonitor.org/u/Bill.Thomson)\
**Post date:** [16 August 2017 20:10 UTC](https://community.openenergymonitor.org/t/read-the-sdm220-modbus-with-the-minimalmodbus-python-module/4819/6 "2017-08-16T20:10:56Z")

</div>

> [@Joaquin\_Lopez](#):
>
> Do you know how to do it?

It’s quite easy actually. To send the data to your local emonCMS, all you need to do is edit this line:  
`http://emoncms.org/input/post.json?node=1&csv=$GENW,$NETC&apikey=xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" > /dev/null`

to read

`http://your-emonpi-ip-address-goes-here/input/post.json?node=1&csv=$GENW,$NETC&apikey=xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" > /dev/null`

and you should be good to go.

I don’t use MQTT or Node-RED, so unfortunately, I can’t offer any help with those two.

---

<div class="post-metadata">

**Author:** ![Joaquin\_Lopez](https://community.openenergymonitor.org/user_avatar/community.openenergymonitor.org/joaquin_lopez/32/2012_2.png) [@Joaquin\_Lopez](https://community.openenergymonitor.org/u/Joaquin_Lopez)\
**Post date:** [4 September 2017 16:32 UTC](https://community.openenergymonitor.org/t/read-the-sdm220-modbus-with-the-minimalmodbus-python-module/4819/7 "2017-09-04T16:32:58Z")

</div>

Hello again Bill!!!

I’ve already connected all the things and now I’m able to measure the power  
consumption.

Thank you very much for your help!!!

 ![](https://community.openenergymonitor.org/uploads/default/original/2X/a/abd95d0357889941ab4e983cf3f2e977e2ca6e95.png)

> **···**
>
> 2017-08-16 22:11 GMT+02:00 Bill Thomson \< noreply@community.openenergymonitor.org\>:
> 
> > Bill.Thomson [https://community.openenergymonitor.org/u/bill.thomson](https://community.openenergymonitor.org/u/bill.thomson) Bill  
> > Thomson [https://community.openenergymonitor.org/u/bill.thomson](https://community.openenergymonitor.org/u/bill.thomson)  
> > August 16
> > 
> > Joaquin\_Lopez:
> > 
> > Do you know how to do it?
> > 
> > It’s quite easy actually. To send the data to your local emonCMS, all you  
> > need to do is edit this line:  
> > [http://emoncms.org/input/post.json?node=1&csv=$GENW,$NETC&apikey=](http://emoncms.org/input/post.json?node=1&csv=$GENW,$NETC&apikey=)  
> > xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" \> /dev/null
> > 
> > to read
> > 
> > [http://your-emonpi-ip-address-goes-here/input/post.json](http://your-emonpi-ip-address-goes-here/input/post.json)?  
> > node=1&csv=$GENW,$NETC&apikey=xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" \>  
> > /dev/null
> > 
> > and you should be good to go.
> > 
> > ## I don’t use MQTT or Node-RED, so unfortunately, I can’t offer any help with those two.
> > 
> > ## Visit Message [https://community.openenergymonitor.org/t/read-the-sdm220-modbus-with-the-minimalmodbus-python-module/4819/6](https://community.openenergymonitor.org/t/read-the-sdm220-modbus-with-the-minimalmodbus-python-module/4819/6) or reply to this email to respond.
> > 
> > ## In Reply To Joaquin\_Lopez [https://community.openenergymonitor.org/u/joaquin\_lopez](https://community.openenergymonitor.org/u/joaquin_lopez) August 16 Thank you Bill, both, the python file and the bash script are self-explanatory 🙂 I understand them, but what I need now is to discover how to integrate the data into my own emoncms that is installed in the same raspberry pi I use to collect the modbus data. Into the emoncms I have …
> > 
> > Visit Message  
> > [https://community.openenergymonitor.org/t/read-the-sdm220-modbus-with-the-minimalmodbus-python-module/4819/6](https://community.openenergymonitor.org/t/read-the-sdm220-modbus-with-the-minimalmodbus-python-module/4819/6)  
> > or reply to this email to respond.
> > 
> > To unsubscribe from these emails, click here  
> > [https://community.openenergymonitor.org/email/unsubscribe/a1b50c3c8258b136c94fd14e480fd48e77ae3217a2a9d947927afe1f02c5c392](https://community.openenergymonitor.org/email/unsubscribe/a1b50c3c8258b136c94fd14e480fd48e77ae3217a2a9d947927afe1f02c5c392)  
> > .

---

<div class="post-metadata">

**Author:** ![Bill.Thomson](https://community.openenergymonitor.org/user_avatar/community.openenergymonitor.org/bill.thomson/32/1834_2.png) [@Bill.Thomson](https://community.openenergymonitor.org/u/Bill.Thomson)\
**Post date:** [4 September 2017 16:45 UTC](https://community.openenergymonitor.org/t/read-the-sdm220-modbus-with-the-minimalmodbus-python-module/4819/8 "2017-09-04T16:45:01Z")

</div>

Hi Joaquin,

> [@Joaquin\_Lopez](#):
>
> I’ve already connected all the things and now I’m able to measure the power consumption.

Looks good! Nice to see you got it working.

> [@Joaquin\_Lopez](#):
>
> Thank you very much for your help!!!

YVW, S.

---

<div class="post-metadata">

**Author:** ![Bill.Thomson](https://community.openenergymonitor.org/user_avatar/community.openenergymonitor.org/bill.thomson/32/1834_2.png) [@Bill.Thomson](https://community.openenergymonitor.org/u/Bill.Thomson)\
**Post date:** [7 September 2017 20:53 UTC](https://community.openenergymonitor.org/t/read-the-sdm220-modbus-with-the-minimalmodbus-python-module/4819/9 "2017-09-07T20:53:15Z")

</div>



---

<div class="post-metadata">

**Author:** ![RuiP](https://community.openenergymonitor.org/letter_avatar_proxy/v4/letter/r/c68b51/32.png) [@RuiP](https://community.openenergymonitor.org/u/RuiP)\
**Post date:** [30 March 2018 22:33 UTC](https://community.openenergymonitor.org/t/read-the-sdm220-modbus-with-the-minimalmodbus-python-module/4819/10 "2018-03-30T22:33:13Z")

</div>

Please help! 🙂

I too have a new fresh installation of emonCMS on a RaspPI 3 + USB-RS485 converter + Eastron SDM630 modbus energy monitor!

I’m a TOTAL noob =\> powered on a Raspberry for the first time ever, today. It’s already running emonCMS.

I’ve downloaded Bill’s script and bash files, but don’t know where to go next. Questions:

1. How do I get these script/bash to run on the RaspPI? (will continue to google on how to do it)
2. What editing is needed on the read\_mater.py in order to read the correct Modbus parameters of the Eastron SDM630? I’ve downloaded the Modbus manual for this meter (the addresses are similar to the ones on the Eastron SDM220). Joaquin, could you please share your file(s)?

Thanks!!

---

<div class="post-metadata">

**Author:** ![Joaquin\_Lopez](https://community.openenergymonitor.org/user_avatar/community.openenergymonitor.org/joaquin_lopez/32/2012_2.png) [@Joaquin\_Lopez](https://community.openenergymonitor.org/u/Joaquin_Lopez)\
**Post date:** [31 March 2018 13:36 UTC](https://community.openenergymonitor.org/t/read-the-sdm220-modbus-with-the-minimalmodbus-python-module/4819/11 "2018-03-31T13:36:20Z")

</div>

Hello RuiP, first of all you should test if the program works correctly.  
For example I tested this from the Terminal in the raspberry pi :

```auto
sdm120c -a 1 -p -q -b 9600 -P N -S 1 -2 /dev/ttyUSB0
sdm120c -a 1 -b 9600 -P N -S 1 -2 /dev/ttyUSB0
sdm120c -a 1 -d 1 -x -p -q -b 9600 -P N -S 1 -2 /dev/ttyUSB0

```

Then I used this script:

```auto
#!/usr/bin/python

import threading, time, subprocess, logging, minimalmodbus
from apscheduler.schedulers.background import BackgroundScheduler
from time import sleep

SDM220 = minimalmodbus.Instrument('/dev/ttyUSB0', 1)
SDM220.serial.baudrate = 9600
SDM220.serial.bytesize = 8
SDM220.serial.parity = minimalmodbus.serial.PARITY_NONE
SDM220.serial.stopbits = 1
SDM220.serial.timeout = 1
SDM220.debug = False
SDM220.mode = minimalmodbus.MODE_RTU
print SDM220

def read_SDM220_meter():

	Volts = rs485.read_float(0, functioncode=4, numberOfRegisters=2)  
	Current = rs485.read_float(6, functioncode=4, numberOfRegisters=2)
	Active_Power = rs485.read_float(12, functioncode=4, numberOfRegisters=2)
	Apparent_Power = rs485.read_float(18, functioncode=4, numberOfRegisters=2)
	Reactive_Power = rs485.read_float(24, functioncode=4, numberOfRegisters=2)
	Power_Factor = rs485.read_float(30, functioncode=4, numberOfRegisters=2)	
	Phase_Angle = rs485.read_float(36, functioncode=4, numberOfRegisters=2)
	Frequency = rs485.read_float(70, functioncode=4, numberOfRegisters=2)
	Import_Active_Energy = rs485.read_float(72, functioncode=4, numberOfRegisters=2) 
	Export_Active_Energy = rs485.read_float(74, functioncode=4, numberOfRegisters=2)
	Import_Reactive_Energy = rs485.read_float(76, functioncode=4, numberOfRegisters=2)
	Export_Reactive_Energy = rs485.read_float(78, functioncode=4, numberOfRegisters=2)
	Total_Active_Energy = rs485.read_float(342, functioncode=4, numberOfRegisters=2)
	Total_Reactive_Energy = rs485.read_float(344, functioncode=4, numberOfRegisters=2)

	file = open('/tmp/meter_data.txt', 'w+')
  	file.write(time.strftime('%Y%m%d %X '))
  	file.write('{} {} {} {} {} {} {} {} {} {} {} {} {} {}\n'.format(Volts, Current, Active_Power, Apparent_Power, Reactive_Power, Power_Factor, Phase_Angle, Frequency, Import_Active_Energy, Export_Active_Energy, Import_Reactive_Energy, Export_Reactive_Energy, Total_Active_Energy, Total_Reactive_Energy))
  	file.close()

    #subprocess.call('/opt/send-to-eorg.sh') # call the bash file to transmit the data

```

I hope this helps!  
Regards,

---

<div class="post-metadata">

**Author:** ![RuiP](https://community.openenergymonitor.org/letter_avatar_proxy/v4/letter/r/c68b51/32.png) [@RuiP](https://community.openenergymonitor.org/u/RuiP)\
**Post date:** [31 March 2018 14:44 UTC](https://community.openenergymonitor.org/t/read-the-sdm220-modbus-with-the-minimalmodbus-python-module/4819/12 "2018-03-31T14:44:13Z")

</div>

Thanks! Will try that this afternoon. One quick question though: how did you find the addresses (the numbers) used right after the “read\_float(” part?  
In the Eastron SDM630M Modbus manual, all Modbus addresses seem to be 5 digit numbers.

---

<div class="post-metadata">

**Author:** ![Joaquin\_Lopez](https://community.openenergymonitor.org/user_avatar/community.openenergymonitor.org/joaquin_lopez/32/2012_2.png) [@Joaquin\_Lopez](https://community.openenergymonitor.org/u/Joaquin_Lopez)\
**Post date:** [31 March 2018 15:39 UTC](https://community.openenergymonitor.org/t/read-the-sdm220-modbus-with-the-minimalmodbus-python-module/4819/13 "2018-03-31T15:39:54Z")

</div>

Yes, in the manual. I use the SDM220, not the SDM360.  
Regards,

---

<div class="post-metadata">

**Author:** ![RuiP](https://community.openenergymonitor.org/letter_avatar_proxy/v4/letter/r/c68b51/32.png) [@RuiP](https://community.openenergymonitor.org/u/RuiP)\
**Post date:** [2 April 2018 08:06 UTC](https://community.openenergymonitor.org/t/read-the-sdm220-modbus-with-the-minimalmodbus-python-module/4819/14 "2018-04-02T08:06:59Z")

</div>

So,I managed to get the readings out of the SDM630M, using minimalmodbus in Terminal ! Success!

Now I need to accomplish (what you guys would call) the basic: how to have these readings automated? Where to place a Python script so that it runs on start & continually? What’s the difference between a .py and a .sh file?

I’m REALLY a complete Raspberry / Linux noob.

---

<div class="post-metadata">

**Author:** ![Joaquin\_Lopez](https://community.openenergymonitor.org/user_avatar/community.openenergymonitor.org/joaquin_lopez/32/2012_2.png) [@Joaquin\_Lopez](https://community.openenergymonitor.org/u/Joaquin_Lopez)\
**Post date:** [4 April 2018 18:41 UTC](https://community.openenergymonitor.org/t/read-the-sdm220-modbus-with-the-minimalmodbus-python-module/4819/15 "2018-04-04T18:41:20Z")

</div>

SystemD has a thing called a service file. They’re easy to create and quite a lot more versatile than crontab.

:::: These are the steps ::::

1. Create a file /etc/systemd/system/sdm630m.service  
(I’m asuming your script is named sdm630m.py and is in /home/pi/) with the following content :

* * *

[Unit]  
Description=SDM630M reader

[Service]  
ExecStart=/home/pi/sdm630m.py  
Restart=always  
User=pi  
StandardOutput=syslog  
StandardError=syslog  
SyslogIdentifier=SDM630M

[Install]  
WantedBy=multi-user.target

* * *

1. Then use sudo systemctl enable sdm630m.service && sudo systemctl start sdm630m.service to get it running.

---

<div class="post-metadata">

**Author:** ![RuiP](https://community.openenergymonitor.org/letter_avatar_proxy/v4/letter/r/c68b51/32.png) [@RuiP](https://community.openenergymonitor.org/u/RuiP)\
**Post date:** [7 April 2018 20:38 UTC](https://community.openenergymonitor.org/t/read-the-sdm220-modbus-with-the-minimalmodbus-python-module/4819/16 "2018-04-07T20:38:09Z")

</div>

Success!!!

I had all kinds of suffering & trouble(1), related to never having worked with Raspberry / Linux before, but I’ve managed to get everything working! Thanks A LOT for your coding examples!

Power grid =\> Eastron SDM630 Modbus =\> CH340 RS485 to USB converter =\> Raspberry PI 3 running EmonSD expanded to 32GB

(1) for reference, and hopefully to help others:  
had to use apscheduler v2.1.2 in order for it to work,  
had trouble with spaces / indentation when copying code to IDLE  
had to give permissions to the .sh file (chmod +x send-to-eorg.sh)  
and a lot other tiny things and big things (like expanding the SD card to 32GB and installing the PIXEL GUI and some of the standard Raspbian apps)

---

<div class="post-metadata">

**Author:** ![Bill.Thomson](https://community.openenergymonitor.org/user_avatar/community.openenergymonitor.org/bill.thomson/32/1834_2.png) [@Bill.Thomson](https://community.openenergymonitor.org/u/Bill.Thomson)\
**Post date:** [8 April 2018 04:04 UTC](https://community.openenergymonitor.org/t/read-the-sdm220-modbus-with-the-minimalmodbus-python-module/4819/17 "2018-04-08T04:04:28Z")

</div>

Good to hear you got it working, Rui.

I’ve edited my post to indicate the version of APScheduler needed to work with the script.

---

<div class="post-metadata">

**Author:** ![Nicholas\_Herbst](https://community.openenergymonitor.org/user_avatar/community.openenergymonitor.org/nicholas_herbst/32/10486_2.png) [@Nicholas\_Herbst](https://community.openenergymonitor.org/u/Nicholas_Herbst)\
**Post date:** [29 July 2018 11:42 UTC](https://community.openenergymonitor.org/t/read-the-sdm220-modbus-with-the-minimalmodbus-python-module/4819/18 "2018-07-29T11:42:35Z")

</div>

Rui, would you mind sharing your code for the eastron SDM630-M?

---

<div class="post-metadata">

**Author:** ![syed](https://community.openenergymonitor.org/letter_avatar_proxy/v4/letter/s/a88e57/32.png) [@syed](https://community.openenergymonitor.org/u/syed)\
**Post date:** [19 December 2018 16:57 UTC](https://community.openenergymonitor.org/t/read-the-sdm220-modbus-with-the-minimalmodbus-python-module/4819/19 "2018-12-19T16:57:53Z")

</div>

Hi,  
I am currently working on a project using SDM630,USB-RS485,Raspberry pi 3 b+, solar panel and some loads, I wanted guidance on, how to collect data from SDM630 and then allowing that data to be uploaded on a webpage, I have my setup as SDM630 connected with main supply as 1p2w and iron 1p2w as load, further the SDM630 is connected with USB-RS485 which is then connected to raspberry pi, raspberry pi is installed with raspbian and thats it.  
I would be very thankful if you guide me.  
Regards

---

<div class="post-metadata">

**Author:** ![Ross](https://community.openenergymonitor.org/user_avatar/community.openenergymonitor.org/ross/32/15141_2.png) [@Ross](https://community.openenergymonitor.org/u/Ross)\
**Post date:** [16 August 2022 01:02 UTC](https://community.openenergymonitor.org/t/read-the-sdm220-modbus-with-the-minimalmodbus-python-module/4819/20 "2022-08-16T01:02:57Z")

</div>

Hi Bill, I know this is a old post, but is this still current?, I have been having trouble trying to get the data from a SDM220 into my emonpi inputs

[Next page](https://community.openenergymonitor.org/t/read-the-sdm220-modbus-with-the-minimalmodbus-python-module/4819.md?page=2)
