Questions tagged [mqtt]
MQTT (Message Queuing Telemetry Transport) is a machine-to-machine (M2M)/"Internet of Things" connectivity protocol. The MQTT protocol enables a publish/subscribe messaging model in an extremely lightweight way. It is useful for connections with remote locations where a small code footprint is required and/or network bandwidth is at a premium.
89 questions
1
vote
0
answers
47
views
Secure upload to ThingSpeak with Arduino MKR GSM 1400 using GSMSSLCLient
I have an issue when trying to upload sensor data to ThingSpeak using the GSMSSLClient with the Arduino MKR GSM 1400 over MQTT. Each time I attempt to establish an MQTT connection, the state is always ...
0
votes
1
answer
75
views
How to make MQTT and ArduinoModbus libraries working on the same Ethernet port?
I have a SAMD51P20 based Arduino PLC with WIZnet W5500 based Ethernet shield. I'm using these libraries:
#include <Ethernet.h>
#include <MQTT.h>
#include <ArduinoModbus.h>
MQTT and ...
1
vote
1
answer
253
views
PubSubClient hanging on ESP32C3
I may have done some things incorrectly here, but this I what I have for publishing image that I read from serial camera to the MQTT broker:
void capturePicture() {
if (!cam.takePicture())
...
1
vote
1
answer
92
views
Weird behaviour with BearSSL on GPIO ESP8266
I use GPIO 5 to trigger a relay. My code also connects with a secure MQTT connection for which I have to use the BearSSL certificate definitions.
Without the BearSSL certificates, when the ESP ...
1
vote
1
answer
1k
views
Problem with using PubSubClient, the "callback" function doesn't seem to work correctly
I have a program that communicate between a esp8266 and a atmega328 using Serial, the esp8266 will connect to a MQTT server running on local network, and publish/subscribe to some topics. In the ...
1
vote
0
answers
122
views
Empty message parse using ArduinoJSON from aedes MQTT server
I'm using aedes as my custom MQTT broker and PubSubClient at the ESP32 side, together with the ArduinoJSON package.
My server test code:
import Aedes from "aedes";
import net from "net&...
3
votes
1
answer
997
views
how to transfer json to string?
I am getting a json object from aws iot MQTT. Assuming that json from aws is {status:opened}.
Here is my code.
#include <ArduinoJson.h>
void messageHandler(char *topic, byte *payload, unsigned ...
0
votes
1
answer
780
views
ESP32- Sporadic slow receive of MQTT messages
Problem description: Every ~20+ published messages (using terminal), MCU receives that message in a very noticeable delay (mostly ~10 sec, few time it got up to 1 min). Upon receive (printed in Serial ...
0
votes
0
answers
120
views
Arduino MQTT Library sending disconnect packets even though it is not called
I am trying to connect to AWS IoT through the Arduino Portenta H7 and I am following this blog (https://create.arduino.cc/projecthub/Arduino_Genuino/securely-connecting-an-arduino-mkr-wifi-1010-to-aws-...
1
vote
0
answers
2k
views
ESP32 CAM : How to send good quality images via MQTT
Has anyone here ever used a ESP32 CAM to send an image via MQTT? I'd like to know what are the parameters to initialize the camera with (resolution, jpeg quality, etc.), because once I receive the ...
1
vote
0
answers
638
views
How to correctly use SSL certs with the Adafruit SIM800H
I am trying to use a Adafruit Sim800H to connect to Azure using MQTT with an SSL certificate. My first step is trying to put a new SSL certificate onto the board. To do this I am using this example ...
2
votes
1
answer
3k
views
OTA over MQTT for ESP32
Before starting working, I am just researching around how can I achieve OTA over MQTT in ESP32 in using Arduino IDE.
The process I understand the esp listen to MQTT messages and then received that ...
1
vote
0
answers
437
views
Is it possible to upload a private root certificate to an Arduino Nano33?
I'm trying to connect an Arduino Nano 33 to an mqtt broker with TLS authenticaton on the broker side. To do that I need my Arduino board to have access to the the root certificate.
My understanding is ...
3
votes
1
answer
3k
views
Connect ESP32 via MQTT
For a project I am working on, I need to connect my ESP32 board to another server via MQTT protocol. I am using the Mosquitto MQTT Broker and it is presently on my laptop. Following is the test code I ...
2
votes
1
answer
4k
views
How to avoid MQTT reconnect Loop
I have the following code designed to allow me to control my device from my website using mqtt broker while internet is available. I also built in a local webserver to control the device in case of ...
0
votes
1
answer
3k
views
PubSubClient: Subscription working, but callback never called
I am using an ESP32 (https://heltec.org/project/wifi-kit-32/) with a AM2302 DHT22 and an LDR, talking to mosquitto on a Linux box. Publishing data is working fine, other than the "exceeded ...
1
vote
0
answers
49
views
4004 (NOT_FOUND) ON MQTT
I tried to send random data to MQTT but it's not working and I get:
{
"m2m:rsp" : {
"rsc" : 4004,
"rqi" : "123456",
"pc" : "Resource not found",
"to" : "5a185cedc6ad749b:...
-1
votes
1
answer
470
views
Modbus TCP together with MQTT over same ethernet
I'm currently in a planning phase for a project.
I want to read some sensor data over Modbus TCP, do some simple calculations on the Arduino and publish the results over MQTT. Which means I have 2 RJ-...
1
vote
1
answer
2k
views
PubSubClient - MQTT_MAX_PACKET_SIZE How is it calculated
I'm using an ESP32, and I want to rule out a probable MQTT error. In PubSubClient , MQTT_MAX_PACKET_SIZE is set to 256. Is 256 the size for message only ? if not, what is left for message only ?
0
votes
1
answer
264
views
ESP32 using PubSub, creating an error when implemted inside a library
I wish to combine into a single library Wifi + MQTT, for a multi devices project.
right after boot, getting Wifi - I get an error the moment MQTT server is trying to connect:
mqttClient.connect(...
1
vote
0
answers
570
views
node mcu disconnect from mqtt server
/*
Basic ESP8266 MQTT example
This sketch demonstrates the capabilities of the pubsub library in combination
with the ESP8266 board/library.
It connects to an MQTT server then:
- ...
4
votes
2
answers
14k
views
How to connect to MQTT broker with TLS?
I have ESP8266 which is connecting to MQTT broker and it is working ok using user+pass with following code:
#include <ESP8266WiFi.h>
#include <PubSubClient.h>
const char* ssid = "...
1
vote
2
answers
10k
views
esp32-cam publish image to mqtt
I want to publish image capture through ESP32-CAM to MQTT. Have following code :
#include "WiFi.h"
#include "esp_camera.h"
#include "esp_timer.h"
#include "img_converters.h"
#include "Arduino.h"
#...
0
votes
1
answer
414
views
How to transmit data from Arduino to Raspberry Pi?
I am planning to build a network with five Arduino Mega devices, each of which will collect data using multiple sensors. Each Arduino will periodically transmit the sensor data to a gateway Raspberry ...
1
vote
0
answers
559
views
ESP8266 mqtt publish + subscribe + serial read
seems I have some issues in my code as I subscribe for specific mqtt topic and also read same value via serial and publish it to mqtt. It takes time for device connected to serial to change setting ...