Hi everyone
I am trying to send data to a MySQL database using Ethernet on the ESP32 with HTTP Post Requests.
I was able to get an IP address using the Ethernet example but I don't know how to do the HTTP POST using Ethernet.
HTTP using Ethernet
Re: HTTP using Ethernet
dvrp13 wrote:Hi everyone
I am trying to send data to a MySQL database using Ethernet on the ESP32 with HTTP Post Requests.
I was able to get an IP address using the Ethernet example but I don't know how to do the HTTP POST using Ethernet.
perhabs this helps
you can simple use each example ( TCP, FTP, SMP, ... and so on )
same way.
best wishes
rudi
-------------------------------------
love it, change it or leave it.
-------------------------------------
問候飛出去的朋友遍全球魯迪
love it, change it or leave it.
-------------------------------------
問候飛出去的朋友遍全球魯迪
Re: HTTP using Ethernet
Thanks!
I was able to do a http get request using parts of the http request example.
But sometimes it is stuck in the do...while just before the putchar used to print the html code.
It prints DO 1 and DO 2 but then it is stuck.
I was able to do a http get request using parts of the http request example.
But sometimes it is stuck in the do...while just before the putchar used to print the html code.
It prints DO 1 and DO 2 but then it is stuck.
Code: Select all
do {
ESP_LOGI(TAG, "DO 1");
bzero(recv_buf, sizeof(recv_buf));
ESP_LOGI(TAG, "DO 2");
r = read(s, recv_buf, sizeof(recv_buf)-1);
ESP_LOGI(TAG, "DO 3");
for(int i = 0; i < r; i++) {
putchar(recv_buf[i]);
}
ESP_LOGI(TAG, "DO 4");
} while(r > 0);
Re: HTTP using Ethernet
From that code fragment, you a blocking in the sockets read() call. This is a blocking call that won't return until some data has been received over the socket.
Free book on ESP32 available here: https://leanpub.com/kolban-ESP32
Re: HTTP using Ethernet
Sorry for my late answer.
It looks like the network of my university college is blocking the network traffic from the ESP32.
On that network it is detected as http proxy but all proxy network is blocked.
Would it be possible to bypass this? Maybe by changing the user agent?
It looks like the network of my university college is blocking the network traffic from the ESP32.
On that network it is detected as http proxy but all proxy network is blocked.
Would it be possible to bypass this? Maybe by changing the user agent?
Who is online
Users browsing this forum: Baidu [Spider] and 79 guests