DHT 22 has 4 pins, Pin 1 Vcc on the DHT22 is connected to a 3.3V pin on the ESP32. Pin 2, the DHT-22 data line is connected to GPIO13 Pin 3 is left disconnected and pin 4 ground is connected to a ground on the ESP32.
Step 4: MQTT Publish code
If umqtt is not there , install using this command
Step 5: Verify edge side code
On the serial console, check temperature and humidity values are showing
Pi Side setup
Step 6: Setting up Pi
Install python3 and connect SSD1306
Step 7 : Subscribe code
Step 8 :Display data code via SSD OLED display
Verify the reading at SSD console connected with Pi
Step 9 : Also verify the readings from Cloudmqtt console to check the messages are published and subscribed
Step 10 : Take the ESP32 setup with Battery and put it in another place,where temperature and humidity is different. Check SSD console to verify.