-->
Page 1 of 1

Help with IoT Code (Noob)

PostPosted: Wed Sep 09, 2015 9:30 am
by Release12
Hi everyone,

I am new to the arduino/esp8266 world and am planning on building a home automation system (eventually). At the present time I am trying to learn and build little sensors so I can understand everything better. Please find attached some code that I am having trouble with, it is meant to post some information to EasyIoT to be graphed. However it returns error 404 and I am not sure why. I was hoping someone may be able to give me some insight and assistance on the matter.

Any help would be greatly appreciated as I am finding it hard to get any help on any forum!

#define EIOT_USERNAME "admin"
#define EIOT_PASSWORD "test"
#define EIOT_IP_ADDRESS "10.0.0.113"
#define EIOT_PORT 80
#define EIOT_NODE "N13S0"

#define REPORT_INTERVAL 30 // in sec


#define USER_PWD_LEN 40
char unameenc[USER_PWD_LEN];
int test;


client.print(String("POST ") + url + " HTTP/1.1\r\n" +
"Host: " + String(EIOT_IP_ADDRESS) + "\r\n" +
"Connection: close\r\n" +
"Authorization: Basic " + unameenc + " \r\n" +
"Content-Length: 0\r\n" +
"\r\n");

Cheers,
Scott

Re: Help with IoT Code (Noob)

PostPosted: Thu Sep 10, 2015 1:27 pm
by PaulRB
Hi Scott,

You must post all your code. There are a dozen things that could be missing based on those lines you posted, we can't tell. Always use code tags (the </> icon) when posting your code.

Have you looked at the example that comes with the esp boards? File-->Examples-->ESP8266WiFi-->WifiClient ?

Paul

Re: Help with IoT Code (Noob)

PostPosted: Sat Sep 26, 2015 10:52 am
by Release12
Hi Paul,

Thanks for the reply and sorry for my late one. I didn't see the WiFi Client example so I am just playing with that now. If I any trouble I will post my code up as you have described. I sincerely appreciate the simple advice.

Cheers,
Scott

Re: Help with IoT Code (Noob)

PostPosted: Sat Sep 26, 2015 3:36 pm
by eduperez
An error code 404 means that the server did not find the page you where requesting; in your code, that page is the value of the "url" variable, whose definition is outside the code that you posted.