Compare commits

...

15 Commits

Author SHA1 Message Date
Limor "Ladyada" Fried a4e1ee0133
Merge pull request #110 from abachman/abachman-update-IO-tls-fingerprint
update IO TLS fingerprint
2018-02-05 17:17:02 -05:00
Adam Bachman c25d31f813
update IO TLS fingerprint 2018-02-05 17:08:40 -05:00
ladyada 7fffb1e769 bump fix for winc1500 2018-01-29 14:37:03 -05:00
ladyada f0e97737f7 update to wifi101 library 2018-01-29 14:27:41 -05:00
ladyada 5b25a96d1b typo 2018-01-10 00:27:24 -05:00
ladyada 13854f6487 bump! 2018-01-10 00:26:31 -05:00
Limor "Ladyada" Fried a3f09cfa4c
Merge pull request #107 from jerryneedell/patch-1
Update Adafruit_MQTT_Client.cpp to remove use of min()
2018-01-06 19:46:31 -05:00
jerryneedell 2d384b9697
Update Adafruit_MQTT_Client.cpp to remove use of min()
see https://github.com/adafruit/Adafruit_MQTT_Library/issues/106  for discussion of link failures after upgrading esp8266 community library  BSP to version 2.4.0  --  removing the use of min() allows for successful compilation,link and execution.

Replace call to min() with ternary statement to accomplish same action.
2018-01-06 17:52:40 -05:00
Limor "Ladyada" Fried 974f4b8713
Merge pull request #95 from fpistm/min_STL
Fix min() usage when using STL C++
2017-11-21 10:34:32 -05:00
Frederic.Pillon ce9bcab0b4 Fix min() usage when using STL C++
Signed-off-by: Frederic.Pillon <frederic.pillon@st.com>
2017-10-20 16:15:05 +02:00
Limor "Ladyada" Fried 786ca3fdb2 Merge pull request #87 from per1234/fix-keywords
Use correct separator in keywords.txt
2017-09-02 13:01:03 -04:00
per1234 564f34a84b Use correct separator in keywords.txt
The Arduino IDE requires the use of a tab separator between the name and identifier. Without this tab the keyword is not highlighted.

Reference: https://github.com/arduino/Arduino/wiki/Arduino-IDE-1.5:-Library-specification#keywords
2017-09-02 07:56:17 -07:00
Justin Cooper 8a8c0b1228 Update Adafruit IO SSL Fingerprint 2017-08-15 09:31:22 -05:00
Justin Cooper 1e3fb01778 Remove reference to cc3000 2017-08-10 09:28:15 -05:00
Justin Cooper f5bb4e4e97 Remove references to cc3000 2017-08-10 09:27:05 -05:00
6 changed files with 13 additions and 21 deletions

View File

