Your new topic does not fit any of the above??? Check first. Then post here. Thanks.

Moderator: igrr

User avatar
By Release12
#28703 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
User avatar
By PaulRB
#28817 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
User avatar
By Release12
#29929 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
User avatar
By eduperez
#29941 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.