EmonLib with 4 Probes and Real Power Issues

Welcome, Antonio, to the OEM forum.

The problem is, emonLibCM is written for the Atmel ATMega328P processor only. To make it work with any other processor, you will need to make significant changes, which are most likely to be in the area of addressing the multiplexer / extracting the values from the ADC, and compensation necessary to remove the errors created by the delay between reading voltage and current and the phase errors of the two transformers.

This might help: ESP32 Problem with YHDC SCT-013-000

In general, many people seem to have a problem with the analogue inputs of an ESP32. See [TW#12287] ESP32 ADC accuracy · Issue #164 · espressif/esp-idf · GitHub and the comments that follow.

I do not have an ESP32, so I am unable to help you further.

Of course, if your c.t’s are not on the same phase as the voltage transformer, you will never read the correct real power with emonLibCM - in that situation, you need the 3-phase sketch, which also was written specifically for the Atmel ATMega328P.