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 "...
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 ...
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 ...
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 ...
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
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
...
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. ...
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 ...
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 ...
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 ...
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 ...
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 ...
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.
...
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.
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 &...
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 ...
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");
//...
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 use ...
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 ...
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) ...
2
votes
How to HTTP post a data to Node express API from a Arduino esp8226?
Did it heres the code
`if (client.connectSSL(server, 443)) {
Serial.println("Connected to server");
// Make a HTTP request
String PostData = content + volt;
Serial.println(PostData);
client.println("...
2
votes
ESP8266 upload data to google cloud platform
Your biggest problem is that you are trying to use a website URL as a FQDN. That's not going to work.
When you connect to a remote machine you connect to the name (myname.appspot.com) which gets ...
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 ...
2
votes
HTTP get request using Arduino Uno and ESP8266
You can use ESP8266Wifi Arduino Library.
Here an example:
#include <ESP8266WiFi.h>
#include <ESP8266HTTPClient.h>
const char* ssid = "yourNetworkName";
const char* password = "...
2
votes
Accepted
How to handle concurrent HTTP request when using interrupt
Simple: don't do HTTP requests in the interrupt.
It's usually bad to do anything heavy like that in an interrupt. Instead you should just set a flag in the interrupt (volatile bool) and examine that ...
2
votes
Accepted
PUT request: PHP code to Arduino HTTPClient
I got clue from @esoterik answer and manage to send request successfully.
The problem were in adding header parameter:
http.addHeader("Content-Length", "20");
This duplicate the header( 2nd one ...
2
votes
Is there a simple HTTP(S) library that doesn't rely on WiFi?
The TinyGSM library implements Arduino networking Client base class over GSM modem's AT commands. The library is available in Library Manager.
2
votes
Accepted
Sim900a AT+HTTPREAD does not get fully answer
Apparently you were running software serial at too high of a baud rate (57600) and bringing it down to 9600 fixed the issue.
2
votes
Arduino Firebase connection refused error
You added a / to the end of the Humidity and Temperature collections.
e.g
Firebase.pushString("Humidity/", fireHumid);
Firebase.pushString("Temperature/", fireTemp);
The firebase API ...
2
votes
Accepted
HTTP POST from Arduino/ESP8266/ESP32 How to send parameters (x-www-form-urlencoded)
What format of message does the server expect? As you send "x-www-form-urlencoded" it should probably look like:
"from=+XXXXX&to=+XXXXX&message=Hej"
where the different parts are
"param1=...
Only top scored, non community-wiki answers of a minimum length are eligible
Related Tags
http × 185esp8266 × 87
arduino-uno × 33
web-server × 33
arduino-ide × 26
esp32 × 26
wifi × 22
gsm × 18
nodemcu × 16
arduino-mega × 10
json × 9
ethernet × 8
iot × 8
tcpip × 7
string × 5
networking × 5
serial × 4
programming × 4
datalogging × 4
ethernet-shield × 4
espressif × 4
sensors × 3
sd-card × 3
array × 3
mkr1000 × 3