-
Notifications
You must be signed in to change notification settings - Fork 38
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Unable to Connect #1
Comments
Which version of the esp8266/arduino code are you using? When I was testing this it was prior to the 2.4.0 release, I did notice once that with the 2.4.0 code I needed a delay after the pubSubClient.connect, otherwise it failed, but I've not had time to debug what was going on. Try adding delay(1000) after that line? |
Hi Anthony, I am using Arduino 1.8.3 and this esp8266 core https://github.com/esp8266/Arduino. There is no pubSubClient.connect, but there is a pubSubCheckConnect() so I added the delay(1000) on line 108 after this call, but it still does not connect. Below is the code that I am using... I think that your code offers a great way to enable AWS MQTT access, it would be great if I could get it to work for me. I have also provided the errors on the console. BTW I will also be testing on ESP32. This will use WiFi.h as it does not support ESP8266WiFi.h. /* ESP8266 AWS IoT
const char* ssid = "VM575052-2G"; const char* awsEndpoint = "akdo7b9q1mcdu.iot.eu-west-1.amazonaws.com"; // For the two certificate strings below paste in the text of your AWS // xxxxxxxxxx-certificate.pem.crt // xxxxxxxxxx-private.pem.key WiFiClientSecure wiFiClient; void setup() { Serial.print("Connecting to "); Serial.print(ssid); uint8_t binaryCert[certificatePemCrt.length()]; uint8_t binaryPrivate[privatePemKey.length()]; unsigned long lastPublish; void loop() { pubSubCheckConnect(); if (millis() - lastPublish > 10000) { void msgReceived(char* topic, byte* payload, unsigned int length) { void pubSubCheckConnect() { int b64decode(String b64Text, uint8_t* output) { ---------------------errors in console------------------------ ctx: cont
ets Jan 8 2013,rst cause:2, boot mode:(3,5) load 0x4010f000, len 1384, room 16 |
I meant add the delay here: https://github.com/HarringayMakerSpace/awsiot/blob/master/Esp8266AWSIoTExample/Esp8266AWSIoTExample.ino#L131 |
Ahh, sorry - I have changed the correct line but still unable to connect. The only difference is that the it juts keeps trying to connect. Is there anything else I can try? Do I need to name ESPthing to the name of my device? void pubSubCheckConnect() { ESP8266 AWS IoT Example |
I will go try it with Arduino 1.8.3 and the latest esp8266/arduino 2.4.0 code... |
I've tried this again with Arduino 1.8.3 and the latest esp8266/arduino 2.4.0 code, and the only other version related things is the PubSubClient and for that I'm using Nick O'Leary's version 2.6.0. It works for me and connects to AWS and publishes messages. The delay doesn't seem to matter now for me, though it definitely did before, and I put it here:
Have you definitely got the awsEndpoint and the two certificates correct? Send me your sketch if you like and I can try it here - [email protected] |
Hi, I am using Nick O'Leary's PubSubClient, installed via Arduino Board manager. I would be grateful if you could try my sketch and let me know te outcome. |
I've tried yours (the only update to the wifi ssid/password) and it seems to work ok for me. Well it connects ok and publishes a message, anyway. It does appear to always disconnect after doing the publish which is a bit strange. Can you look in your AWS IoT console and see if its showing successful connects and publishes? |
Hi, I am getting the developer at Nodecm.IO to check on AWS. There will be a delay whilst I receive a response, but this looks promising. I will get back to you hopefully on Monday, have a great weekend and many thanks for helping me with this. |
Actually I am getting the same. The sketch is sending 1 message and then disconnects, can this be fixed? I am fairly sure that the 1 message is arriving, but I should know for sure by Monday. ESP8266 AWS IoT Example |
When you say "The sketch is sending 1 message and then disconnects" - does it successfully reconnect and keep sending? When I try your code it does disconnect after each publish but then reconnects, and does that for each publish. Odd that it disconnects each time though, it doesn't do that with my AWS devices. |
I've also just put up this code rewritten for an ESP32 - https://github.com/HarringayMakerSpace/awsiot/blob/master/Esp32AWSIoTExample/Esp32AWSIoTExample.ino Do you also have an ESP32 to try? |
Hi Anthony, on my ESP8266 it disconnects and does not reconnect. I will try the new code on my ESP32 and let you know... |
I've been trying to debug this further and I think it is AWS that is doing the disconnect. It would be interesting to see what your device policy looks like on the AWS ioT system, can you get that? The simple policy I have for testing is:
If yours is more restrictive that could possibly be causing the disconnects. |
Hi, did you get to try this yet? |
Hi, many apologies for the delay. I thought I had an ESP32 but I did not. I ordered one and it arrived this morning so I have been able try to upload your code, together with my certificates. I am unable to obtain any connection... ESP32 AWS IoT Example In terms of the policy I will make some enquires and get back to you about the policy. Just for completeness I have povided the code that I am using below should you wish to test. I am assuming that you are able to connect using this code and your certificates? /* ESP32 AWS IoT
const char* ssid = "ssid"; const char* awsEndpoint = "akdo7b9q1mcdu.iot.eu-west-1.amazonaws.com"; // Update the two certificate strings below. Paste in the text of your AWS // xxxxxxxxxx-certificate.pem.crt // xxxxxxxxxx-private.pem.key /* root CA can be downloaded in: WiFiClientSecure wiFiClient; void setup() { Serial.print("Connecting to "); Serial.print(ssid); wiFiClient.setCACert(rootCA); unsigned long lastPublish; void loop() { pubSubCheckConnect(); if (millis() - lastPublish > 10000) { void msgReceived(char* topic, byte* payload, unsigned int length) { void pubSubCheckConnect() { |
I just tried that code and it connects ok for my device. Notice though, that you have the certificate and private key not quite right in the above code. There is a subtle difference in how you define these on the ESP32 compared to the ESP8266 - the BEGIN/END CERTIFICATE strings must be included in the ESP32 but are commented out in the ESP8266. See https://github.com/HarringayMakerSpace/awsiot/blob/master/Esp32AWSIoTExample/Esp32AWSIoTExample.ino#L22-L25 compared to https://github.com/HarringayMakerSpace/awsiot/blob/master/Esp8266AWSIoTExample/Esp8266AWSIoTExample.ino#L29-L31 |
Hi Anothny,
Whoops, sorry I forgot to format all the certificates, now it your code is
working on my ESP32, see below;
ESP32 AWS IoT Example
SDK version: v3.1-dev-239-g1c3dd23f-dirty
Connecting to VM575052-2G, WiFi connected, IP address: 192.168.0.10
PubSubClient connecting to: akdo7b9q1mcdu.iot.eu-west-1.amazonaws.com.
connected
Published, rc=OK: Hello from ESP8266: 1
PubSubClient connecting to: akdo7b9q1mcdu.iot.eu-west-1.amazonaws.com.
connected
Published, rc=OK: Hello from ESP8266: 2
Published, rc=FAILED: Hello from ESP8266: 3
PubSubClient connecting to: akdo7b9q1mcdu.iot.eu-west-1.amazonaws.com.
connected
Published, rc=OK: Hello from ESP8266: 4
PubSubClient connecting to: akdo7b9q1mcdu.iot.eu-west-1.amazonaws.com.
Many, many thanks.
Anwar
…On 3 February 2018 at 11:57, torntrousers ***@***.***> wrote:
I just tried that code and it connects ok for my device. Notice though,
that you have the certificate and private key not quite right in the above
code. There is a subtle difference in how you define these on the ESP32
compared to the ESP8266 - the BEGIN/END CERTIFICATE strings *must be*
included in the ESP32 but are commented out in the ESP8266. See
https://github.com/HarringayMakerSpace/awsiot/blob/master/
Esp32AWSIoTExample/Esp32AWSIoTExample.ino#L22-L25 compared to
https://github.com/HarringayMakerSpace/awsiot/blob/master/
Esp8266AWSIoTExample/Esp8266AWSIoTExample.ino#L29-L31
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
<#1 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AIAcZ7raKugyAVXLPIdGTLCTYf1-ZE6uks5tREm5gaJpZM4RsuQv>
.
|
Great. But you still sometimes get a fail and reconnect which you can see in the line: Published, rc=FAILED: Hello from ESP8266: 3 I think thats the same as you get with your device on the ESP8266. Its odd, and I don't see those fails with my device but I do when I try your one. I've tried yours on the ESP8266 with debug on and it just shows it receiving a disconnect from AWS, I don't know if you can contact AWS and see if they can see from their logs why it disconnects. |
Hi Anthony,
Thanks for this - I will try and get into contact with AWS and find a
reason/solution. If/When I do I will let you know.
Kind Regards
Anwar
…On 3 February 2018 at 13:05, torntrousers ***@***.***> wrote:
Great. But you still smetimes get a fail and reconnect which you can see
in the line:
Published, rc=FAILED: Hello from ESP8266: 3
PubSubClient connecting to: akdo7b9q1mcdu.iot.eu-west-1.amazonaws.com.
I think thats the same as you get with your device on the ESP8266. Its
odd, and I don't see those fails with my device but I do when I try your
one. I've tried yours on the ESP8266 with debug on and it just shows it
receiving a disconnect from AWS, I don't know if you can contact AWS and
see if they can see from their logs why it disconnects.
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
<#1 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AIAcZ6YGf0o4RLnk1Q3_d5MNSh5mReVKks5tRFmOgaJpZM4RsuQv>
.
|
Hi, Connecting to Amped_TAPR2_2.4, WiFi connected, IP address: 192.168.3.18 I am using the PubSubClient v 2.6.0 by Nick O'Leary on Arduino IDE v 1.8.3 I got the AWS endpoint from the following: And downloaded the certificate and private key directly from Amazon. My thing is called: Are there some other settings that I must set on the AWS side to make this work. Would you please be able to look at my code and see what is wrong? Thanks, |
One thing that often gets left off is attaching a policy to the device in AWS IoT that permits the connection. Something like:
|
Thank you. I created and attached the policy to the certificate. But it still will not connect.
Do I need to specify the client ID or anything else on AWS side? Best, |
Can you run my code on your board?
|
Same issue here facing disconnect problem.. I built my own mqtt broker and it works great but when I use AWS iot I'm having disconnects after publishing.. It is not usuable at all.. |
I've tried this again and it still works ok for me. Check your AWS endpoint, certificates and policy. |
I had the same issue with @anwarbashir I can connect to aws endpoint but when I publish it disconnects and reconnect again. My policy is like this and this policy was added to my cert and my thing..
By the way my way of loading the certs are via file system I converted it to .der format.. In my own mqtt broker it works 100% .. The only difference in our code is, in your code you made the client certs hardcoded in the code as string.. I don't think there is a difference if I load it via file system.. I think there is something that AWS needed we need to do to make it stable.. |
Could you run try running with debug on and add what that outputs here? You turn on logging from the Arduino IDE tools menu Tools -> Debug port: Serial, and Tools -> Debug Level: SSL+TLS_MEM+HTTP_CLIENT |
Hi below are the logs..
Look at this part the before and after.. why 1982? :)
|
I see. Any chance you can get the logs from the AWS IoT side - https://docs.aws.amazon.com/iot/latest/developerguide/cloud-watch-logs.html? |
I suspect this topic is too old now, but I'm also trying to connect with an ESP8266, and I just can't ever get past "PubSubClient connecting to:..." It just goes on and on forever. I have put my AWS endpoint in, and I can tell it's hitting it correctly because if I change any of the endpoint, the connection loop speeds up. It seems like it has to be a problem with the certificates, but I have tried every variant of populating the ESP8266 example with my certs and it just doesn't change anything. I got it to work with this example, but I find that to be a really goofy example because you need to use OpenSSL to convert your certificates and then load them with a special 8266 uploader tool. Why is this 8266 example never connecting? |
Which version of the board manager are you using?
…Sent from my iPhone
On Feb 6, 2022, at 2:36 PM, mtuee ***@***.***> wrote:
I suspect this topic is too old now, but I'm also trying to connect with an ESP8266, and I just can't ever get past "PubSubClient connecting to:..." It just goes on and on forever. I have put my AWS endpoint in, and I can tell it's hitting it correctly because if I change any of the endpoint, the connection loop speeds up. It seems like it has to be a problem with the certificates, but I have tried every variant of populating the ESP8266 example with my certs and it just doesn't change anything.
I got it to work with this example, but I find that to be a really goofy example because you need to use OpenSSL to convert your certificates and then load them with a special 8266 uploader tool.
Why is this 8266 example never connecting?
—
Reply to this email directly, view it on GitHub, or unsubscribe.
Triage notifications on the go with GitHub Mobile for iOS or Android.
You are receiving this because you are subscribed to this thread.
|
Also you dont need to convert your certs to DERs if thats what you're trying
…Sent from my iPhone
On Feb 6, 2022, at 2:51 PM, Steve B ***@***.***> wrote:
Which version of the board manager are you using?
Sent from my iPhone
>> On Feb 6, 2022, at 2:36 PM, mtuee ***@***.***> wrote:
>>
>
> I suspect this topic is too old now, but I'm also trying to connect with an ESP8266, and I just can't ever get past "PubSubClient connecting to:..." It just goes on and on forever. I have put my AWS endpoint in, and I can tell it's hitting it correctly because if I change any of the endpoint, the connection loop speeds up. It seems like it has to be a problem with the certificates, but I have tried every variant of populating the ESP8266 example with my certs and it just doesn't change anything.
>
> I got it to work with this example, but I find that to be a really goofy example because you need to use OpenSSL to convert your certificates and then load them with a special 8266 uploader tool.
>
> Why is this 8266 example never connecting?
>
> —
> Reply to this email directly, view it on GitHub, or unsubscribe.
> Triage notifications on the go with GitHub Mobile for iOS or Android.
> You are receiving this because you are subscribed to this thread.
|
Wow, that was an incredibly fast response - thank you! I was using the
2.6.2 esp8266. I just upgraded to 3.0.2, and it appears to be working
now. I fought with this for several hours so it had to have been the Board
Manager needed an update. Thank you!!
On Sun, Feb 6, 2022 at 4:53 PM Stephen Borsay ***@***.***>
wrote:
… Also you dont need to convert your certs to DERs if thats what you're
trying
Sent from my iPhone
> On Feb 6, 2022, at 2:51 PM, Steve B ***@***.***> wrote:
>
> Which version of the board manager are you using?
>
> Sent from my iPhone
>
>>> On Feb 6, 2022, at 2:36 PM, mtuee ***@***.***> wrote:
>>>
>>
>> I suspect this topic is too old now, but I'm also trying to connect
with an ESP8266, and I just can't ever get past "PubSubClient connecting
to:..." It just goes on and on forever. I have put my AWS endpoint in, and
I can tell it's hitting it correctly because if I change any of the
endpoint, the connection loop speeds up. It seems like it has to be a
problem with the certificates, but I have tried every variant of populating
the ESP8266 example with my certs and it just doesn't change anything.
>>
>> I got it to work with this example, but I find that to be a really
goofy example because you need to use OpenSSL to convert your certificates
and then load them with a special 8266 uploader tool.
>>
>> Why is this 8266 example never connecting?
>>
>> —
>> Reply to this email directly, view it on GitHub, or unsubscribe.
>> Triage notifications on the go with GitHub Mobile for iOS or Android.
>> You are receiving this because you are subscribed to this thread.
—
Reply to this email directly, view it on GitHub
<#1 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAK5TQHYPONQ3F7I4ERU2R3UZ33WFANCNFSM4ENS4QXQ>
.
Triage notifications on the go with GitHub Mobile for iOS
<https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675>
or Android
<https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub>.
You are receiving this because you commented.Message ID:
***@***.***>
|
Ok no problem. Also you are using an inferior dated example compared to the one on this repo. Using progmem[] into flash memory is better than spiffs and your older example doesn't seem to have a subscription function, so the AWS MQTT broker cant send you messages and thus you cant use shadow state updates from AWS
…Sent from my iPhone
On Feb 6, 2022, at 3:06 PM, mtuee ***@***.***> wrote:
Wow, that was an incredibly fast response - thank you! I was using the
2.6.2 esp8266. I just upgraded to 3.0.2, and it appears to be working
now. I fought with this for several hours so it had to have been the Board
Manager needed an update. Thank you!!
On Sun, Feb 6, 2022 at 4:53 PM Stephen Borsay ***@***.***>
wrote:
> Also you dont need to convert your certs to DERs if thats what you're
> trying
>
> Sent from my iPhone
>
> > On Feb 6, 2022, at 2:51 PM, Steve B ***@***.***> wrote:
> >
> > Which version of the board manager are you using?
> >
> > Sent from my iPhone
> >
> >>> On Feb 6, 2022, at 2:36 PM, mtuee ***@***.***> wrote:
> >>>
> >>
> >> I suspect this topic is too old now, but I'm also trying to connect
> with an ESP8266, and I just can't ever get past "PubSubClient connecting
> to:..." It just goes on and on forever. I have put my AWS endpoint in, and
> I can tell it's hitting it correctly because if I change any of the
> endpoint, the connection loop speeds up. It seems like it has to be a
> problem with the certificates, but I have tried every variant of populating
> the ESP8266 example with my certs and it just doesn't change anything.
> >>
> >> I got it to work with this example, but I find that to be a really
> goofy example because you need to use OpenSSL to convert your certificates
> and then load them with a special 8266 uploader tool.
> >>
> >> Why is this 8266 example never connecting?
> >>
> >> —
> >> Reply to this email directly, view it on GitHub, or unsubscribe.
> >> Triage notifications on the go with GitHub Mobile for iOS or Android.
> >> You are receiving this because you are subscribed to this thread.
>
> —
> Reply to this email directly, view it on GitHub
> <#1 (comment)>,
> or unsubscribe
> <https://github.com/notifications/unsubscribe-auth/AAK5TQHYPONQ3F7I4ERU2R3UZ33WFANCNFSM4ENS4QXQ>
> .
> Triage notifications on the go with GitHub Mobile for iOS
> <https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675>
> or Android
> <https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub>.
>
> You are receiving this because you commented.Message ID:
> ***@***.***>
>
—
Reply to this email directly, view it on GitHub, or unsubscribe.
Triage notifications on the go with GitHub Mobile for iOS or Android.
You are receiving this because you commented.
|
Oh, absolutely. I'm using your example now - previously I couldn't get it
to work so I got the other example working and I kept thinking that it was
a really inferior example for a variety of reasons. Now that I've got
yours working I don't need to look back.
On Sun, Feb 6, 2022 at 5:14 PM Stephen Borsay ***@***.***>
wrote:
… Ok no problem. Also you are using an inferior dated example compared to
the one on this repo. Using progmem[] into flash memory is better than
spiffs and your older example doesn't seem to have a subscription function,
so the AWS MQTT broker cant send you messages and thus you cant use shadow
state updates from AWS
Sent from my iPhone
> On Feb 6, 2022, at 3:06 PM, mtuee ***@***.***> wrote:
>
>
> Wow, that was an incredibly fast response - thank you! I was using the
> 2.6.2 esp8266. I just upgraded to 3.0.2, and it appears to be working
> now. I fought with this for several hours so it had to have been the
Board
> Manager needed an update. Thank you!!
>
> On Sun, Feb 6, 2022 at 4:53 PM Stephen Borsay ***@***.***>
> wrote:
>
> > Also you dont need to convert your certs to DERs if thats what you're
> > trying
> >
> > Sent from my iPhone
> >
> > > On Feb 6, 2022, at 2:51 PM, Steve B ***@***.***> wrote:
> > >
> > > Which version of the board manager are you using?
> > >
> > > Sent from my iPhone
> > >
> > >>> On Feb 6, 2022, at 2:36 PM, mtuee ***@***.***> wrote:
> > >>>
> > >>
> > >> I suspect this topic is too old now, but I'm also trying to connect
> > with an ESP8266, and I just can't ever get past "PubSubClient
connecting
> > to:..." It just goes on and on forever. I have put my AWS endpoint in,
and
> > I can tell it's hitting it correctly because if I change any of the
> > endpoint, the connection loop speeds up. It seems like it has to be a
> > problem with the certificates, but I have tried every variant of
populating
> > the ESP8266 example with my certs and it just doesn't change anything.
> > >>
> > >> I got it to work with this example, but I find that to be a really
> > goofy example because you need to use OpenSSL to convert your
certificates
> > and then load them with a special 8266 uploader tool.
> > >>
> > >> Why is this 8266 example never connecting?
> > >>
> > >> —
> > >> Reply to this email directly, view it on GitHub, or unsubscribe.
> > >> Triage notifications on the go with GitHub Mobile for iOS or
Android.
> > >> You are receiving this because you are subscribed to this thread.
> >
> > —
> > Reply to this email directly, view it on GitHub
> > <
#1 (comment)
>,
> > or unsubscribe
> > <
https://github.com/notifications/unsubscribe-auth/AAK5TQHYPONQ3F7I4ERU2R3UZ33WFANCNFSM4ENS4QXQ
>
> > .
> > Triage notifications on the go with GitHub Mobile for iOS
> > <
https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675
>
> > or Android
> > <
https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub
>.
> >
> > You are receiving this because you commented.Message ID:
> > ***@***.***>
> >
> —
> Reply to this email directly, view it on GitHub, or unsubscribe.
> Triage notifications on the go with GitHub Mobile for iOS or Android.
> You are receiving this because you commented.
—
Reply to this email directly, view it on GitHub
<#1 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAK5TQDWTFSGYHBB7PVWKTDUZ36G7ANCNFSM4ENS4QXQ>
.
Triage notifications on the go with GitHub Mobile for iOS
<https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675>
or Android
<https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub>.
You are receiving this because you commented.Message ID:
***@***.***>
|
Great, it’s not my example but Harringays. I just follow this repo
…Sent from my iPhone
On Feb 6, 2022, at 3:17 PM, mtuee ***@***.***> wrote:
Oh, absolutely. I'm using your example now - previously I couldn't get it
to work so I got the other example working and I kept thinking that it was
a really inferior example for a variety of reasons. Now that I've got
yours working I don't need to look back.
On Sun, Feb 6, 2022 at 5:14 PM Stephen Borsay ***@***.***>
wrote:
> Ok no problem. Also you are using an inferior dated example compared to
> the one on this repo. Using progmem[] into flash memory is better than
> spiffs and your older example doesn't seem to have a subscription function,
> so the AWS MQTT broker cant send you messages and thus you cant use shadow
> state updates from AWS
>
> Sent from my iPhone
>
> > On Feb 6, 2022, at 3:06 PM, mtuee ***@***.***> wrote:
> >
> >
> > Wow, that was an incredibly fast response - thank you! I was using the
> > 2.6.2 esp8266. I just upgraded to 3.0.2, and it appears to be working
> > now. I fought with this for several hours so it had to have been the
> Board
> > Manager needed an update. Thank you!!
> >
> > On Sun, Feb 6, 2022 at 4:53 PM Stephen Borsay ***@***.***>
> > wrote:
> >
> > > Also you dont need to convert your certs to DERs if thats what you're
> > > trying
> > >
> > > Sent from my iPhone
> > >
> > > > On Feb 6, 2022, at 2:51 PM, Steve B ***@***.***> wrote:
> > > >
> > > > Which version of the board manager are you using?
> > > >
> > > > Sent from my iPhone
> > > >
> > > >>> On Feb 6, 2022, at 2:36 PM, mtuee ***@***.***> wrote:
> > > >>>
> > > >>
> > > >> I suspect this topic is too old now, but I'm also trying to connect
> > > with an ESP8266, and I just can't ever get past "PubSubClient
> connecting
> > > to:..." It just goes on and on forever. I have put my AWS endpoint in,
> and
> > > I can tell it's hitting it correctly because if I change any of the
> > > endpoint, the connection loop speeds up. It seems like it has to be a
> > > problem with the certificates, but I have tried every variant of
> populating
> > > the ESP8266 example with my certs and it just doesn't change anything.
> > > >>
> > > >> I got it to work with this example, but I find that to be a really
> > > goofy example because you need to use OpenSSL to convert your
> certificates
> > > and then load them with a special 8266 uploader tool.
> > > >>
> > > >> Why is this 8266 example never connecting?
> > > >>
> > > >> —
> > > >> Reply to this email directly, view it on GitHub, or unsubscribe.
> > > >> Triage notifications on the go with GitHub Mobile for iOS or
> Android.
> > > >> You are receiving this because you are subscribed to this thread.
> > >
> > > —
> > > Reply to this email directly, view it on GitHub
> > > <
> #1 (comment)
> >,
> > > or unsubscribe
> > > <
> https://github.com/notifications/unsubscribe-auth/AAK5TQHYPONQ3F7I4ERU2R3UZ33WFANCNFSM4ENS4QXQ
> >
> > > .
> > > Triage notifications on the go with GitHub Mobile for iOS
> > > <
> https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675
> >
> > > or Android
> > > <
> https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub
> >.
> > >
> > > You are receiving this because you commented.Message ID:
> > > ***@***.***>
> > >
> > —
> > Reply to this email directly, view it on GitHub, or unsubscribe.
> > Triage notifications on the go with GitHub Mobile for iOS or Android.
> > You are receiving this because you commented.
>
> —
> Reply to this email directly, view it on GitHub
> <#1 (comment)>,
> or unsubscribe
> <https://github.com/notifications/unsubscribe-auth/AAK5TQDWTFSGYHBB7PVWKTDUZ36G7ANCNFSM4ENS4QXQ>
> .
> Triage notifications on the go with GitHub Mobile for iOS
> <https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675>
> or Android
> <https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub>.
>
> You are receiving this because you commented.Message ID:
> ***@***.***>
>
—
Reply to this email directly, view it on GitHub, or unsubscribe.
Triage notifications on the go with GitHub Mobile for iOS or Android.
You are receiving this because you commented.
|
You have to be careful with dated examples because how you anchor the certs changed with the board manager after 3.0 on the esp8266. Also a lot of examples use SigV4 credentials which i believe are now universally rejected by the AWS MQTT broker. AWS still has there example up using the “Duckbill” project which i believe is also now inoperable
…Sent from my iPhone
On Feb 6, 2022, at 3:26 PM, Steve B ***@***.***> wrote:
Great, it’s not my example but Harringays. I just follow this repo
Sent from my iPhone
>> On Feb 6, 2022, at 3:17 PM, mtuee ***@***.***> wrote:
>>
>
> Oh, absolutely. I'm using your example now - previously I couldn't get it
> to work so I got the other example working and I kept thinking that it was
> a really inferior example for a variety of reasons. Now that I've got
> yours working I don't need to look back.
>
> On Sun, Feb 6, 2022 at 5:14 PM Stephen Borsay ***@***.***>
> wrote:
>
> > Ok no problem. Also you are using an inferior dated example compared to
> > the one on this repo. Using progmem[] into flash memory is better than
> > spiffs and your older example doesn't seem to have a subscription function,
> > so the AWS MQTT broker cant send you messages and thus you cant use shadow
> > state updates from AWS
> >
> > Sent from my iPhone
> >
> > > On Feb 6, 2022, at 3:06 PM, mtuee ***@***.***> wrote:
> > >
> > >
> > > Wow, that was an incredibly fast response - thank you! I was using the
> > > 2.6.2 esp8266. I just upgraded to 3.0.2, and it appears to be working
> > > now. I fought with this for several hours so it had to have been the
> > Board
> > > Manager needed an update. Thank you!!
> > >
> > > On Sun, Feb 6, 2022 at 4:53 PM Stephen Borsay ***@***.***>
> > > wrote:
> > >
> > > > Also you dont need to convert your certs to DERs if thats what you're
> > > > trying
> > > >
> > > > Sent from my iPhone
> > > >
> > > > > On Feb 6, 2022, at 2:51 PM, Steve B ***@***.***> wrote:
> > > > >
> > > > > Which version of the board manager are you using?
> > > > >
> > > > > Sent from my iPhone
> > > > >
> > > > >>> On Feb 6, 2022, at 2:36 PM, mtuee ***@***.***> wrote:
> > > > >>>
> > > > >>
> > > > >> I suspect this topic is too old now, but I'm also trying to connect
> > > > with an ESP8266, and I just can't ever get past "PubSubClient
> > connecting
> > > > to:..." It just goes on and on forever. I have put my AWS endpoint in,
> > and
> > > > I can tell it's hitting it correctly because if I change any of the
> > > > endpoint, the connection loop speeds up. It seems like it has to be a
> > > > problem with the certificates, but I have tried every variant of
> > populating
> > > > the ESP8266 example with my certs and it just doesn't change anything.
> > > > >>
> > > > >> I got it to work with this example, but I find that to be a really
> > > > goofy example because you need to use OpenSSL to convert your
> > certificates
> > > > and then load them with a special 8266 uploader tool.
> > > > >>
> > > > >> Why is this 8266 example never connecting?
> > > > >>
> > > > >> —
> > > > >> Reply to this email directly, view it on GitHub, or unsubscribe.
> > > > >> Triage notifications on the go with GitHub Mobile for iOS or
> > Android.
> > > > >> You are receiving this because you are subscribed to this thread.
> > > >
> > > > —
> > > > Reply to this email directly, view it on GitHub
> > > > <
> > #1 (comment)
> > >,
> > > > or unsubscribe
> > > > <
> > https://github.com/notifications/unsubscribe-auth/AAK5TQHYPONQ3F7I4ERU2R3UZ33WFANCNFSM4ENS4QXQ
> > >
> > > > .
> > > > Triage notifications on the go with GitHub Mobile for iOS
> > > > <
> > https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675
> > >
> > > > or Android
> > > > <
> > https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub
> > >.
> > > >
> > > > You are receiving this because you commented.Message ID:
> > > > ***@***.***>
> > > >
> > > —
> > > Reply to this email directly, view it on GitHub, or unsubscribe.
> > > Triage notifications on the go with GitHub Mobile for iOS or Android.
> > > You are receiving this because you commented.
> >
> > —
> > Reply to this email directly, view it on GitHub
> > <#1 (comment)>,
> > or unsubscribe
> > <https://github.com/notifications/unsubscribe-auth/AAK5TQDWTFSGYHBB7PVWKTDUZ36G7ANCNFSM4ENS4QXQ>
> > .
> > Triage notifications on the go with GitHub Mobile for iOS
> > <https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675>
> > or Android
> > <https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub>.
> >
> > You are receiving this because you commented.Message ID:
> > ***@***.***>
> >
> —
> Reply to this email directly, view it on GitHub, or unsubscribe.
> Triage notifications on the go with GitHub Mobile for iOS or Android.
> You are receiving this because you commented.
|
I'm happy people still find this example useful. |
Hi, I have followed the instructions and entered the certificate.pem and private.pem and I have formatted as instructed. I am unable to connect. Just wondering do I need to enter the rootCert anywhere or should I be able to connect without it?
The text was updated successfully, but these errors were encountered: