reaper7 / SDM_Energy_Meter

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

esp32 hardware serial per default #74

Closed Adminius closed 1 year ago

Adminius commented 1 year ago

resolves #73

But, now I've found a SW serial for ESP32, but it is not in esp32 core, it's external library: https://github.com/plerup/espsoftwareserial I think, now it makes more sense to integrate espsoftserial for esp32 and leave sw serial as default and hw serial as an option...

@reaper7 what do you think about it?

reaper7 commented 1 year ago

Hi! ESP Software Serial is for both esp8266 and esp32, but only for esp8266 is included in the core package. For esp32 this needs to be downloaded as a separate library.

At this moment my library treats esp8266 and esp32 the same if the user selects SW SERIAL. For this reason, this is what compiler conditions look like:

  #if defined ( ESP8266 ) || defined ( ESP32 )                                  //  on esp8266/esp32
    SDM(SoftwareSerial& serial, long baud = SDM_UART_BAUD, int dere_pin = DERE_PIN, int config = SDM_UART_CONFIG, int8_t rx_pin = SDM_RX_PIN, int8_t tx_pin = SDM_TX_PIN);

So the question is, does it make sense to make changes?

Adminius commented 1 year ago

yeah... that is a good question, and I would say no. (the changes were already done... that's why this PR) so, I will close this PR