PZEM 004 without ip address

help to solved problem with esp32

I add library GitHub - felixvinyals/FVlib_PZEM004T: Library for PZEM004T energy meter module without IP assignment

and when i start it on arduino uno it work ok , but on esp32 dev board it print error:

C:\Arduino\libraries\FVlib_PZEM004T-master/FVlib_PZEM004T.h:10:7: error: extra qualification 'FVlib_PZEM004T::' on member 'FVlib_PZEM004T' [-fpermissive]

FVlib_PZEM004T::FVlib_PZEM004T(SoftwareSerial &_port);

source:

#include "FVlib_PZEM004T.h"

SoftwareSerial port(2, 3);
FVlib_PZEM004T modul(port);

void setup() {
Serial.begin(9600);
port.begin(9600);

}

void loop() {
float v, i, p;

Serial.print("V: ");
v = modul.readVoltage();
Serial.println(v);
delay(500);

Serial.print("I: ");
i = modul.readCurrent();
Serial.println(i);
delay(500);

Serial.print("P: ");
p = modul.readPower();
Serial.println(p);
delay(500);

Serial.println(String("calculated power: ") + String(v * i));
}

Please use code tags (</> button on the toolbar) when you post code or warning/error messages. The reason is that the forum software can interpret parts of your code as markup, leading to confusion, wasted time, and a reduced chance for you to get help with your problem. This will also make it easier to read your code and to copy it to the IDE or editor. If your browser doesn't show the posting toolbar then you can just manually add the code tags:
[code]`` [color=blue]// your code is here[/color] ``[/code]
Using code tags and other important information is explained in the How to use this forum post. Please read it.

Please remove unnecessary blank lines from your code before posting to the forum. One or two to separate code into logical sections is fine but large spaces for no reason just make for more scrolling when we're trying to read your code.

When your code requires a library that's not included with the Arduino IDE please always post a link (using the chain link icon on the toolbar to make it clickable) to where you downloaded that library from or if you installed it using Library Manger(Sketch > Include Library > Manage Libraries) then say so and state the full name of the library.

When you encounter an error you'll see a button on the right side of the orange bar "Copy error messages". Click that button. Paste the error in a message here USING CODE TAGS (</> button on the toolbar).

#include "FVlib_PZEM004T.h"

SoftwareSerial port(2, 3);
FVlib_PZEM004T modul(port);

void setup() {
 Serial.begin(9600);
 port.begin(9600);


}

void loop() {
  float v, i, p;
  
  Serial.print("V: ");
  v = modul.readVoltage();
  Serial.println(v);
  delay(500);
  
  Serial.print("I: ");
  i = modul.readCurrent();
  Serial.println(i);
  delay(500);
  
  Serial.print("P: ");
  p = modul.readPower();
  Serial.println(p);
  delay(500);

  Serial.println(String("calculated power: ") + String(v * i));
}

pert:
Please remove unnecessary blank lines from your code before posting to the forum. One or two to separate code into logical sections is fine but large spaces for no reason just make for more scrolling when we're trying to read your code.

pert:
When your code requires a library that's not included with the Arduino IDE please always post a link (using the chain link icon on the toolbar to make it clickable) to where you downloaded that library from or if you installed it using Library Manger(Sketch > Include Library > Manage Libraries) then say so and state the full name of the library.

pert:
When you encounter an error you'll see a button on the right side of the orange bar "Copy error messages". Click that button. Paste the error in a message here USING CODE TAGS (</> button on the toolbar).

maybe something i can change in header file?

#ifndef FVlib_PZEM004T_h
  #define FVlib_PZEM004T_h

  #include <Arduino.h>
  #include <SoftwareSerial.h>

  class FVlib_PZEM004T {
    public:
      // Routines:
      FVlib_PZEM004T::FVlib_PZEM004T(SoftwareSerial &_port);
      float FVlib_PZEM004T::readVoltage();
      float FVlib_PZEM004T::readCurrent();
      unsigned int FVlib_PZEM004T::readPower();


    private:
      // Routines:
      void FVlib_PZEM004T::setCommunicationAddress();
      boolean FVlib_PZEM004T::receive(boolean printBuffer);
      boolean FVlib_PZEM004T::waitBufferToFill();
      boolean FVlib_PZEM004T::checksumError();
      //boolean FVlib_PZEM004T::send(byte* message);
      // Variables:
      SoftwareSerial *softPort;
      byte buffer[7];
      byte askVoltage[7] = {0xB0, 0xC0, 0xA8, 0x01, 0x01, (byte) 0x00, 0x1E};
      byte askCurrent[7] = {0xB1, 0xC0, 0xA8, 0x01, 0x01, (byte) 0x00, 0x1B};
      byte askPower[7] = {0xB2, 0xC0, 0xA8, 0x01, 0x01, (byte) 0x00, 0x1C};
      byte setAddress[7] = {0xB4, 0xC0, 0xA8, 0x01, 0x01, (byte) 0x00, 0x1E};
  };


#endif

Try removing all the FVlib_PZEM004T:: from the header file.

Thanks