ESP32 analogRead shows wrong data after ThingerWifi.handle

I’m using pin D4 aka A0 on ESP32 to read analog value from i2c soil moisture sensor. Sensor working properly when I’m using test code int sensorPin = 4; // select the input pin for LDR
int sensorValue; // variable to store the value coming from the sensor
void setup() {


void loop() {
delay(1000);//sets serial port for communication
//esp_sleep_enable_ext0_wakeup(GPIO_NUM_4, 0);
//sensorValue = digitalRead(sensorPin);// read the value from the sensor
sensorValue = analogRead(sensorPin);
Serial.println(sensorValue);//prints the values coming from the sensor on the screen



But after using ThingerWifi.handle on  my code, sensor just read value 4095 (its indicate sensor detect no moisture, in fact it is not). I;m trying this too with LDR analog sensor, but its shows value 0 then up to 2400 then back to 0 again. Is it a bug on ThingerWifi library? How I overcome this?

Code after using ThingerWifi.handle
#include <ThingerWifi.h>
int soil_sensor= 4;

//WiFi credentials
#define ssid "xxxxxxxxx"
#define password "xxxxx"

// credentials
#define user_id "xxxxx"
#define device_id "xxxxx"
#define device_credential "xxxxxx"

ThingerWifi thing(user_id, device_id, device_credential);

void setup() {
  pinMode(A0, INPUT);

  Serial.println("Connecting to: ");
  Serial.println("WiFi connected");
  thing["soilhumidity"]>> outputValue(analogRead(A0));

void loop() {
//for testing purpose
  float humidity = analogRead(A0);
  soilhumid= humidity;

Some ESP32 ports has specific functions when working with wifi communications, have you tried with a different one?