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

Added support for Hiking DDS238-2 ZN/S Energy Meter (Modbus) #6384

Closed
Closed
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
2 changes: 1 addition & 1 deletion platformio.ini
Original file line number Diff line number Diff line change
Expand Up @@ -218,7 +218,7 @@ upload_speed = 115200
upload_resetmethod = nodemcu

; *** Upload Serial reset method for Wemos and NodeMCU
upload_port = COM5
upload_port = /dev/ttyUSB0
extra_scripts = pio/strip-floats.py

; *** Upload file to OTA server using SCP
Expand Down
2 changes: 2 additions & 0 deletions sonoff/language/bg-BG.h
Original file line number Diff line number Diff line change
Expand Up @@ -596,6 +596,8 @@
#define D_SENSOR_IBEACON_RX "iBeacon RX"
#define D_SENSOR_RDM6300_RX "RDM6300 RX"
#define D_SENSOR_CC1101_CS "CC1101 CS"
#define D_SENSOR_DDS2382_TX "DDS238-2 Tx"
#define D_SENSOR_DDS2382_RX "DDS238-2 Rx"

#define D_SENSOR_A4988_DIR "A4988 DIR"
#define D_SENSOR_A4988_STP "A4988 STP"
Expand Down
2 changes: 2 additions & 0 deletions sonoff/language/cs-CZ.h
Original file line number Diff line number Diff line change
Expand Up @@ -602,6 +602,8 @@
#define D_SENSOR_A4988_MS1 "A4988 MS1"
#define D_SENSOR_A4988_MS2 "A4988 MS2"
#define D_SENSOR_A4988_MS3 "A4988 MS3"
#define D_SENSOR_DDS2382_TX "DDS238-2 Tx"
#define D_SENSOR_DDS2382_RX "DDS238-2 Rx"

// Units
#define D_UNIT_AMPERE "A"
Expand Down
2 changes: 2 additions & 0 deletions sonoff/language/de-DE.h
Original file line number Diff line number Diff line change
Expand Up @@ -602,6 +602,8 @@
#define D_SENSOR_A4988_MS1 "A4988 MS1"
#define D_SENSOR_A4988_MS2 "A4988 MS2"
#define D_SENSOR_A4988_MS3 "A4988 MS3"
#define D_SENSOR_DDS2382_TX "DDS238-2 Tx"
#define D_SENSOR_DDS2382_RX "DDS238-2 Rx"

// Units
#define D_UNIT_AMPERE "A"
Expand Down
2 changes: 2 additions & 0 deletions sonoff/language/el-GR.h
Original file line number Diff line number Diff line change
Expand Up @@ -602,6 +602,8 @@
#define D_SENSOR_A4988_MS1 "A4988 MS1"
#define D_SENSOR_A4988_MS2 "A4988 MS2"
#define D_SENSOR_A4988_MS3 "A4988 MS3"
#define D_SENSOR_DDS2382_TX "DDS238-2 Tx"
#define D_SENSOR_DDS2382_RX "DDS238-2 Rx"

// Units
#define D_UNIT_AMPERE "A"
Expand Down
2 changes: 2 additions & 0 deletions sonoff/language/en-GB.h
Original file line number Diff line number Diff line change
Expand Up @@ -602,6 +602,8 @@
#define D_SENSOR_A4988_MS1 "A4988 MS1"
#define D_SENSOR_A4988_MS2 "A4988 MS2"
#define D_SENSOR_A4988_MS3 "A4988 MS3"
#define D_SENSOR_DDS2382_TX "DDS238-2 Tx"
#define D_SENSOR_DDS2382_RX "DDS238-2 Rx"

// Units
#define D_UNIT_AMPERE "A"
Expand Down
2 changes: 2 additions & 0 deletions sonoff/language/es-ES.h
Original file line number Diff line number Diff line change
Expand Up @@ -602,6 +602,8 @@
#define D_SENSOR_A4988_MS1 "A4988 MS1"
#define D_SENSOR_A4988_MS2 "A4988 MS2"
#define D_SENSOR_A4988_MS3 "A4988 MS3"
#define D_SENSOR_DDS2382_TX "DDS238-2 Tx"
#define D_SENSOR_DDS2382_RX "DDS238-2 Rx"

