Comments (30)
I answered you yesterday. Did you delete and repost it again without any change?
your request is wrong. lookup HTTP protocol. what is a header line, what is a request body, how they are separated by an empty line.
from wifiesp.
Hi, sorry, I didn't delete the previous one, keep it up, I just opened a new one because I thought it would be better.
I have no problem consuming the API, it works, the data arrives, the problem is that it takes almost 1s the whole operation, I changed the code and it continues the same thing, see:
String content = "{\"UserName\": \"" + wsUserName + "\", \"BancoDados\": " + wsBancoDados + ", \"Botao\": \"" + buttonCode + "\", \"Ligado\": " + buttonStatus + "}";
client.println("POST " + wsMetodo + " HTTP/1.1");
client.println("Host: " + wsServidorIp + ":" + wsServidorPort);
client.println("Content-Length: " + String(content.length() + 2));
client.println("Content-Type: application/json");
client.println("Connection: close");
client.println();
client.println(content);
12:51:08.894 > B04 APERTADO
12:51:08.929 > Evento B04...
12:51:08.929 > [WiFiEsp] Connecting to 10.1.1.122
12:51:08.961 > Conectado ao servidor.
12:51:08.988 > Send B04...
12:51:09.755 > Envio finalizado.
from wifiesp.
what bad rate do you use to communicate with the AT firmware?
what code prints that output?
from wifiesp.
void setup()
{
Serial.begin(9600);
//-- Inicializa a serial para conexão com ESP.
Serial3.begin(115200);
//-- Inicializa modulo ESP.
WiFi.init(&Serial3);
...
while (status != WL_CONNECTED)
{
Serial.print("Tentando conectar ao WPA SSID: ");
Serial.println(ssid);
status = WiFi.begin(ssid, pass);
}
...
void ButtonWsSend(String buttonCode, String buttonStatus)
{
if (client.connect(wsServidorIp.c_str(), wsServidorPort))
{
Serial.println("Conectado ao servidor.");
Serial.println("Send "+ buttonCode +"...");
//--.
String content = "{\"UserName\": \"" + wsUserName + "\", \"BancoDados\": " + wsBancoDados + ", \"Botao\": \"" + buttonCode + "\", \"Ligado\": " + buttonStatus + "}";
client.println("POST" + wsMetodo + " HTTP/1.1");
client.println("Host: " + wsServidorIp + ":" + wsServidorPort);
client.println("Content-Length: " + String(content.length() + 2));
client.println("Content-Type: application/json");
client.println("Connection: keep-alive");
client.println();
client.println(content);
//--.
client.flush();
client.stop();
Serial.println("Envio finalizado.");
}
}
from wifiesp.
you could try my WiFiEspAT library. maybe it is faster. sure is, it can run at higher baud rate on hardware Serial
https://github.com/jandrassy/WiFiEspAT#Why-a-new-wifiesp-library
from wifiesp.
Good afternoon, do you think it might be related to the Firmware I'm using?
I'm using an Arduino Mega RoboDyn board (AT MEGA 2560 + ESP 8266).
This was the AT Firmware I used on ESP:
from wifiesp.
SDK 1.5 is ancient.
but the speed is a problem of WiFiEsp library. my WiFiEspAT library is faster
from wifiesp.
I'm trying for your library but I can't communicate with ESP, see:
Before I updated the Firmware to version 2.2.1:
What will be the problem?
from wifiesp.
my library requires at least AT 1.7 (from SDK 3)
https://www.espressif.com/en/support/download/at?keys=&field_type_tid%5B%5D=14
from wifiesp.
Same thing :(
from wifiesp.
the board's setup should be right if it worked with previous library.
turn on debug logging https://github.com/jandrassy/WiFiEspAT#logging
EDIT: does the AT firmware respond to commands from Serial Monitor when you connect the esp8266 directly over USB?
from wifiesp.
It is not responding to AT commands.
With ESP connected directly to USB and with DIP7 on it just shows this:
With the DIP7 turned off, this information is passed on and on:
*** The information is only readable at 74880 speed
from wifiesp.
I put this firmware:
from wifiesp.
The closest I got to running the AT commands was by following this tutorial "https://www.instructables.com/Program-Any-ESP8266-Boardmodule-With-AT-Commands-F" and leaving the configuration almost the same:
Connecting to ESP 74880 I receive these messages:
After changing to 115200 I get a Ready, sending the AT command I get ERROR
*** The problem seems to be with the version of this ESP, something is not hitting, this board is an ESP8266EX
from wifiesp.
see https://github.com/jandrassy/WiFiEspAT#at-17-1
and to send AT commands from Serial Monitor set the line ending setting to Both
from wifiesp.
I will try to use your library now ...
from wifiesp.
Did not work :(
from wifiesp.
again. AT 1.7 is with SDK 3.
test with CheckFirmware example
AT 2.1 is with RTOS SDK IDF framework
from wifiesp.
Is it for me to test with Firmware 1.7? I already tested with 1.7 and 1.7.4, it does not work the AT command, the only one that seems to work is this one, 2.2.1
I didn't understand what I have to test now, could you give more details?
from wifiesp.
I think I understand, is it for me to follow the recommendations below?
How do I do this "--flash_size 1MB 0x0" in "ESP8266 DOWNLOAD TOOL"?
from wifiesp.
It worked, I put Firmware 1.7.4 following its settings and it worked, the weather improved well, something around 200ms for POST and 100ms for GET.
The only problem is that after consuming the API 4 times, on Thursday, as a disconnected server, can you tell me why?
from wifiesp.
I commented client.stop() and stopped disconnecting after 5 times, I don't know if it's right, but it worked.
from wifiesp.
you flashed the 1 MB version? the esp8266 on Mega+WiFi has a 4 MB flash memory, but the firmware only needs two so Espressif builds the published version for 2 MB flash and a stripped down version for 1 MB flash
from wifiesp.
I used firmware 1.7.4 and followed the parameters indicated in mark 2 of the image, should I use the parameters of mark 1?
from wifiesp.
yes 1, the second is for 1 MB esp-01 modules.
but it is not important if you don't need the removed features
from wifiesp.
How can I be sure that mine is not ESP-01? It has these markings:
ESP8266EX
412019
UB00PPAW77
from wifiesp.
4 MB clues: 1) Robotdyn Mega+WiFi board spec 2) Flash Download Tool detection
from wifiesp.
Okay, last question, is there a significant difference whether or not to use client.stop()?
Without it working well, can I keep it that way?
I also left Connection: keep-alive, it got faster.
Thank you very much for all the support.
from wifiesp.
Okay, last question, is there a significant difference whether or not to use client.stop()?
Without it working well, can I keep it that way?
I also left Connection: keep-alive, it got faster.Thank you very much for all the support.
the AT firmware is limited to 5 concurrent 'links' (TCP clients and UDP listeners). it is harder to manage if some connections are left open.
and is it faster?
from wifiesp.
Just for you to understand, my solution has 16 connected buttons and are pressed by users at random. When a button is pressed, I consume a web service to record the moment that was pressed, the registration is done in a database.
As it can happen that more than one user presses the same time, the sending must be as fast as possible.
Anyway, without using client.stop() and with "Connection: keep-alive" it fine, somewhere around 80ms, and it doesn't stop after 5 uploads.
from wifiesp.
Related Issues (20)
- Arduino nano Every compiling error HOT 3
- How can I get data? HOT 5
- UDP->remotePort() returns incorrect value HOT 3
- UDP link is not valid HOT 4
- REST API Post request to microsoft power bi real time data set HOT 1
- ESP8266 Crashes After UDP Packet Overload HOT 2
- ESP-Now with WiFiEsp library on ESP8266-01 interfaced to Arduino Uno HOT 2
- Connect to Firebase Database using WiFiESP
- The use of Delay() HOT 10
- TIMEOUT in same position every time on large HTTP header HOT 2
- WiFiEsp: Send Post message from Arduino Mega + ESP-01 issue HOT 8
- RingBuffer namespace collision with other libraries
- WebClient example doesn't work anymore
- Invalid "ClientSSL " connection directive HOT 5
- DDNS HOT 1
- Problem with the WebClientSSL example
- Can someone help with TMRpcm.h conflict HOT 1
- UDP + WiFiEspServer
- Async web client HOT 6
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from wifiesp.