Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Sdm72 #34

Merged
merged 2 commits into from
Sep 10, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
## Library for reading SDM120 SDM220 SDM230 SDM630 Modbus Energy meters. ##
## Library for reading SDM72 SDM120 SDM220 SDM230 SDM630 Modbus Energy meters. ##

### SECTIONS: ###
#### 1. [INTRODUCTION](#introduction) ####
Expand Down Expand Up @@ -133,7 +133,7 @@ to ensure low level on GPIO15 by built-in in most ESP8266 modules pulldown resis
---

### Reading: ###
List of available registers for SDM120/220/230/630:</br>
List of available registers for SDM72/120/220/230/630:</br>
https://github.com/reaper7/SDM_Energy_Meter/blob/master/SDM.h#L52
```cpp
//reading voltage from SDM with slave address 0x01 (default)
Expand Down Expand Up @@ -231,6 +231,7 @@ sdm.clearSuccCount();
:+1: ESP SoftwareSerial library by Peter Lerup (https://github.com/plerup/espsoftwareserial)</br>
:+1: crc calculation by Jaime García (https://github.com/peninquen/Modbus-Energy-Monitor-Arduino)</br>
:+1: new registers for SDM120 and SDM630 by bart.e (https://github.com/beireken/SDM220t)</br>
:+1: new registers for SDM72 by jegaha (https://github.com/jegaha/SDM_Energy_Meter)</br>

---

Expand Down
4 changes: 2 additions & 2 deletions SDM.cpp
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/* Library for reading SDM 120/220/230/630 Modbus Energy meters.
/* Library for reading SDM 72/120/220/230/630 Modbus Energy meters.
* Reading via Hardware or Software Serial library & rs232<->rs485 converter
* 2016-2019 Reaper7 (tested on wemos d1 mini->ESP8266 with Arduino 1.9.0-beta & 2.4.1 esp8266 core)
* crc calculation by Jaime Garc�a (https://github.com/peninquen/Modbus-Energy-Monitor-Arduino/)
* crc calculation by Jaime García (https://github.com/peninquen/Modbus-Energy-Monitor-Arduino/)
*/
//------------------------------------------------------------------------------
#include "SDM.h"
Expand Down
12 changes: 11 additions & 1 deletion SDM.h
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/* Library for reading SDM 120/220/230/630 Modbus Energy meters.
/* Library for reading SDM 72/120/220/230/630 Modbus Energy meters.
* Reading via Hardware or Software Serial library & rs232<->rs485 converter
* 2016-2019 Reaper7 (tested on wemos d1 mini->ESP8266 with Arduino 1.9.0-beta & 2.4.1 esp8266 core)
* crc calculation by Jaime García (https://github.com/peninquen/Modbus-Energy-Monitor-Arduino/)
Expand Down Expand Up @@ -49,6 +49,16 @@
#define SDM_B_01 0x01 //BYTE 1 -> slave address (default value 1 read from node 1)
#define SDM_B_02 0x04 //BYTE 2 -> function code (default value 0x04 read from 3X input registers)
//BYTES 3 & 4 (BELOW)
//SDM 72 registers
#define SDM72_TOTAL_POWER 0x0034 //W
#define SDM72_IMPORT_ENERGY 0x0048 //kWh
#define SDM72_EXPORT_ENERGY 0x004A //kWh
#define SDM72_TOTAL_ENERGY 0x0156 //kWh
#define SDM72_SETABLE_TOTAL_ENERGY 0x0180 //kWh
#define SDM72_SETABLE_IMPORT_ENERGY 0x0184 //kWh
#define SDM72_SETABLE_EXPORT_ENERGY 0x0186 //kWh
#define SDM72_IMPORT_POWER 0x0500 //W
#define SDM72_EXPORT_POWER 0x0502 //W
//SDM 120 registers
#define SDM120C_VOLTAGE 0x0000 //V
#define SDM120C_CURRENT 0x0006 //A
Expand Down
4 changes: 2 additions & 2 deletions SDM_Config_User.h
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/* Library for reading SDM 120/220/230/630 Modbus Energy meters.
/* Library for reading SDM 72/120/220/230/630 Modbus Energy meters.
* Reading via Hardware or Software Serial library & rs232<->rs485 converter
* 2016-2019 Reaper7 (tested on wemos d1 mini->ESP8266 with Arduino 1.9.0-beta & 2.4.1 esp8266 core)
* crc calculation by Jaime Garc�a (https://github.com/peninquen/Modbus-Energy-Monitor-Arduino/)
* crc calculation by Jaime García (https://github.com/peninquen/Modbus-Energy-Monitor-Arduino/)
*/

/*
Expand Down
2 changes: 1 addition & 1 deletion library.properties
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ name=SDM
version=2.0.2
author=Reaper7
maintainer=Reaper7
sentence=SDM 120/220/230/630 modbus energy meter
sentence=SDM 72/120/220/230/630 modbus energy meter
paragraph=library for ESP8266, ESP32, AVR
category=Communication
url=https://github.com/reaper7/SDM_Energy_Meter
Expand Down