// Units
#define D_UNIT_AMPERE "A"
Expand Down
2 changes: 2 additions & 0 deletions sonoff/language/fr-FR.h
Original file line number Diff line number Diff line change
Expand Up @@ -602,6 +602,8 @@
#define D_SENSOR_A4988_MS1 "A4988 MS1"
#define D_SENSOR_A4988_MS2 "A4988 MS2"
#define D_SENSOR_A4988_MS3 "A4988 MS3"
#define D_SENSOR_DDS2382_TX "DDS238-2 Tx"
#define D_SENSOR_DDS2382_RX "DDS238-2 Rx"

// Units
#define D_UNIT_AMPERE "A"
Expand Down
2 changes: 2 additions & 0 deletions sonoff/language/he-HE.h
Original file line number Diff line number Diff line change
Expand Up @@ -602,6 +602,8 @@
#define D_SENSOR_A4988_MS1 "A4988 MS1"
#define D_SENSOR_A4988_MS2 "A4988 MS2"
#define D_SENSOR_A4988_MS3 "A4988 MS3"
#define D_SENSOR_DDS2382_TX "DDS238-2 Tx"
#define D_SENSOR_DDS2382_RX "DDS238-2 Rx"

// Units
#define D_UNIT_AMPERE "A"
Expand Down
2 changes: 2 additions & 0 deletions sonoff/language/hu-HU.h
Original file line number Diff line number Diff line change
Expand Up @@ -602,6 +602,8 @@
#define D_SENSOR_A4988_MS1 "A4988 MS1"
#define D_SENSOR_A4988_MS2 "A4988 MS2"
#define D_SENSOR_A4988_MS3 "A4988 MS3"
#define D_SENSOR_DDS2382_TX "DDS238-2 Tx"
#define D_SENSOR_DDS2382_RX "DDS238-2 Rx"

// Units
#define D_UNIT_AMPERE "A"
Expand Down
2 changes: 2 additions & 0 deletions sonoff/language/it-IT.h
Original file line number Diff line number Diff line change
Expand Up @@ -602,6 +602,8 @@
#define D_SENSOR_A4988_MS1 "A4988 MS1"
#define D_SENSOR_A4988_MS2 "A4988 MS2"
#define D_SENSOR_A4988_MS3 "A4988 MS3"
#define D_SENSOR_DDS2382_TX "DDS238-2 Tx"
#define D_SENSOR_DDS2382_RX "DDS238-2 Rx"

// Units
#define D_UNIT_AMPERE "A"
Expand Down
2 changes: 2 additions & 0 deletions sonoff/language/ko-KO.h
Original file line number Diff line number Diff line change
Expand Up @@ -602,6 +602,8 @@
#define D_SENSOR_A4988_MS1 "A4988 MS1"
#define D_SENSOR_A4988_MS2 "A4988 MS2"
#define D_SENSOR_A4988_MS3 "A4988 MS3"
#define D_SENSOR_DDS2382_TX "DDS238-2 Tx"
#define D_SENSOR_DDS2382_RX "DDS238-2 Rx"

// Units
#define D_UNIT_AMPERE "A"
Expand Down
2 changes: 2 additions & 0 deletions sonoff/language/nl-NL.h
Original file line number Diff line number Diff line change
Expand Up @@ -602,6 +602,8 @@
#define D_SENSOR_A4988_MS1 "A4988 MS1"
#define D_SENSOR_A4988_MS2 "A4988 MS2"
#define D_SENSOR_A4988_MS3 "A4988 MS3"
#define D_SENSOR_DDS2382_TX "DDS238-2 Tx"
#define D_SENSOR_DDS2382_RX "DDS238-2 Rx"

// Units
#define D_UNIT_AMPERE "A"
Expand Down
2 changes: 2 additions & 0 deletions sonoff/language/pl-PL.h
Original file line number Diff line number Diff line change
Expand Up @@ -602,6 +602,8 @@
#define D_SENSOR_A4988_MS1 "A4988 MS1"
#define D_SENSOR_A4988_MS2 "A4988 MS2"
#define D_SENSOR_A4988_MS3 "A4988 MS3"
#define D_SENSOR_DDS2382_TX "DDS238-2 Tx"
#define D_SENSOR_DDS2382_RX "DDS238-2 Rx"

// Units
#define D_UNIT_AMPERE "A"
Expand Down
2 changes: 2 additions & 0 deletions sonoff/language/pt-BR.h
Original file line number Diff line number Diff line change
Expand Up @@ -602,6 +602,8 @@
#define D_SENSOR_A4988_MS1 "A4988 MS1"
#define D_SENSOR_A4988_MS2 "A4988 MS2"
#define D_SENSOR_A4988_MS3 "A4988 MS3"
#define D_SENSOR_DDS2382_TX "DDS238-2 Tx"
#define D_SENSOR_DDS2382_RX "DDS238-2 Rx"

