So you're a Noob? Post your questions here until you graduate! Don't be shy.

User avatar
By Sushant Naik
#72344
villTech wrote:checking the linked github will answer your question. :D :D :D


hey thanks for reply,
yes u were right but now i am getting new error, seems common but i cant reach the mistake,

Code: Select all[WS][0][handleWebsocket] clientDisconnect code: 1000
[WS-Client] client disconnected.
[WS-Client] connect wss...
[WS-Client] connected to aphpti0fiyatr.iot.ap-southeast-1.amazonaws.com:443.
[WS-Client][sendHeader] sending header...
[WS-Client][sendHeader] handshake GET /mqtt?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=AKIAI6WQ7UFK4JKZ7YJA%2F20171206%2Fap-southeast-1%2Fiotdevicegateway%2Faws4_request&X-Amz-Date=20171206T160818Z&X-Amz-Expires=86400&X-Amz-SignedHeaders=host&X-Amz-Signature=4d2f49a9417b6d5c7e4d3ea18bd66cae478364d4264c28743228530261863ca1 HTTP/1.1
Host: aphpti0fiyatr.iot.ap-southeast-1.amazonaws.com
Connection: Upgrade
Upgrade: websocket
Sec-WebSocket-Version: 13
Sec-WebSocket-Key: fRHlA9EyWHrEZd5MyxFzIA==
Sec-WebSocket-Protocol: mqtt
Origin: file://
User-Agent: arduino-WebSocket-Client

[write] n: 561 t: 198969
[WS-Client][sendHeader] sending header... Done (308689us).
[WS-Client][handleHeader] RX: HTTP/1.1 101 Switching Protocols
[WS-Client][handleHeader] RX: content-length: 0
[WS-Client][handleHeader] RX: upgrade: websocket
[WS-Client][handleHeader] RX: connection: upgrade
[WS-Client][handleHeader] RX: sec-websocket-accept: aBZ+3tfgYD97yWALj465uQ+0lxY=
[WS-Client][handleHeader] RX: sec-websocket-protocol: mqtt
[WS-Client][handleHeader] RX: access-control-allow-origin: *
[WS-Client][handleHeader] RX: access-control-expose-headers: x-amzn-ErrorMessage
[WS-Client][handleHeader] RX: access-control-expose-headers: x-amzn-RequestId
[WS-Client][handleHeader] RX: access-control-expose-headers: x-amzn-ErrorType
[WS-Client][handleHeader] RX: access-control-expose-headers: Date
[WS-Client][handleHeader] Header read fin.
[WS-Client][handleHeader] Client settings:
[WS-Client][handleHeader]  - cURL: /mqtt?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=AKIAI6WQ7UFK4JKZ7YJA%2F20171206%2Fap-southeast-1%2Fiotdevicegateway%2Faws4_request&X-Amz-Date=20171206T160818Z&X-Amz-Expires=86400&X-Amz-SignedHeaders=host&X-Amz-Signature=4d2f49a9417b6d5c7e4d3ea18bd66cae478364d4264c28743228530261863ca1
[WS-Client][handleHeader]  - cKey: fRHlA9EyWHrEZd5MyxFzIA==
[WS-Client][handleHeader] Server header:
[WS-Client][handleHeader]  - cCode: 101
[WS-Client][handleHeader]  - cIsUpgrade: 1
[WS-Client][handleHeader]  - cIsWebsocket: 1
[WS-Client][handleHeader]  - cAccept: aBZ+3tfgYD97yWALj465uQ+0lxY=
[WS-Client][handleHeader]  - cProtocol: mqtt
[WS-Client][handleHeader]  - cExtensions:
[WS-Client][handleHeader]  - cVersion: 0
[WS-Client][handleHeader]  - cSessionId:
[WS-Client][handleHeader] Websocket connection init done.
[WS][0][headerDone] Header Handling Done (0us).
websocket layer connected
MQTT connecting
[WS][0][sendFrame] ------- send message frame -------
[WS][0][sendFrame] fin: 1 opCode: 2 mask: 1 length: 38 headerToPayload: 0
[WS][0][sendFrame] pack to one TCP package...
[write] n: 44 t: 199450
[WS][0][sendFrame] sending Frame Done (480628us).
[WS][0][handleWebsocketWaitFor] size: 2 cWsRXsize: 0
[readCb] n: 2 t: 199932
[WS][0][handleWebsocketWaitFor][readCb] size: 2 ok: 1
[WS][0][handleWebsocket] ------- read massage frame -------
[WS][0][handleWebsocket] fin: 1 rsv1: 0 rsv2: 0 rsv3 0  opCode: 8
[WS][0][handleWebsocket] mask: 0 payloadLen: 0
[WS][0][handleWebsocket] get ask for close. Code: 1000
[WS][0][handleWebsocket] clientDisconnect code: 1000
[WS][0][sendFrame] ------- send message frame -------
[WS][0][sendFrame] fin: 1 opCode: 8 mask: 0 length: 2 headerToPayload: 0
[WS][0][sendFrame] pack to one TCP package...
[write] n: 4 t: 199975
[write] not connected!
[WS][0][sendFrame] sending Frame Done (20486us).
[WS-Client] client disconnected.
error connection to MQTT server-1
230568 - conn: 5 - (31568)
User avatar
By Sushant Naik
#72345
villTech wrote:checking the linked github will answer your question. :D :D :D

yes i am following the issue comments but getting little help, just trying !! any help will be appreciated

thanks
Sushant
User avatar
By Sushant Naik
#72349
villTech wrote:
villTech wrote:checking the linked github will answer your question. :D :D :D


that is not for you, Sushant

Hi,
i tried new credentials using this example https://github.com/CheapskateProjects/ESP8266AWSIoTDemo here i was able to update SHadow .

when i added same credentials in odelot project it doesnt work,

here are new credentials
char aws_endpoint[] = "aphpti0fiyatr.iot.ap-southeast-1.amazonaws.com";
char aws_key[] = "AKIAI6WQ7UFK4JKZ7YJA";
char aws_secret[] = "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";
char aws_region[] = "ap-southeast-1";
const char* aws_topic = "$aws/things/IOTfl2017/shadow/update";

as in CheapskateProjects,
iotClient.setAWSRegion("ap-southeast-1");
iotClient.setAWSEndpoint("amazonaws.com");
iotClient.setAWSDomain("aphpti0fiyatr.iot.ap-southeast-1.amazonaws.com");
iotClient.setAWSPath("/things/IOTfl2017/shadow");
iotClient.setAWSKeyID("AKIAI6WQ7UFK4JKZ7YJA");
iotClient.setAWSSecretKey("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");


i think i am confused between endpoint and domain, may be that is problem ?
however cheapskateproject resets after particular time, WDT reset.