@ -81,7 +81,7 @@ bool Adafruit_MQTT_Client::sendPacket(uint8_t *buffer, uint16_t len) {
if (client->connected()) {
// send 250 bytes at most at a time, can adjust this later based on Client
uint16_t sendlen = min(len, 250);
uint16_t sendlen = len > 250 ? 250 : len;
//Serial.print("Sending: "); Serial.println(sendlen);
ret = client->write(buffer, sendlen);
DEBUG_PRINT(F("Client sendPacket returned: ")); DEBUG_PRINTLN(ret);

View File

@ -1,7 +1,7 @@
# Adafruit MQTT Library [![Build Status](https://travis-ci.org/adafruit/Adafruit_MQTT_Library.svg?branch=master)](https://travis-ci.org/adafruit/Adafruit_MQTT_Library)
Arduino library for MQTT support, including access to Adafruit IO. Works with
the Adafruit CC3000, FONA, Arduino Yun, ESP8266 Arduino platforms, and anything that supports
the Adafruit FONA, Arduino Yun, ESP8266 Arduino platforms, and anything that supports
Arduino's Client interface (like Ethernet shield).
See included examples for how to use the library to access an MQTT service to
@ -11,10 +11,7 @@ spec but is intended to support enough for QoS 0 and 1 publishing.
Depends on the following other libraries depending on the target platform:
- [Adafruit SleepyDog](https://github.com/adafruit/Adafruit_SleepyDog), watchdog
library used by FONA and CC3000 code for reliability.
- [Adafruit CC3000](https://github.com/adafruit/Adafruit_CC3000_Library), required
for the CC3000 hardware.
library used by FONA code for reliability.
- [Adafruit FONA](https://github.com/adafruit/Adafruit_FONA_Library), required for
the FONA hardware.

View File

@ -40,8 +40,9 @@ WiFiClientSecure client;
// Setup the MQTT client class by passing in the WiFi client and MQTT server and login details.
Adafruit_MQTT_Client mqtt(&client, AIO_SERVER, AIO_SERVERPORT, AIO_USERNAME, AIO_KEY);
// io.adafruit.com SHA1 fingerprint
const char* fingerprint = "26 96 1C 2A 51 07 FD 15 80 96 93 AE F7 32 CE B9 0D 01 55 C4";
// io.adafruit.com SHA1 fingerprint. Current fingerprint can be verified via:
// echo | openssl s_client -connect io.adafruit.com:443 |& openssl x509 -fingerprint -noout
#define AIO_SSL_FINGERPRINT "77 00 54 2D DA E7 D8 03 27 31 23 99 EB 27 DB CB A5 4C 57 18"
/****************************** Feeds ***************************************/

View File

@ -11,8 +11,7 @@
#include <SPI.h>
#include "Adafruit_MQTT.h"
#include "Adafruit_MQTT_Client.h"
#include <Adafruit_WINC1500.h>
#include <WiFi101.h>
/************************* WiFI Setup *****************************/
#define WINC_CS 8
@ -20,8 +19,6 @@
#define WINC_RST 4
#define WINC_EN 2 // or, tie EN to VCC
Adafruit_WINC1500 WiFi(WINC_CS, WINC_IRQ, WINC_RST);
char ssid[] = "yournetwork"; // your network SSID (name)
char pass[] = "yourpassword"; // your network password (use for WPA, or use as key for WEP)
int keyIndex = 0; // your network key Index number (needed only for WEP)
@ -38,7 +35,7 @@ int status = WL_IDLE_STATUS;
/************ Global State (you don't need to change this!) ******************/
//Set up the wifi client
Adafruit_WINC1500Client client;
WiFiClient client;
Adafruit_MQTT_Client mqtt(&client, AIO_SERVER, AIO_SERVERPORT, AIO_USERNAME, AIO_KEY);
@ -60,10 +57,7 @@ Adafruit_MQTT_Subscribe onoffbutton = Adafruit_MQTT_Subscribe(&mqtt, AIO_USERNAM
void setup() {
#ifdef WINC_EN
pinMode(WINC_EN, OUTPUT);
digitalWrite(WINC_EN, HIGH);
#endif
WiFi.setPins(WINC_CS, WINC_IRQ, WINC_RST, WINC_EN);
while (!Serial);
Serial.begin(115200);
@ -154,4 +148,4 @@ void MQTT_connect() {
delay(5000); // wait 5 seconds
}
Serial.println("MQTT Connected!");
}
}

View File

@ -3,7 +3,7 @@ Adafruit_MQTT_CC3000 KEYWORD1
Adafruit_MQTT_FONA KEYWORD1
Adafruit_MQTT_Client KEYWORD1
Adafruit_MQTT_Publish KEYWORD1
Adafruit_MQTT_Subscribe KEYWORD1
Adafruit_MQTT_Subscribe KEYWORD1
connect KEYWORD2
connectErrorString KEYWORD2
disconnect KEYWORD2

View File

@ -1,8 +1,8 @@
name=Adafruit MQTT Library
version=0.17.0
version=0.20.1
author=Adafruit
maintainer=Adafruit <info@adafruit.com>
sentence=MQTT library that supports the CC3000, FONA, ESP8266, Yun, and generic Arduino Client hardware.
sentence=MQTT library that supports the FONA, ESP8266, Yun, and generic Arduino Client hardware.
paragraph=Simple MQTT library that supports the bare minimum to publish and subscribe to topics.
category=Communication
url=https://github.com/adafruit/Adafruit_MQTT_Library