0

Hi 您好,

我根據這篇文章: Ameba Arduino: [RTL8195] 使用Amazon AWS IoT Shadow Service (http://www.amebaiot.com/ameba-arduino-amazon-aws-iot/) 實做 AWS IOT 連線。但是總是無法連上 AWS IOT.

詳細說明如下:

目前已經申請好 AWS 帳號,並根據網頁建立好 'thing', 'policy', 'certificate'

並且也根據 AWS 診斷網頁 (http://docs.aws.amazon.com/iot/latest/developerguide/diagnosing-connectivity-issues.html),執行命令:

openssl s_client -connect <em class="replaceable"><code>custom_endpoint.iot.us-east-1.amazonaws.com:8443 -CAfile CA.pem -cert cert.pem -key privateKey.pem

確認 root CA, certificate, private 都是對的。

程式載入 Ameba,重啟之後,訊息如下:

============

===== Enter Image 2 ====
Attempting to connect to SSID: aSTB
interface 0 is initialized
interface 1 is initialized

Initializing WIFI ...
WIFI initialized

RTL8195A[Driver]: set ssid [aSTB]

RTL8195A[Driver]: start auth to 14:dd:a9:c9:be:50

RTL8195A[Driver]: auth success, start assoc

RTL8195A[Driver]: association success(res=8)

RTL8195A[Driver]: set pairwise key to hw: alg:4(WEP40-1 WEP104-5 TKIP-2 AES-4)

RTL8195A[Driver]: set group key to hw: alg:4(WEP40-1 WEP104-5 TKIP-2 AES-4) keyid:2

Interface 0 IP address : 10.10.10.121

Attempting MQTT connection...
Verify requested for (Depth 2):
ceThis certificate has no flags

Verify requested for (Depth 1):
ceThis certificate has no flags

Verify requested for (Depth 0):
ceThis certificate has no flags
failed, rc=-4 try again in 5 seconds
Attempting MQTT connection...
Verify requested for (Depth 2):
ceThis certificate has no flags

Verify requested for (Depth 1):
ceThis certificate has no flags

Verify requested for (Depth 0):
ceThis certificate has no flags
failed, rc=-4 try again in 5 seconds
Attempting MQTT connection...
Verify requested for (Depth 2):
ceThis certificate has no flags

Verify requested for (Depth 1):
ceThis certificate has no flags

Verify requested for (Depth 0):
ceThis certificate has no flags
failed, rc=-4 try again in 5 seconds
Attempting MQTT connection...
Verify requested for (Depth 2):
ceThis certificate has no flags

Verify requested for (Depth 1):
ceThis certificate has no flags

Verify requested for (Depth 0):
ceThis certificate has no flags

RTL8195A[Driver]: sta recv deauth reason code(7) sta:14:dd:a9:c9:be:50

RTL8195A[Driver]: sta recv deauth reason code(7) sta:14:dd:a9:c9:be:50
ERROR: ssl_handshake ret(-0x4c)
failed, rc=-2 try again in 5 seconds
Attempting MQTT connection...

============

 

主要問題有兩個:

  1. failed, rc=-4 try again in 5 seconds
  2. RTL8195A[Driver]: sta recv deauth reason code(7) sta:14:dd:a9:c9:be:50

關於 "rc=-4" 請問相應的意義?該如何解決?

關於 "sta recv deauth reason code(7) ",看來似乎是 Ameba 與AP斷線,而且再也連不上,而且後續都是 "rc=-2"。這部份又該如何解決?

 

麻煩您了!

Jackie

jackieyeh 回答了