Arduino Mega send data to ESP8266-01 then ESP forward to RPI (MQTT)

No one can help until you post the latest source code. The console output would also be useful so we know whether the temperature and humidity variables have reasonable values.