adafruit / Adafruit_MQTT_Library

Arduino library for MQTT support
MIT License
571 stars 292 forks source link

Examples are incorrect #142

Closed Fredfishface closed 5 years ago

Fredfishface commented 5 years ago

The example file contain an error:

In verify Fingerpint

if (!client.connect(host, AIO_SERVERPORT)) { Serial.println("Connection failed. Halting execution."); while(1); }

fails if you don't first set the client fingerprint using:

Serial.printf("Using fingerprint '%s'\n", fingerprint); client.setFingerprint(fingerprint);

ladyada commented 5 years ago

which example?

aandroide commented 5 years ago

@ladyada adafruitio_secure_esp8266 it is the only example that uses fingerprints

ladyada commented 5 years ago

ok thanks @brentru take a look!

aandroide commented 5 years ago

in addition, the key must be changed: const char fingerprint = "AD 4B 64 B3 67 40 B5 FC 0E 51 9B BD 25 E9 7F 88 B6 2A A3 5B"; to: const char fingerprint = "77 00 54 2D DA E7 D8 03 27 31 23 99 EB 27 DB CB A5 4C 57 18";

these 2 changes will make your example work

brentru commented 5 years ago

@aandroide Thanks for the issue. I'll put in a PR to change the fingerprint for Adafruit IO - it does need to be updated.

After changing the fingerprint value, I was not able to replicate the failure you mentioned when running the adafruitio_secure_esp8266 sketch without setting the fingerprint first.

Can you paste the code you're running and the output from the serial monitor?

brentru commented 5 years ago

Fixed in master, closing...