// Units
#define D_UNIT_AMPERE "A"
Expand Down
2 changes: 2 additions & 0 deletions sonoff/language/pt-PT.h
Original file line number Diff line number Diff line change
Expand Up @@ -602,6 +602,8 @@
#define D_SENSOR_A4988_MS1 "A4988 MS1"
#define D_SENSOR_A4988_MS2 "A4988 MS2"
#define D_SENSOR_A4988_MS3 "A4988 MS3"
#define D_SENSOR_DDS2382_TX "DDS238-2 Tx"
#define D_SENSOR_DDS2382_RX "DDS238-2 Rx"

// Units
#define D_UNIT_AMPERE "A"
Expand Down
2 changes: 2 additions & 0 deletions sonoff/language/ru-RU.h
Original file line number Diff line number Diff line change
Expand Up @@ -602,6 +602,8 @@
#define D_SENSOR_A4988_MS1 "A4988 MS1"
#define D_SENSOR_A4988_MS2 "A4988 MS2"
#define D_SENSOR_A4988_MS3 "A4988 MS3"
#define D_SENSOR_DDS2382_TX "DDS238-2 Tx"
#define D_SENSOR_DDS2382_RX "DDS238-2 Rx"

// Units
#define D_UNIT_AMPERE "А"
Expand Down
2 changes: 2 additions & 0 deletions sonoff/language/sk-SK.h
Original file line number Diff line number Diff line change
Expand Up @@ -602,6 +602,8 @@
#define D_SENSOR_A4988_MS1 "A4988 MS1"
#define D_SENSOR_A4988_MS2 "A4988 MS2"
#define D_SENSOR_A4988_MS3 "A4988 MS3"
#define D_SENSOR_DDS2382_TX "DDS238-2 Tx"
#define D_SENSOR_DDS2382_RX "DDS238-2 Rx"

// Units
#define D_UNIT_AMPERE "A"
Expand Down
2 changes: 2 additions & 0 deletions sonoff/language/sv-SE.h
Original file line number Diff line number Diff line change
Expand Up @@ -602,6 +602,8 @@
#define D_SENSOR_A4988_MS1 "A4988 MS1"
#define D_SENSOR_A4988_MS2 "A4988 MS2"
#define D_SENSOR_A4988_MS3 "A4988 MS3"
#define D_SENSOR_DDS2382_TX "DDS238-2 Tx"
#define D_SENSOR_DDS2382_RX "DDS238-2 Rx"

// Units
#define D_UNIT_AMPERE "A"
Expand Down
2 changes: 2 additions & 0 deletions sonoff/language/tr-TR.h
Original file line number Diff line number Diff line change
Expand Up @@ -602,6 +602,8 @@
#define D_SENSOR_A4988_MS1 "A4988 MS1"
#define D_SENSOR_A4988_MS2 "A4988 MS2"
#define D_SENSOR_A4988_MS3 "A4988 MS3"
#define D_SENSOR_DDS2382_TX "DDS238-2 Tx"
#define D_SENSOR_DDS2382_RX "DDS238-2 Rx"

// Units
#define D_UNIT_AMPERE "A"
Expand Down
2 changes: 2 additions & 0 deletions sonoff/language/uk-UK.h
Original file line number Diff line number Diff line change
Expand Up @@ -602,6 +602,8 @@
#define D_SENSOR_A4988_MS1 "A4988 MS1"
#define D_SENSOR_A4988_MS2 "A4988 MS2"
#define D_SENSOR_A4988_MS3 "A4988 MS3"
#define D_SENSOR_DDS2382_TX "DDS238-2 Tx"
#define D_SENSOR_DDS2382_RX "DDS238-2 Rx"

// Units
#define D_UNIT_AMPERE "А"
Expand Down
2 changes: 2 additions & 0 deletions sonoff/language/zh-CN.h
Original file line number Diff line number Diff line change
Expand Up @@ -602,6 +602,8 @@
#define D_SENSOR_A4988_MS1 "A4988 MS1"
#define D_SENSOR_A4988_MS2 "A4988 MS2"
#define D_SENSOR_A4988_MS3 "A4988 MS3"
#define D_SENSOR_DDS2382_TX "DDS238-2 Tx"
#define D_SENSOR_DDS2382_RX "DDS238-2 Rx"

