-
-
Notifications
You must be signed in to change notification settings - Fork 67
not able to connect to AWS IOT #6
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
Comments
Could you try with this example instead? #2 (comment) If I recall correctly I also had some problems with the current example after the most recent commits, let me know if it does solve the issue, in that case the new example should be committed to the repository. |
To help yo understand what is happening, you can turn debug messages on. in the example file, uncomment this line: in the in the Btw, i will commit the new example file. I just was waiting some feedback about the changes. ;-) |
Thanks for the information. I will run the new example today. Have two NodeMCU to test on. I don't have the AWS MQTT configured properly. Can you advise on the AWS Configuration for MQTT? I watched your blog video and I have not configured for an MQTT client on AWS. :-B I have configured with the settings is there something wrong? //AWS IOT config, change these: I have also tried the I keep getting unable to connect to websocket. I've tried a hotspot from my phone with no security and a seperate wireless network specifically for esp8266. |
It's still not working. I suspect esp-aws-sdk library dependencies. I had a build that was compiling but not by using your add these libraries and AWS credentials. When I do that I have dependencies failures in the compile. The version I can get to compile will not connect too web socket. |
The You should set your endpoint as follows:
|
I was using the daniele-salvagni / aws-sdk-esp8266 library to compile. I'm hoping if I can go back to using that and use the correct end point it will work. What errors need to be corrected in the @awslabs library in order to compile? Thanks again for information and timely replies. :) |
Hi! Even I have been getting the same error and I'm using a NodeMCU ESP8266 (Amica). Initially there were some errors while compiling using the aws-sdk-arduino library from @awslabs but I fixed it. Also, I tried using a different wifi connection and it printed "please start sntp first" onto the serial monitor before "error connection to the websocket server". |
Hi, I am a bit busy but I will soon reconfigure all my environment and re-test everything. Initially I was using aws-sdk-arduino from svdgraaf https://github.com/svdgraaf/aws-sdk-arduino then svdgraaf made some changes in the code to do not need his version. That's why I migrated to the awslabs version (I didnt know that there was compilation errors in awslabs version. svdgraaf version compiled without errors, try to use his fork). |
I just started a new environment from scratch (I'm using PlatformIO) with up to date code from every dependency and the ESP8266 Arduino Core 2.2.0. I'm using the SDK from this fork https://github.com/daniele-salvagni/aws-sdk-esp8266 (but also the one from @svdgraaf should work correctly). The example from this repository is working without issues, here is the last part of the output:
I didn't test the latest commits from the Arduino Core though, could it be an introduced bug? @odelot: Yes, aws-sdk-arduino from @awslabs looks to be an abandoned project and the code does not even compile because of some trivial errors and a screwed up merge, that's the reason I started this fork https://github.com/daniele-salvagni/aws-sdk-esp8266 which has now been detached into a standalone repository (Pull Requests would never be accepted and the intentions of the original developers aren't clear). Speaking of the SDK, the current code of The only difference between |
I started using Platform.io my self and will try to reproduce daniele's results. I'm also busy this next week. |
I deleted all libraries and reinstalled arduino 1.6.5r. I then used only the libraries referenced in this thread for the compile. I am now getting... error connection to the websocket server Just finished trying this in platform.io. Platform.io is awesome but I'm still getting the same errors on the SNTP and websocket connection. |
Hi all. I've turned on all debugging output that I could - you can find it in the attachement: putty.txt |
Hi all, sames issue : ... |
Same problem here ... the odd thing is that it did connect at some point (same output as daniele-salvagni from above) but now I only get the following output. It does not even send a header ... 7341 - conn: 1 - (33328) |
Interestingly, I still have a build combination locally that works, still at the same versions that were mentioned before (havent updated since) Regards, On 22 jun. 2016 16:28 +0200, Dom [email protected], wrote:
|
yes ... I tried all available versions of the arduinoWebSockets library ... I started up the same code from yeserday and it works! So either AWS has some mechanism to limit the IoT connection count (quota?) or this is a time-of-the-day kind of bug, Successful connect debug output for completeness: connected with DWR-921-80E2, channel 11 |
See #7 (comment) |
I've tried desperately to get this to work, but continue to run into the same problem as listed above, with AWS returning a 403. I had one successful connection but haven't been able to replicate it, nor determine why. Is there a good next-step if I'm running into the 403 error? I'm confident that my endpoint, key, secret, and region are correct. My configuration:
The Serial Output
|
Two things that might help: |
As for the endpoint case name, I was trying upper-case as @2dom had success with upper. I've switched it back since. One thing that I did note was that the version of ArduinoWebSockets that I got from the Arduino Library manager was older, and did not have the port appended to the host in the handshake. I've pulled down a more recent copy and am trying to compile it (it looks like there's a signature mismatch on one of the methods) |
Hi folks! Anyone can help me with this problem? All keys are right and I couldn´t connect. 9794 - conn: 1 - (31184) |
I've fixed the library to work with the latest version of websockets library (2.0.5) and arduino/esp sdk (2.3.0) use the endpoint in lowercase hope it works for you now ;-) |
Hey there! I'm was working with this code and had the same issues. I'm off this week and opened it up to tackle it. Glad to see the update. I'll give it a shot and let you know! |
Super happy! It works!! I removed all the previous libraries. Reset up the new libraries and TA-DA! Connected the first time. |
please help me on connecting with aws iot services with esp8266 12e. i am using example aws-mqtt-websocket example not able to connect with dashboard of aws iot the code is as follow and the error i get is (please start sntp first ! error connection to the websocket server) `#include <Arduino.h> #include <ESP8266WiFi.h> //AWS //WEBSockets //MQTT PAHO //AWS MQTT Websocket //AWS IOT config, change these: const char* ssid = "NPSE"; //MQTT config WiFiClientSecure espclient; AWSWebSocketClient awsWSclient(1000); IPStack ipstack(awsWSclient); MQTT::Client<IPStack, Countdown, maxMQTTpackageSize, maxMQTTMessageHandlers> *client = NULL; //# of connections //generate random mqtt clientID //count messages arrived //callback to handle mqtt messages
} //connects to websocket layer and mqtt layer
} //subscribe to a mqtt topic //send a message to a mqtt topic void setup_wifi() {
} void setup() {
} void loop() { } |
After following multiple references to this example, I was able to get the basics to work. However, I am also seeing the "please start sntp first !" message on connection. Someone above suggested to "set the time first" but gave no details. The ESP8266 has no rtc, so perhaps this message should simply be ignored???? Nor do not want to load up the 8266 with RTC code. It's necessary for my app. Has anyone worked out the source of this message? |
@joeinaustin I think the "please start sntp first" is a log from the ESP8266 arduino SDK. You can turn the debug off changing this line I think ESP has some kind of RTC emulation, someone can correct me if I am wrong. There are also some functions to use the RTC internal memory to store data between deep sleep restarts. See |
Add this line in setup to solve the SNTP issue: configTime(3 * 3600, 0, "pool.ntp.org", "time.nist.gov"); |
I am still having the Http 403 Forbidden issue during the initial connection :/ I am using the appropriate versions of the various libraries. |
I'm also getting the 403 Forbidden issue during connection to the websocket. Below is my debug output. I verified my keys are right, and I can connect to my "thing" using a AWS generated Python script that's doing MQTT over websockets. I've been trying to get this thing working for 2 weeks with no success and I've combed through all of these comments/forums/suggestions. Any help would be much appreciated!! Here is my configuration:
Here is the output:
|
I am having the same exact issue as ls6777. Any luck? |
@jrkosinski @ls6777 @sh4nnongoh spent all day pulling my hair out on this.. should have tried the fix in a previously closed issue IT WORKS!!!! using arduinoWebSockets v.2.0.5 and arduino/esp sdk 2.3.0 Edit: I have a WeMos D1 mini, so I thought I'd try to swap back to the sdk at https://github.com/wemos/Arduino_D1 |
@teejk I followed all your previous instructions, Using: arduino/esp sdk 2.3.0 Finally i can connect with AWS. However, i can't connect to MQTT this is my Serial OUTPUT ⸮connecting to wifi connected 10738 - conn: 1 - (33416) [WS-Client][sendHeader] sending header... Done (208309us). [WS-Client][sendHeader] sending header... Done (236767us). My board is an Wemos D1 mini Pro. Can you help me? |
@dielume looks like probably IAM permission issues, but you should check what cloudwatch has to say btw if you're seting up a subscribe the docs look out of date, you should use a topic rather than topicfilter in you IAM role... or just add both. This is my IAM for the role... but you should see if it meets your needs { |
@teejk Thanks for your help, |
It looks like the new commit (3caa6da) is working with the current version of arduinoWebSockets (1bd4638) |
Hi! Awesome job on getting the ESP8266 talking with AWS IOT. I have set up a "thing" on my AWS IOT account. I used the credentials created for a single user with AWS IOT privileges, verified the end point path, region and the like via the details output from the AWS IOS console and populate the AWS IOT config variables. I'm using a NodeMCU 0.9(ESP-12 Module), 80MHz, 115200, 4M (3M SPIFFS) for the build option in the IDE. I'm able to get an internet connection via Wifi router but it fails when attempting to connect to AWS. Should I have some other configuration completed in the AWS IOT console? I basically have a single user with iot credentials and then used that to create a thing. Thanks for any help.
Serial console out put...
connected
error connection to the websocket server
error connection to the websocket server
Serial output from the more verbose memleak debug version...
error connection to the websocket server
38923 - conn: 5 - (27216)
error connection to the websocket server
46364 - conn: 6 - (27216)
error connection to the websocket server
53837 - conn: 7 - (27216)
error connection to the websocket server
61294 - conn: 8 - (27216)
The text was updated successfully, but these errors were encountered: