Welcome,
The issue is that I have built myself a device that records some parameters and sends them to a SQL database on a server. I have used tutorials and readymades available on the internet. I have a simple script written in PHP
which handles this from the server side. I use the ESP32 module, http and the GET method (written in Arduino) to send data.
I have recently included a Fibocom G510 GSM module so that if WiFi is not available, data will still be sent. Sending works correctly and stably.
Now I wanted to be able to change certain parameters of the module remotely using a page that would also be hosted on the same server. I searched the net and all the tutorials on sending data from a page to the ESP concern pages generated by the esp itself. I have not found any information on how to do this through an html page generated on the server.
So now I have two questions:
1) How do I read the information from the page in the ESP32? I'm not quite sure if the ESP is supposed to query the page if there are any changes, or if it will be informed - if so, how?
My PHP script, after a successful write of data to the sql database, in the event of a successful record write, returns that the record was successful. My code for sending the data:
.
I understand that I get the ifnormation back thanks to the method "int httpCode = http.GET();". Please forgive me for the layman's question - in that case, if I want to read the information from the server (without sending the data), do I have to keep sending the query
"int httpCode = http.GET();". ?
2) How to implement the same when using a GSM modem G510? In the current code, I use the AT+HTTPREAD command to receive a response from the server directly after sending data with the at+httpset and AT+HTTPACT commands.
Do I use the same command to query the server to read the parameter change?
If I have messed something up, please forgive me, as this is a new topic for me and I may not fully understand how it should work
.
The issue is that I have built myself a device that records some parameters and sends them to a SQL database on a server. I have used tutorials and readymades available on the internet. I have a simple script written in PHP
which handles this from the server side. I use the ESP32 module, http and the GET method (written in Arduino) to send data.
I have recently included a Fibocom G510 GSM module so that if WiFi is not available, data will still be sent. Sending works correctly and stably.
Now I wanted to be able to change certain parameters of the module remotely using a page that would also be hosted on the same server. I searched the net and all the tutorials on sending data from a page to the ESP concern pages generated by the esp itself. I have not found any information on how to do this through an html page generated on the server.
So now I have two questions:
1) How do I read the information from the page in the ESP32? I'm not quite sure if the ESP is supposed to query the page if there are any changes, or if it will be informed - if so, how?
My PHP script, after a successful write of data to the sql database, in the event of a successful record write, returns that the record was successful. My code for sending the data:
Code: C / C++
I understand that I get the ifnormation back thanks to the method "int httpCode = http.GET();". Please forgive me for the layman's question - in that case, if I want to read the information from the server (without sending the data), do I have to keep sending the query
"int httpCode = http.GET();". ?
2) How to implement the same when using a GSM modem G510? In the current code, I use the AT+HTTPREAD command to receive a response from the server directly after sending data with the at+httpset and AT+HTTPACT commands.
Do I use the same command to query the server to read the parameter change?
If I have messed something up, please forgive me, as this is a new topic for me and I may not fully understand how it should work