// Units
#define D_UNIT_AMPERE "安"
Expand Down
2 changes: 2 additions & 0 deletions sonoff/language/zh-TW.h
Original file line number Diff line number Diff line change
Expand Up @@ -602,6 +602,8 @@
#define D_SENSOR_A4988_MS1 "A4988 MS1"
#define D_SENSOR_A4988_MS2 "A4988 MS2"
#define D_SENSOR_A4988_MS3 "A4988 MS3"
#define D_SENSOR_DDS2382_TX "DDS238-2 Tx"
#define D_SENSOR_DDS2382_RX "DDS238-2 Rx"

// Units
#define D_UNIT_AMPERE "安"
Expand Down
4 changes: 4 additions & 0 deletions sonoff/my_user_config.h
Original file line number Diff line number Diff line change
Expand Up @@ -441,6 +441,10 @@
#define SOLAXX1_SPEED 9600 // Solax X1 Modbus RS485 serial speed (default: 9600 baud)
#define SOLAXX1_PV2 // Solax X1 using second PV

//#define USE_DDS2382 //Add support for Hiking DDS238-2 ZN/S
//#define DDS2382_SPEED 9600
//#define DDS2383_ID 1

// -- Low level interface devices -----------------
#define USE_DHT // Add support for DHT11, AM2301 (DHT21, DHT22, AM2302, AM2321) and SI7021 Temperature and Humidity sensor (1k6 code)

Expand Down
1 change: 1 addition & 0 deletions sonoff/sonoff_post.h
Original file line number Diff line number Diff line change
Expand Up @@ -185,6 +185,7 @@ char* ToHex_P(const unsigned char * in, size_t insz, char * out, size_t outsz, c
#define USE_SM16716 // Add support for SM16716 RGB LED controller (+0k7 code)
#define USE_HRE // Add support for Badger HR-E Water Meter (+1k4 code)
//#define USE_SOLAX_X1 // Add support for Solax X1 series Modbus log info (+4k1 code)
#define USE_DDS2382 //Add support for Hiking DDS238-2 ZN/S
#endif // FIRMWARE_SENSORS

/*********************************************************************************************\
Expand Down
7 changes: 7 additions & 0 deletions sonoff/sonoff_template.h
Original file line number Diff line number Diff line change
Expand Up @@ -200,6 +200,8 @@ enum UserSelectablePins {
GPIO_A4988_MS1, // A4988 microstep pin1
GPIO_A4988_MS2, // A4988 microstep pin2
GPIO_A4988_MS3, // A4988 microstep pin3
GPIO_DDS2382_TX, // DDS2382 Serial interface
GPIO_DDS2382_RX, // DDS2382 Serial interface
GPIO_SENSOR_END };

// Programmer selectable GPIO functionality
Expand Down Expand Up @@ -274,6 +276,7 @@ const char kSensorNames[] PROGMEM =
D_SENSOR_RDM6300_RX "|"
D_SENSOR_IBEACON_TX "|" D_SENSOR_IBEACON_RX "|"
D_SENSOR_A4988_DIR "|" D_SENSOR_A4988_STP "|" D_SENSOR_A4988_ENA "|" D_SENSOR_A4988_MS1 "|" D_SENSOR_A4988_MS2 "|" D_SENSOR_A4988_MS3 "|"
D_SENSOR_DDS2382_TX "|" D_SENSOR_DDS2382_RX "|"
;

// User selectable ADC0 functionality
Expand Down Expand Up @@ -705,6 +708,10 @@ const uint8_t kGpioNiceList[] PROGMEM = {
GPIO_A4988_MS2, // A4988 microstep pin2
GPIO_A4988_MS3, // A4988 microstep pin3
#endif
#ifdef USE_DDS2382
GPIO_DDS2382_TX, // Solax Inverter tx pin
GPIO_DDS2382_RX, // Solax Inverter rx pin
#endif
};

const uint8_t kModuleNiceList[] PROGMEM = {
Expand Down
4 changes: 3 additions & 1 deletion sonoff/support_features.ino
Original file line number Diff line number Diff line change
Expand Up @@ -447,7 +447,9 @@ void GetFeatures(void)
#ifdef USE_A4988_Stepper
feature5 |= 0x00000020; // xdrv_25_A4988.ino
#endif
// feature5 |= 0x00000040;
#ifdef USE_DDS2382
feature5 |= 0x00000040; // xsns_55_dds2382.ino
#endif
// feature5 |= 0x00000080;

// feature5 |= 0x00000100;
Expand Down
Loading