-
Notifications
You must be signed in to change notification settings - Fork 76
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
PubSub Not working related to issue #39 #47
Comments
Thank you for your interest in AWS IoT.
This means there was a DNS resolution failure. This can either be caused by an issue with your network, network misconfiguration on the device, or using an invalid AWS IoT dataplane endpoint. I would start by verifying that you can ping a server external to your network via hostname, and then validate your IoT endpoint hostname (it'll be something.iot.region.amazonaws.com and specific to your account) |
Firstly, thank you very much for the reply. I have realised that I have used the arn number rather than the end point in the command line. I had amended the end point but still I got an error that said - 'AWSIoTPythonSDK.core.protocol.mqttCore - DEBUG - Disconnect result code 1'. I have also amended the end point in the sketch via aws_iot_config.h with the same error output - Setup failed However, when I viewed from the AWS IoT dashboard, I saw a connection. This connection come from running the arduino sketch. Any idea what is the cause ? Thank you again. |
Hi @satay99 , Thank you very much for providing the information. Can you attach the IoT policy that is associated with your certificate? If we are able to see the incoming connection on the dashboard and still experience connection failure, it might be caused by some authorization issues. Thanks, |
Thank you again for the reply. This is the policy :- |
Hi @satay99 , Thank you very much for providing the information. The policy itself looks fine. Can you double check if the policy is attached to the certificate you are using? In your AWS IoT Console -> Security -> Policies, you should be able to find the association like shown below: In the meantime, I did a quick experiment running the sample using a certificate without any policy attached to it and got the following output:
Is it by any chance similar to what you saw when you were experiencing the issue? Thanks, |
Thank you very much for the reply. You were right that the certificate is not associated with the policy. This seems to solve the problem. Running the basicPubSub.py file directly from the terminal and connection was made. However, running using the sketch BasicPubSub.ino failed with the same error message like before : Setup failed ! Checked the aws_iot_config.h, all the certificates' name and end point were all correct. What could be the possible error ? |
Hi @satay99 , Thank you for providing the information. From the previous posts, we were able to correctly configure the credentials and use them to successfully connect to AWS IoT. For the error code "-5", it means that the serial1 communication is having trouble between ATmega chip and AR9331 chip. You can try the following:
Thanks, |
Thank you very much again for the reply. Tried the following as suggested (please let me know if I did it wrong) :-
There is no printout from the serial terminal of the arduino IDE and get the same message as 'setup failed -5'. Where did it go wrong ? |
Hi @satay99 , Sorry that the suggestion does not work for you. If you cannot see any output coming back from the embedded Linux, it means that the serial1 connection in between is not working properly. You can try the following things:
Hope the above helps. Liusu |
Thank you very much for the reply. I had run the YunSerialTerminal and it works as it should be. I could change the baud rate as indicated in the YunSerialTerminal sketch. I had also reset the board by pressing the "YÚN RST" reset button. It is not working either. Any idea ? |
Trying to debug the error and find out that rw_buf is empty. By the way what is the expected return type of this command : exec_cmd(CMD_CHECK_LINUX_LIVE, true, false); Thanks in advance. |
Hi @satay99 ,
Thanks, |
Thank you Liusu. When I run the command 'uname' on the Linux terminal, it returns "Linux". Somehow serial1 connection is not working. |
Hi @satay99 , Can you try the following?
Detailed info about step2 can be found at the Arduino Yun Guide: https://www.arduino.cc/en/Guide/ArduinoYun#toc12 Thanks, |
Thank you again for the reply. I had tried to reset the Yun earlier twice but the result is the same. I will try with a new unit and see if it was a hardware problem and keep you updated. |
Hi @satay99 , |
I had tried the procedure layout as per issue #39. However, I still encountered the same issue as setup failed (-5). Had run the YunSerialTerminal example and still got the same result. Checked the certificates, keys and policies and they are OK.
Connect to Yun via terminal and run the python program directly (basicPubSub.py) and got a return error of [Errno -2] Name or service not known.
Any help will be appreciated.
The text was updated successfully, but these errors were encountered: