Comments on: ESP32/ESP8266 Insert Data into MySQL Database using PHP and Arduino IDE https://randomnerdtutorials.com/esp32-esp8266-mysql-database-php/ Learn ESP8266, ESP32, Arduino, and Raspberry Pi Tue, 18 Mar 2025 13:29:38 +0000 hourly 1 https://wordpress.org/?v=6.8.1 By: Warner Krelekamp https://randomnerdtutorials.com/esp32-esp8266-mysql-database-php/#comment-1017688 Tue, 18 Mar 2025 13:29:38 +0000 https://randomnerdtutorials.com/?p=85922#comment-1017688 In reply to Warner Krelekamp.

Found the culprit: You have to install Adafruit_Unified_Sensor library

]]>
By: Warner Krelekamp https://randomnerdtutorials.com/esp32-esp8266-mysql-database-php/#comment-1017687 Tue, 18 Mar 2025 13:21:46 +0000 https://randomnerdtutorials.com/?p=85922#comment-1017687 I get:
compilation terminated.
exit status 1
Adafruit_Sensor.h: No such file or directory
And going in the library manager I cannot find Adafruit_Sensor.

]]>
By: Chris https://randomnerdtutorials.com/esp32-esp8266-mysql-database-php/#comment-999922 Tue, 14 Jan 2025 21:58:40 +0000 https://randomnerdtutorials.com/?p=85922#comment-999922 Hey, I think for ESP32 a “client.stop();” need to be added.
Otherwise I ran into a “SSL – Memory allocation failed” if I try to connect to several servers.

// Free resources
client.stop();
https.end();

]]>
By: Claes Rolen https://randomnerdtutorials.com/esp32-esp8266-mysql-database-php/#comment-991079 Fri, 13 Dec 2024 07:50:19 +0000 https://randomnerdtutorials.com/?p=85922#comment-991079 In reply to Earl.

I also had a similar problem, adding delete solved it for me:

// Free resources
https.end();
delete client; // <----- clean up

//Claes

]]>
By: Earl https://randomnerdtutorials.com/esp32-esp8266-mysql-database-php/#comment-910311 Sat, 27 Apr 2024 22:00:05 +0000 https://randomnerdtutorials.com/?p=85922#comment-910311 In reply to Ric.

Hi Ric, I am experiencing the same issue.
On one instance the serial monitor provided a hint:
“E (1887635) esp-sha: Failed to allocate buf memory”
I added the snippet of code you provided that monitors Memory and Heap.
The Heap started at 277112 and gradually declines with each post.
When it gets to 48280 it then starts to generate a Error code: -1 and
E (522970) esp-sha: Failed to allocate buf memory

I’m not clear on what the fix was you referred to above.

]]>
By: Denis https://randomnerdtutorials.com/esp32-esp8266-mysql-database-php/#comment-910010 Fri, 26 Apr 2024 20:00:12 +0000 https://randomnerdtutorials.com/?p=85922#comment-910010 In reply to ElG.

Hello! I have the same problem. How did you solve it? Thank you.

]]>
By: MANOEL LUCAS MARTHOS https://randomnerdtutorials.com/esp32-esp8266-mysql-database-php/#comment-905121 Thu, 11 Apr 2024 19:38:18 +0000 https://randomnerdtutorials.com/?p=85922#comment-905121 In reply to manoel marthos.

Hi! Can I use WiFiClientSecure client instead of WiFiClientSecure *client = new WiFiClientSecure ? Could there be a problem?
for example:
// WiFiClientSecure *client = new WiFiClientSecure;
WiFiClientSecure client;
// *client->setInsecure(); //don’t use SSL certificate
client.setInsecure(); //don’t use SSL certificate
HTTPClient https;
Apparently it works fine.

]]>
By: manoel marthos https://randomnerdtutorials.com/esp32-esp8266-mysql-database-php/#comment-904603 Tue, 09 Apr 2024 03:08:04 +0000 https://randomnerdtutorials.com/?p=85922#comment-904603 After 63 accepted connections, 63 successful submissions, it declines all the others. Almost always 63 connections accepted and data sent and the next ones are always refused. Regardless of the time between connections.
I tested it on two servers. The second is a VPS. I hired a VPS (Virtual Private Server) server for a short period of time to do more tests with Esp32, being able to change some configuration values in msql.
Even modifying some parameters in the mysql of the VPS, maximum limits for example. The result was the same: after 63 posts error returns (-1), only by restart the post again, 63 succeeded. That is, he refused to connect after 63. Always between 63 most of the time and once in a while 62. So fixed values, not random. And it doesn’t matter how long it takes between posts/sends, 3 seconds, ten seconds, 30 seconds, or 60 seconds loop. And it doesn’t matter if the program I made or the demo program. The result is always: it accepts 63 connections, from there to the rejection and the looks like -1

]]>
By: Brandon https://randomnerdtutorials.com/esp32-esp8266-mysql-database-php/#comment-902558 Sun, 31 Mar 2024 17:22:57 +0000 https://randomnerdtutorials.com/?p=85922#comment-902558 In reply to Matthias.

Hello, Matthias.

Have you solved this problem? I have the same error and haven’t found the solution yet.

Thank you.

]]>
By: Paolo https://randomnerdtutorials.com/esp32-esp8266-mysql-database-php/#comment-902192 Sat, 30 Mar 2024 11:37:25 +0000 https://randomnerdtutorials.com/?p=85922#comment-902192 Good morning Rui and Sara I’m using esp32 with bme280 which also gives me altitude, but when I go to write the altitude field the value corresponds to this:

Data: b”\xf0\xaa\xfc?\xac:\xfc?’\xe3\xc8\xa5\x807\xfc?|<\xfc?\x847\xfc?\x01″

Could you kindly help me decode the altitude field correctly so that I can insert it correctly into the MYSQL db.
Thanks for existing
Best regards

]]>