2015-08-13

Hello Ian,

This error means that esp8266 can't establish TCP connection with server. Server refuse connection, esp8266 tries to establish connection with wrong host or some firewall blocks access on the route.
First at all, check if you can open API Url in browser on computer or phone which is connected to the same Wi-Fi network. Just type it in browser address line. Browser should open page with content like:

The DeviceHive RESTful API is now running, please refer to documentation to get the list of available resources.

Api Version: 2.0.0
Server Timestamp: 2015-08-13T19:01:52.142000

for example you can try this url:
http://nn8354.pg.devicehive.com/api
- it will show page above. If something wrong check your internet connection, firewalls, dns servers.

Then check if you correctly typed API Url in ESP terminal. Run 'config' command it should print output like:

Code: $ config
Wi-Fi SSID: LNET
DeviceHive Server: http://nn8354.pg.devicehive.com/api
DeviceHive DeviceId: esp-device

i.e. 'DeviceHive Server' should contains correct scheme and all slashes and dots in right places. And url has to contain domain address(not IP) for playgrounds. Try to ping domain(not IP, without url scheme and path) in ESP8266 terminal. Is it resolving correct IP address? Compare it with
https://toolbox.googleapps.com/apps/dig/
For example:

Code: $ ping nn8354.pg.devicehive.com
Resolving...
Host nn8354.pg.devicehive.com IP is 50.57.84.170
32 bytes received from 50.57.84.170 in 317 ms, icmp_seq = 1
32 bytes received from 50.57.84.170 in 248 ms, icmp_seq = 2
32 bytes received from 50.57.84.170 in 236 ms, icmp_seq = 3
32 bytes received from 50.57.84.170 in 195 ms, icmp_seq = 4
Total sent: 4, received: 4, lost: 0, average time: 249 ms

Succesfull firmware start in debug output looks like:

Code: $ dmesg
Debug output enabled. Press 'q' for exit.
*****************************
Settings successfully loaded from main storage
Initialization complete
WiFi event STAMODE_CONNECTED
WiFi connected, ip: 192.168.0.104
Resolving nn8354.pg.devicehive.com
Host nn8354.pg.devicehive.com ip: 50.57.84.170, using port 80
Info request created, 213/213
Send info request...
Timestamp received 2015-08-13T19:18:07.707000
Poll request created, 276/276
Register request created, 394/394
Send register request...
Successfully register
Send poll request...

Thank you for using DeviceHive!
Nikolay

Statistics: Posted by Nikolay-DH — Thu Aug 13, 2015 2:28 pm

Show more