• Skip to main content
  • Skip to primary sidebar

RNTLab.com

The Ultimate Shortcut to Learn Electronics and Programming with Open Source Hardware and Software

  • Courses
  • Forum
    • Forum
    • Ask Question
  • Shop
  • Account
  • Blog
  • Login

MQTT and ESP32

Q&A Forum › Category: Home Automation › MQTT and ESP32
0 Vote Up Vote Down
Russell Lear asked 4 years ago

Hi,
 
I’m working my way through the Learn ESP32 book and thought I’d try using the MQTT protocol to connect from ESP32 to RPi.  Does the PubSubClient library (2.6.0) work with the ESP32?  It hasn’t been updated in a while so I’m guessing so?
Thanks!
Russell.

Question Tags: ESP32
1 Answers
0 Vote Up Vote Down
Rui Santos Staff answered 4 years ago

Hi Russell, have you tried this example with the ESP32? https://github.com/knolleary/pubsubclient/blob/master/examples/mqtt_esp8266/mqtt_esp8266.ino
Make sure you change that line: #include <ESP8266WiFi.h>
To: #include <WiFi.h>
That example should work with the ESP32, I haven’t tried it recently, but it should work just fine.
I’ll also be adding to the course a project that uses MQTT in 2 or 3 weeks.

Primary Sidebar

Login to Ask or Answer Questions

This Forum is private and it’s only available for members enrolled in our Courses.

Login »

Latest Course Updates

  • [eBook Updated] Firebase Web App with ESP32 and ESP8266 (version 1.2) April 25, 2022
  • [eBook Updated] MicroPython Programming with ESP32 and ESP8266 (version 1.3) February 7, 2022

You must be logged in to view this content.

Contact Support - Refunds - Privacy - Terms - MakerAdvisor.com - Member Login

Copyright © 2013-2022 · RandomNerdTutorials.com · All Rights Reserved