6 votes
Accepted

Arduino Library to make http post request with bearer authentication

The "Authorization" is simply an HTTP header. So add it in your request like: http.addHeader("Authorization", token); The value of "token" is just the string "...
jwh20's user avatar
  • 1,045
5 votes
Accepted

HTTP-POST returns 400 when posting a value from the sensor

Your line int httpResponseCode = http.POST("{\"amount\":\"total\"}"); is not doing what you think it's doing. You're not placing the contents of the variable called ...
Majenko's user avatar
  • 105k
4 votes
Accepted

Parse HTTP Request Arduino

Your incoming string, as Gerben has mentioned, will actually be more like: GET /STA/ID=HelloWorld/Pass=Testin123 HTTP/1.1 My personal preferred method is to use strtok() to split the string up. I'd ...
Majenko's user avatar
  • 105k
4 votes

What is the proper way to send data through http using sim908?

You mention two different error messages. 1. AT+HTTPINIT fail You get +CME ERROR 3. Which means "operation not allowed". This can be due to an improperly closed HTTP setup. If you get this error (...
aaa's user avatar
  • 2,695
4 votes
Accepted

ESP8266 sends webpage to client, but html codes appears in browser instead of webpage?

It looks like you did not send the HTTP headers. Before sending any of the HTML content send following lines: "HTTP/1.1 200 OK\r\n" "Content-Type: text/html\r\n\r\n" Make sure you send all the \r\n !...
haya's user avatar
  • 84
4 votes

ESP8266 Bad request error 400

HTTP status code 400 means that your request syntax is invalid. Here's a good way to debug it: store the request in a string, print that, and then transmit it. You'd see very quickly at least one of ...
romkey's user avatar
  • 1,554
4 votes
Accepted

ESP8266 GET request code -1

You omitted the protocol part of the url. The HttpClient implementation requires it. Use http.begin("http://www.francescosoave.com/blind/getTime.php"); Do not use Content-type header. You do not ...
Juraj's user avatar
  • 18.1k
4 votes

Arduino SIM5320e HTTP GET request to 000webhost.com

Try just using IP address for the Host line instead. I did the same thing for POST and it works fine for me. Example: Host: 13.xxx.xx.xx
Wyman's user avatar
  • 41
3 votes
Accepted

How to control MKR1000 from outside your local network

The only way I can think of to achieve this would be to port forward your router, and forward port 80 (http) to your MKR1000. You can check out https://portforward.com/ for instructions on that. If ...
Tony T's user avatar
  • 46
3 votes
Accepted

Scan IP address of ESP8266

The de-facto standard way for devices to broadcast their IP address to clients is through the Multicast DNS system (mDNS). In this system the server sends a UDP message to a specific multicast group ...
Majenko's user avatar
  • 105k
3 votes
Accepted

Esp8266 and HttpClient not working properly

You declare and initialize data as a String in the global space. Then, in loop, you use a bunch of concatenations to build your request string. You never clear the contents of data, but back at the ...
jose can u c's user avatar
  • 6,974
3 votes
Accepted

Arduino HTTPClient passing string to variable

The getString() method calls writeToStream which is documented write all message body / payload to Stream. It writes all the data of the http response to he output and doesn't store them internally. ...
Juraj's user avatar
  • 18.1k
3 votes
Accepted

Correct way of having loop end when required?

As pointed out by Ignacio Vazquez-Abrams and jsotola, you need to use a state machine, like the one from the Blink Without Delay Arduino tutorial. Yours would be slightly more complicated because you ...
Edgar Bonet's user avatar
  • 43.1k
3 votes
Accepted

Faster way to parse a HTTP response in Arduino

there are nice functions inherited from Stream class int parseResponse(char uuid[], int size) { if (!client.find("HTTP/1.1")) // skip HTTP/1.1 return -1; int st = client.parseInt(); // parse ...
Juraj's user avatar
  • 18.1k
3 votes

random soft wdt reset while request

Show examples of the error - and install ESPexeption decoder to analyse the stack trace this will at least show why the wdt was caused So the only thing as of now I can recommend There is an issue ...
Codebreaker007's user avatar
3 votes
Accepted

ESP8266 not responding after random intervals of time

I don't know if this is your problem, but I'll leave it here because it is certainly a potential bug. This code in loop: while(!client.available()){ delay(1); } can cause a deadlock if ...
Delta_G's user avatar
  • 3,270
3 votes
Accepted

Frequency of Retrieving Data from Website

Your two best options would be MQTT and WebSockets. Both would open a long lived TCP connection that the ESP8266 and browser could use to transmit and receive data. Both would avoid constant polling ...
romkey's user avatar
  • 1,554
3 votes
Accepted

Making HTTPS requests using ESP8266 AT commands

HTTPS requires that you make an SSL connection not a TCP connection. To do that you need to use AT+CIPSTART="SSL","54.166.71.140 ",443 You also need to configure SSL itself. ...
Majenko's user avatar
  • 105k
3 votes
Accepted

How to reset the count/data after HTTP.POST?

Try putting your total variable to 0, like this: total = 0; It should work like this.
NotLeonid's user avatar
3 votes

Simple GET request is failing silently

I made it by using EthernetENC library, as suggested by @Juraj. To install the library, simply use the library manager and search for EthernetENC. For those in need, below is a working code #include &...
user2959923's user avatar
3 votes
Accepted

MAX30100 and ESP8266 NodeMCU Serial Errors

Well. Finally. Figured it out. After countless hours of googling and reading the issues on the github library, i just had to insert one line. resetFifo to reset the module after http post and re ...
Roschlynn Dsouza's user avatar
3 votes

ESP32 HTTP Request handles Go webserver response, but fails on node JS servers

Your Arduino code reads like this: int httpCode = http.GET(); http.addHeader("Content-Type", "application/json"); http.addHeader("Host", "something"); //...
romkey's user avatar
  • 1,554
2 votes

ESP8266 sends webpage to client, but html codes appears in browser instead of webpage?

Slightly off-topic, as this is not the source of your problem, but as jBot42 says, you need a proper regulator. When you use a voltage divider, your load (the ESP8266) is connected in parallel with ...
Alphonsos_Pangas's user avatar
2 votes

ESP8266 sends webpage to client, but html codes appears in browser instead of webpage?

See the text from "'HTTP/1.1 200 OK'" until "'DOCTYPE html'" in the following couple of links which say the same, and you might like to read the rest of those pages: https://www.arduino.cc/en/...
Geoff's user avatar
  • 186
2 votes

HTTP post request in JSON Format using SIM900 module

Hi all use this code below for establishing HTTP connection with the server. And to neglect the 601 or 504 error use proper posting format. Here I'm using JSON format. I just gave manual data. Ignore ...
Chitraveer Akhil's user avatar
2 votes
Accepted

Help with my DHT22 sensor and using GET request

The Adafruit DHT library causes a shortcut on the signal line. That can be a problem for Arduino boards, but it is a big problem for the ESP8266. Issue: DHT init sequence wrong #48 I don't know what ...
Jot's user avatar
  • 3,246
2 votes

How to control MKR1000 from outside your local network

You now can try this UPnP_Generic library to do the auto-portforwarding for you without manually touching the router. Many of us are manually port-forwarding in Internet Gateway Device (IGD, Router) ...
khoih-prog's user avatar
2 votes
Accepted

Sim800l gsm module cannot connect gprs data

I get it now , a stable power source is the answer. arduino with usb can give right amount of Volts but it lacks stable power(amps i guess) while making a TCP connection, that's why module keep ...
Kamrul Hasan's user avatar
2 votes

How to post JSON data from Arduino?

The string "{\"AssetSensorDistance\":\"+st+\"}" contains a literal "+st+". If you want to do string concatenation, you should terminate the string with a double quote character, then add st, then ...
Edgar Bonet's user avatar
  • 43.1k
2 votes
Accepted

How to establish a connection between an Arduino and a web server via ESP8266

Is this project possible without Arduino and just by programming the ESP8266 module? Yes if you use ESP-12 or an esp8266 dev board like Wemos or NodeMCU. The problem could be the current sensor. I ...
Juraj's user avatar
  • 18.1k

Only top scored, non community-wiki answers of a minimum length are eligible