reaper7 / SDM_Energy_Meter

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

Slave ID not working. #40

Closed ghost closed 4 years ago

ghost commented 5 years ago

Hi,

I do have 3 slaves on the same RS485 line.

Reading SDM power with ESP32 from one divice is working fine. float power1 = sdm.readVal(SDM220T_POWER);

float power2 = sdm.readVal(SDM220T_POWER, 0x02); results in nan.

Your example sdm_simple:

Serial.print("Power: "); Serial.print(sdm.readVal(SDM220T_POWER), 2); //display power Serial.println("W"); Is working fine but only for one slave as defined with:

#define SDM_B_01 0x01 //BYTE 1 -> slave address (default value 1 read from node 1)

Regards, Joop.

reaper7 commented 5 years ago

I understand you have also changed the addresses in the meters? if so, leave on the RS485 line only meter with address 2 and try to read:

float power2 = sdm.readVal(SDM220T_POWER, 0x02);
reaper7 commented 4 years ago

closed due to inactivity