I've been told its better to try to minimize the client.print calls as each might do an actual I/O which is slow, so for example concat the headers together and then send them altogether with a single client.print.
Clever idea, thanks torntrousers
Explore... Chat... Share...
Moderator: igrr
I've been told its better to try to minimize the client.print calls as each might do an actual I/O which is slow, so for example concat the headers together and then send them altogether with a single client.print.
WiFiClient client;
// connexion au serveur ThingSpeak pour mise à jour du canal par requete GET
if (!client.connect(host, httpPort)) {
//Serial.println("echec de connection");
// on passe son tour !!
ESP.deepSleep(intervalle * 60 * 1000000, WAKE_RF_DEFAULT); // WAKE_RF_DEFAULT ou WAKE_NO_RFCAL
}
// composer le contenu de la requete GET, dans la chaine 'url'
String url = "/update?key=";
url += myWriteAPIKey;
url += "&field1=";
url += String(voltage);
url += "&field2=";
url += String(session);
url += "&field5=";
url += String(tdallas);
// envoi requete GET au serveur
client.print(String("GET ") + url + " HTTP/1.1\r\n" +
"Host: " + host + "\r\n" +
"Connection: close\r\n\r\n");
Did you try
.....
with no DNS ??
Using static IP I am now able to get a consistent 165ms for router connection
So my goal is to bring the full session time (wake up, data acquisition, router connection, ThingSpeak connection, deep-sleep) below 800ms forStill struggling to acquire the two 18B20 sensors at hi resolution within the suggested time frame
- 1-wire 18B20 (possibly 2 sensors at FULL 12 bits resolution)
- BMP180 temperature - BMP180 pressure
- battery voltage
- timing info
-send ("publish") data to local MQTT broker (Raspberry Pi connected to 'box' with Ethernet) and then relay data to ThingSpeak with some simple NodeRed codeI googled for "node-red" ...
It takes about 20-25 seconds for home assistant c[…]
I tried to upgrade tof my sonoff basic R2 with the[…]
a problem Perhaps you want to define "Probl[…]
Rebooting your router will not give you a faster I[…]
There are no other notifications from esptool.py i[…]
Using the Arduino IDE, you'll learn how to set up […]
In this project, you will post to Twitter using an[…]
In this project, we will build a water level contr[…]
I guess I'm late, but I had the same problem and f[…]
Last night I received my first D1 Minis for a lear[…]
Although I am aware that this is an old post, I fe[…]