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.

Filter by
Sorted by
Tagged with
0
votes
0answers
29 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 ...
0
votes
0answers
21 views

Constantly getting RC=-2 error with Arduino Mega and ESP8266 as the wifi module for MQTT

I am trying to use the ESP8266 as the wifi module. My connections are as follows: ESP8266 <-----------------> Arduino Mega VCC ------------------> 3.3V (converted 5V from Mega to 3.3V ...
-1
votes
0answers
29 views

How to implement a QoS 1 using the Arduino MQTT Library for SIM800 GSM Modem?

The library I'm using along with a description can be found here -> https://elementztechblog.wordpress.com/2016/07/18/arduino-mqtt-library-for-sim800-gsm-modem/ Basically, I'm trying to talk to an ...
0
votes
1answer
33 views

cast from 'char*' to 'char' loses precision

Bit of a noob here. Im trying to use the sensor number (float) in my mqtt topic, but cant seem to get this right. Any help would be appreciated. Keep getting this error (cast from 'char*' to 'char' ...
0
votes
1answer
28 views

How to execute commands over desired amount of time

I have a program that receives 4 commands on 4 channels to change the color of an LED using mqtt communication. Lets just focus on two of the channels, the time and the red. I am sending a length of ...
0
votes
1answer
34 views

MQTT on nano with Ethernet shield not working

I'm using an arduino nano with an ethernet shield (ENC28J60), and ethernet eem to be working (I can create a webserver with Ethercard library).However, i'm stuck when i try to connect to a MQTT ...
1
vote
0answers
28 views

How to parse data most efficiently coming through mqtt with ESP8266

I am writing a program that is currently set up like so: Python script running on my computer. Raspberry pi is the broker for the mqtt data transmission An ESP8266 is programmed to listen to/...
0
votes
1answer
21 views

How do I change the scope of an object?

I am using the File/Examples/Adafruit MQTT Library/mqtt_ESP8266 example as a model for my code. In the example, the mqtt object is created as a global variable, and everything works fine. However, I ...
0
votes
1answer
50 views

publish json data to mqtt

I am trying to publish JSON data to mqtt with following code snippet #include <Arduino_JSON.h> JSONVar data; data["temperature"] = temperature; data["humidity"] = humidity; data["pressure"] = ...
1
vote
1answer
46 views

Publish chipid to mqtt using ESP32-CAM

I have been trying to push the data of temp, humidity, and pressure from a sensor to MQTT using ESP 32Cam, and was able to do using the following code: pressure = bme.readPressure(); //Convert the ...
0
votes
1answer
38 views

ESP8266 Arduino MQTT callback with dynamic topics

I have a program that depending on user input, it creates one or several objects that will publish data to a MQTT broker, each one with a different topic. This is already done. The ESP8266 also has ...
0
votes
0answers
40 views

WDT Reset with PubSubClient library for esp8266

I am using ESP8266 with arduino and PubSubClient library. With this library on esp8266, i can see esp8266 is resetting due to Watchdog reset. After google search get to know this is known issue. I was ...
0
votes
1answer
42 views

Obtain retained MQTT message

I’m using ESP8266 with Arduino code. Each device posts a ‘state’ and an ‘avail’ messages for a specific topic. I wish to be able to read those retained messages and not only right after connecting ...
1
vote
1answer
120 views

Impossible to connect ESP32 with Mosquitto on Raspberry using certificates

I installed Mosquitto broker in Raspberry in my local network. I generated certificates in Raspberry as follows: sudo openssl genrsa -out ca.key 2048 sudo openssl req -new -x509 -days 3600 -key ca....
0
votes
1answer
59 views

Waking an ESP8266 from Light-Sleep using a signal from MQTT?

I was wondering if it would be possible to wake an ESP8266 from a request over MQTT while it is in Light-Sleep mode? I am planning to implement a smart switch that would receive messages from a ...
0
votes
0answers
22 views

Adafruit MQTT Library Error Connection failed

Adafruit_MQTT library is awesome but i have got a problem with it. I use it in Arduino with NodeMCU (ESP8266). Everything is okey with example code. (TLS connection - WiFiClientSecure). With my way ...
0
votes
1answer
133 views

MQTT PubSubClient connection problem with ESP32

I am experiencing some problems with string in Arduino application with ESP32. I don't understand why this code works: mqtt.setServer ("m20.cloudmqtt.com", port); //is OK and this does not work ...
2
votes
2answers
122 views

Connecting to MQTT causes DHT11 Sensor to stop working?

I have a project I am working on, based on an ESP32 from NodeMCU. I have a bunch of sensors connected to said ESP32 - they all work and the code itself "works" with a minor quirk. The issue in ...
0
votes
0answers
208 views

MQTT subscribe callback fails to be called in ESP8266 deepsleep mode

Refer to ESP8266 deep sleep and MQTT I executed the code in the given link. However i am not able to receive the subscribe message that are send from MQTT test broker(MQTT Lens) on the serial ...
0
votes
2answers
111 views

How to get a list of IPs in a LAN using NodeMcu?

I'm going to create an IoT system. I use a Raspberry Pi as a MQTT broker and as a webserver. Every day, the Pi gets a new IP address, so I need to find its new IP address via ESP8266 to use this ...
1
vote
3answers
665 views

Convert byte* to int in Arduino

I am trying to convert byte* value to int here is how I have it. void mqttCallback(char* topic, byte* payload, unsigned int length) { String topicStr = topic; int* payload_value; int ...
0
votes
0answers
28 views

Arduino clients suddenly not able to connect (or publish) to MQTT

we are struggling with a project that has things (arduinos as clients) communicating to our MQTT broker (mosquitto) running on a DigitalOcean droplet (inside a docker). We have about 200 things at ...
0
votes
1answer
235 views

Notoriously unstable ESP8266 MQTT-client

I am doing a project where an ESP8266 receives data from an Arduino Uno and publishes it via MQTT. After a random amount of time, it will stop sending data to my MQTT broker. It might be an hour, it ...
0
votes
1answer
170 views

Mqtt not subscribe on topic that's converted from String to char array

I am still not sure what should be the exact Title for this question, because I don't know where the problem is. I am using #include <MQTTClient.h> mqtt library to subscribe on a topic. This ...
0
votes
0answers
85 views

I can't send GPS data to server

I am trying to send gps location data every 3 seconds to mqtt server if it's updated but my device shows weird stack errors and resets. What i am missing? I am using tinygps++ and pubsubclient as ...
0
votes
0answers
116 views

Real-time Pub/Sub thru MQTT between JoyStick and OnBoard Drive units [both ESP8266] - Connection issues

I looked around for solutions to my issue by searching on the forum and elsewhere and haven't seen similar issues - (https://arduino.stackexchange.com/search?page=2&tab=Relevance&q=MQTT%...
0
votes
3answers
2k views

ESP-01 not waking correctly up after deep sleep

I have an ESP-01 that I want to measure pool temperature with. It will send the data over MQTT to the broker. I have connected RST to GPIO16 so I can use the deep sleep functionality. Currently I am ...
0
votes
0answers
722 views

ESP8266 MQTT periodically disconnecting

I use an MQTT to communicate with an ESP8266. I'm using cloudmqtt.com and PubSubClient. Sometimes the ESP disconnects from the MQTT and reconnects. I checked the log from cloud and I got this data ...
1
vote
1answer
2k views

ESP8266 deep sleep and MQTT

I am working on a project were I am putting my board into deep sleep mode, and it wakes up with an interrupt from a sensor. When it wakes from deep sleep I would like to send a message to my MQTT ...
0
votes
0answers
362 views

Arduino and using a SSL secured mqtt broker

I'm looking for a library helping me to connect from an Arduino to a MQTT Broker. Of course I want to secure the connection via TLS/SSL. The "physical" connection is established via a SIM800 module. ...
0
votes
1answer
276 views

MQTT - Can lastwill be sent to multiple topics?

I'm using an ESP8266 as an IOT device, with MQTT to send status messages. Each device have its own availability topic, to state its online or offline state ( needed for Home Assistant indication on ...
0
votes
2answers
431 views

Mosquitto TLS over WifiMulti on ESP8266

With these few lines I am able to attach my certificate, tell it to WifiClientSecure the certificate, start the wifi as well as the mosquito pubsubclient: WiFiClientSecure espClient; WiFi.begin(ssid, ...
0
votes
1answer
72 views

How can I call the constructor of a Class after it called once? [closed]

I have a problem with Classes. I have a bunch of code, that code is uses Adafruit MQTT FONA library. I call the Class for make new Instance and Connect to specified server with this code; ...
0
votes
2answers
368 views

Using MQTT to send time stamp - to Arduino

In previous question in this forum - I asked about updating clock on an ESP8266, using MQTT broker to send a time stamp on demand, in following manner: 1) ESP8266 sends a publish containing the ...
1
vote
1answer
428 views

Use MQTT to update internal clock

I write code to upload to ESP8266. I wish to use time stamp in order to log events. I found an NTP sketch, I can work with ( since it has a wifi connection ), but I wish to keep my code as simple as ...
0
votes
1answer
136 views

Arduino Uno - MQTT message using PUBSUB on ESP8266

I'm trying to write code involving MQTT messages to operate an ESP8266 relay ( a Sonoff device ), using PubSub library. For some, unknown for me, reason - messages larger than 99 chars are not sent. ...
0
votes
1answer
1k views

ESP8266 fail to connect MQTT broker

I am using NodeMCU dev board with ESP8266 WIFI. Every time I try to connect to my local broker it returns this error: failed, rc=-2 try again in 5 seconds I am using Ubuntu 18.04, my local brokers ...
0
votes
1answer
382 views

Unable to Configure MQTT Client ID using Adafruit MQTT Library

I am utilizing the MQTT library that Adafruit has created, located here, and the library itself works wonderfully - however I am finding myself unable to edit the Client ID or configure the PINGRESP. ...
0
votes
1answer
167 views

String & Char concatenations

A newbie in Arduino- and I'm trying to concatenate string and chars ( well in python it is quite different ). I'm trying to post a MQTT message- constructed following format to the client.publish(...
2
votes
2answers
2k views

MQTT over serial

I'm planning to build a 32 relay IOT node next to my Raspberry Pi. The relays will be controlled by an Arduino Mega 2560. The Pi will run Home Assistant and Mosquitto so I would prefer to communicate ...
1
vote
2answers
762 views

MQTT bridging with Arduino and ESP8266 - What software should I use?

Sorry for the vagueness in my question, I am just looking for ideas to point me in the correct direction please... I wish to connect many (read: 20+) different sensors to a local wifi network and ...
0
votes
0answers
475 views

Soft WDT with HX711 and PubSubClient libraries

I'm using NodeMCU 0.9 My sketch crashes if the following 2 include are present in the sketch: #include <PubSubClient.h> #include <HX711.h> I obtain a Soft WDT reset If I do not use ...
0
votes
1answer
1k views

MQTT not working on ESP8266 (Nodemcu 0.9)

I'm trying to use NodeMCU on my ESP8266 (NodeMCU 0.9) but the board keep crashing and I don't understand why. I tested the mqtt broker using command line and it works perfectly, so I can suppose that ...
1
vote
1answer
859 views

ESP8266 MQTT client error

#include <PubSubClient.h> #include <ESP8266WiFi.h> //EDIT THESE LINES TO MATCH YOUR SETUP #define MQTT_SERVER "YOUR.MQTT.SERVER.IP" const char* ssid = "YOUR_SSID"; const char* password = "...
0
votes
1answer
990 views

Arduino MQTT Bluetooth

Is there a library to use MQTT with a bluetooth module (HC-06) instead of WiFi? If not is there a similar ready for use implementation of a publisher subscriber pattern available?
-2
votes
1answer
405 views

Using ESP8266 without separately programming

Can I use an ESP8266 module with an Arduino Mega using some kind of library without programming the ESP8266 separately? I want to sent messages to a Mosquitto Broker in a Raspberry pi using Arduino ...