Comments (2)
Hrm I can't repro this with the mosquitto test server (http://test.mosquitto.org/). Here's the auth configuration I was using for the sketch:
/************************* Adafruit.io Setup *********************************/
#define AIO_SERVER "test.mosquitto.org"
#define AIO_SERVERPORT 1883
#define AIO_USERNAME ""
#define AIO_KEY ""
And the feed config (slight change to add my name/a unique value to the front of the feed so nothing conflicts with it on the test server):
// Setup a feed called 'photocell' for publishing.
// Notice MQTT paths for AIO follow the form: <username>/feeds/<feedname>
const char PHOTOCELL_FEED[] PROGMEM = AIO_USERNAME "tdicola/feeds/photocell";
Adafruit_MQTT_Publish photocell = Adafruit_MQTT_Publish(&mqtt, PHOTOCELL_FEED);
// Setup a feed called 'onoff' for subscribing to changes.
const char ONOFF_FEED[] PROGMEM = AIO_USERNAME "tdicola/feeds/onoff";
Adafruit_MQTT_Subscribe onoffbutton = Adafruit_MQTT_Subscribe(&mqtt, ONOFF_FEED);
I let it connect to the mosquitto test server, then using this Paho MQTT python library (https://pypi.python.org/pypi/paho-mqtt) code on another machine I published a message to the 'tdicola/feeds/onoff' feed that the sketch is listening to. Here's the code I was using:
import paho.mqtt.publish as publish
publish.single('tdicola/feeds/onoff', payload='ON', hostname='test.mosquitto.org', port=1883)
print 'Sent message!'
In the serial output I only see one message received:
Sending photocell val 249...OK!
Got: ON
Sending photocell val 250...OK!
I'm curious how are you publishing messages when testing on other brokers--could it be sending two messages?
For Adafruit IO specifically though it does look like right now one change, like pressing a toggle switch on a dashboard, can generate two events. It's something being looked at to simplify and only generate one message, but for now there could be duplicates since it's QOS 0.
For other brokers though if you send one message and receive two responses with the library it does seem unexpected. Let me know if you have more details on a repro example and I can try it too. Thanks!
from adafruit_mqtt_library.
the duplicate message issue was fixed with io.adafruit.com, so i'm going to close this one
from adafruit_mqtt_library.
Related Issues (20)
- How to use to set callback to a class member function ? HOT 1
- Message length limit when publishing HOT 5
- Dynamically Assigning Adafruit IO credentials to Adafruit MQTT object
- Client disconected due protocol error when counting PUBLISH packets from 0 HOT 6
- connection closed: Error: read ECONNRESET
- packet_id_counter incrementing even if packet is dropped
- ESP32 won't reconnect to wifi after disconnecting HOT 1
- Support for FONA 3G cellular card HOT 1
- In several minitues my device always disconnect but connect back immediately HOT 1
- Feature Request: Add functionality for the Arduino Protenta Pro Series of boards HOT 2
- Connectivity issue when using broker on local IP HOT 2
- retain breaks old code - wippersnapper CI builds HOT 5
- Silent Limit on the number of subscribed topics, callback ignored HOT 1
- Mqtt port issue . Not recognizing from config file.
- [ESP32] MQTT Payload not getting triggered only when the payload is exactly 104 and 105 characters?!?
- Dual band wifi connection issue with esp32
- Won't Complie on ESP32 HOT 1
- ESP32 expect a WDT, but none is configured
- Connection failure occurs when the connection length is greater than 128
- Overzealous library dependencies HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from adafruit_mqtt_library.