• 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 via UART?

Q&A Forum › Category: ESP32 › MQTT via UART?
0 Vote Up Vote Down
Tjerk bij de Leij asked 3 years ago

Hi,
I already have MQTT with the ESP32 working via Wifi using the ‘Esp32MQTTClient’ library but now I want to sent the MQTT message via a BG96 modem which is connected to a UART of my ESP32. I already have configured the BG96 to connect to the APN of my SIM card provider. How do I configure the project in a way that the MQTT data is sent via the BG96?
Thanks,
Tjerk

Question Tags: MQTT ESP32
4 Answers
0 Vote Up Vote Down
Sara Santos Staff answered 3 years ago

Hi.

I’ve never used the BG96 modem. So, I’m not sure how things should be done.

Were you able to connect to the internet using that modem and the SIM card?

I guess that after having established an internet connection, you can use the regular commands to work with MQTT.

You probably need to search the AT commands to establish an internet connection: https://www.quectel.com/UploadImage/Downlad/Quectel_BG96_AT_Commands_Manual_V2.1.pdf

In that case, you need to use a cloud MQTTT broker, otherwise you would need to have a broker running on the same network that your SIM card.

I’m sorry that I can’t help much.

Regards,
Sara

0 Vote Up Vote Down
Tjerk bij de Leij answered 3 years ago

Hi Sara,
Thanks you for your quick reply.
I have configured the BG96 with AT coimmands in a way that it has internet connection. I am using the Arduino MQTT example to send data to a Azure cloud broker and that is working fine. My code is based on the following example: https://randomnerdtutorials.com/esp32-mqtt-publish-subscribe-arduino-ide/ 
However, that example is using WIFI to connect to the internet. My question is if I connect to the internet with the BG96 will the code automatically direct the data to the BG96 or what should I do to make that happen?
Kind regards,
Tjerk

0 Vote Up Vote Down
Sara Santos Staff answered 3 years ago

Hi again.
I think that once you connect to the internet using the BG96 with the AT commands, the code will automatically use that network.
I guess it’s the same principle when using a SIM800 module with internet connection as shown in this example: https://randomnerdtutorials.com/esp32-sim800l-publish-data-to-cloud/
Regards,
Sara

0 Vote Up Vote Down
Tjerk bij de Leij answered 3 years ago

Ok, thanks again!
Regards,
Tjerk

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] SMART HOME with RPi, ESP32, and ESP8266 (version 1.2) March 8, 2023
  • [eBook Updated] ESP32-CAM Projects (version 1.3) January 7, 2023

You must be logged in to view this content.

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

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

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.