Skip to content

ESP32 Google PubSub: This repository shows how to connect the ESP32 microcontroller to Google Cloud Pub/Sub for real-time messaging. It uses JSON Web Tokens (JWT) for secure authentication, allowing you to easily publish and subscribe to messages. Check out the examples to start building your IoT applications!

Notifications You must be signed in to change notification settings

euginfrancis/ESP32_Google_PubSub

Repository files navigation

🌐 ESP32 Google PubSub

ESP32 License

Welcome to the ESP32 Google PubSub project! 🎉 This repository is a continuation of the ESP32 JWT Auth project, where we integrate Google Pub/Sub with the ESP32 microcontroller for efficient messaging and event-driven architectures.

📜 Overview

This project demonstrates how to use Google Cloud Pub/Sub with the ESP32 microcontroller, allowing for seamless communication between IoT devices and cloud services. ☁️ It leverages JSON Web Tokens (JWT) for secure authentication and authorization. 🔒

✨ Features

  • Secure Communication: Utilize JWT for authentication with Google Cloud services. 🔐
  • Real-time Messaging: Publish and subscribe to messages in real-time using Google Pub/Sub. 📬
  • IoT Integration: Connect your ESP32 devices to the cloud for scalable IoT solutions. 🌍

⚙️ Prerequisites

Before you begin, ensure you have met the following requirements:

  • An ESP32 development board. 🛠️
  • A Google Cloud account with billing enabled. 💳
  • Google Cloud SDK installed (for setting up Pub/Sub). 📦
  • Basic knowledge of Arduino IDE or PlatformIO. 📚

🚀 Installation

  1. Clone this repository:

    git clone https://github.com/euginfrancis/ESP32_Google_PubSub.git
    cd ESP32_Google_PubSub
    

Set up your Google Cloud Pub/Sub:

  1. Create a new project on Google Cloud Console. 🖥️
  2. Enable the Pub/Sub API. ⚡
  3. Create a service account and download the JSON key file. 📄
  4. Update the code with your credentials and project settings. 🔧

📬 Usage

📤 Publishing Messages

To publish messages to a topic, ensure you configure the following in your code:

const char PRIVATE_KEY[] = "Your private key";
const char* projectId = "Your pubsub project id";
const char* topicName = "Your pubsub topic";
const char* subscription_id = "Your pubsub subscription id";
//Please ensure the private key is formatted correctly.

🤝 Contributing

Contributions are welcome! Please fork the repository and submit a pull request for any improvements or new features. 💡

📜 License

This project is licensed under the MIT License - see the LICENSE file for details. 📃

🙏 Acknowledgments

About

ESP32 Google PubSub: This repository shows how to connect the ESP32 microcontroller to Google Cloud Pub/Sub for real-time messaging. It uses JSON Web Tokens (JWT) for secure authentication, allowing you to easily publish and subscribe to messages. Check out the examples to start building your IoT applications!

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published