@jotathebest Thanks a lot for going through it.I changed the server name.
I also made a few changes in the POST section so that it matches the format in the Ubidots API example section.The changes I made are as follows:-
But now the output in the Serial monitor is something like this
Module Reset
Connected
Cannot connect to Wifi
Cannot connect to Wifi
Sending…
Packet sent
+IPD,311:HTTP/1.1 400 BAD REQUEST
Server:nginx
Date://date and time
Content-Type: text/html
Content-Length:166
Connection: close
400 Bad Request
400 Bad Request
nginx
CLOSED
Sending…
Packet sent
+IPD…and the same thing continues
Also,the value is still not posted in the Ubidots variable.
Are the content length and value ok?
@jotathebest Thanks a lot again for the info. However the problem still persists.
Do the spaces in the POST format also matter? Also, is there anyway I can know if my POST format is correct by posting it in my web browser?
I’ll keep trying.
Thanks a lot.
Hello @Sushii, spaces matters like carriage returns and lines feed, the formatted string that I sent you takes care of that so I believe that your issue can be on your hardware side.
@jotathebest I actually tried the library a few days ago but I think theres some problem with the library and that it hasn’t been updated.Even if it has I doubt it has been updated for Arduino Nano.
You also mentioned that the problem could lie in the hardware.Could it be because I’m using the SoftwareSerial (ports 4 and 5) of the Arduino Nano?
I also checked the translate service.However,I don’t know how I am supposed to implement the url,port and payload in the program.
Thanks a lot for all the help.
Hello,@jotathebest I did try the library.After a number of errors in downloading the library I managed to succeed but there was an error in CIPMODE.
I discarded this method and took your advice and used hurl.it(which was shown in the video tutorial) to test the JSON dictionary.
Apparently,my url was wrong.So I used the following url
String url=" /api/v1.6/devices/{LABEL_DEVICE}/?token={TOKEN}";
and used the following format for POST
String value ="{“value”: “35.5”}";
Hi, could you say me how did you do the request and which is the server? I’m trying to do this but I don’t get the propperly results. In the serial monitor appear like the request was send, but when I check my Ubidots, nothing change.
My string is this:
POST /api/v1.6/devices/arduino_ethernet/?token=A1E-Hmk2EbtdckW7sVBiqkz4erwo3DNn2 HTTP/1.1
Host: things.ubidots.com
Content-Type: application/json
Content-Length: 13
Are you using an Arduino board along with the ESP 8266 to send data to Ubidots?
If so,then kindly refer to the first post in this topic.I have used that program to post a value in Ubidots.
Also, I suggest you use hurl.it to crosscheck the string that you are using.Often,the error can be as small as the presence of an unwanted space in the URL.