Closed micha6554 closed 4 years ago
Theoretically yes, why not... but I've never tested it.
you can be first :)
Its from ESP32 the pin 16/17 RX2/TX2 Soft- or Hardwareserial?
don't ask me, I don't know, you have to understand it yourself
you must decide if you want to use the software or hardware implementation
Personally I do not recommend using swserial, especially for esp32 where we have 3 hardware uarts. ...so, for the test, if you have hwserial 2
#define USE_HARDWARESERIAL
//#include <SoftwareSerial.h> // < comment out
#include <SDM.h>
//SoftwareSerial swSerSDM(13, 15); // < comment out
SDM sdm(Serial2, 9600, NOT_A_PIN, SERIAL_8N1, 16, 17); //config SDM
(of course, modify the baud rate if you have other than 9600)
basically if you use the default uart pins, then initialization may look simpler:
SDM sdm(Serial2, 9600, NOT_A_PIN)
Thanks reaper7!!!!
Its work!!
// // modbus for SDM-120 Energiemesser // https://github.com/reaper7/SDM_Energy_Meter // Config unter https://github.com/reaper7/SDM_Energy_Meter/blob/master/SDM_Config_User.h (unkomment #define USE_HARDWARESERIAL !!!!!!!!!) //
SDM sdm(Serial2, BAUDRATE, MAX3485_RE_DE_PIN, SERIAL_8N1, RX, TX); // (Serial2, baudrate, MAX3485_RE_DE_PIN, SERIAL_8N1, RX, TX)
I'm glad to hear that :) You are the first who confirmed :D
Its ESP32 with SoftwareSerial possible?
Or, its possible to use RX2 and TX2?
Thanks