irrigation, thing speak, wifi, capacitive soil sensor

I have a vinduino R3 board which uses a pro mini and either lora or esp for communications.
It can also use either a resistive or capacitive sensor.

I have borrowed vinduino code and tried to combine it to work with a capacitive sensor and wifi to upload data to thingspeak.

My problem is that it will not update fields in thingspeak.

It gets connected with wifi no problem and to thingspeak but all fields after entry id are null.

I have searched for a solution and have tried for hours but with no luck.

I am very new at this.

Attached is ino.

vinduino.ino (8.92 KB)

As far as I know it seems that the Thingspeak code is wrong

&1=

should be

 &field1=

and so the others.

Then the connection string should be terminated with

 "   HTTP/1.1\r\n" + "Host : " + host + "\r\n" + "Connection : close\r\n\r\n");

but I am not sure if these will be added automatically by esp8266.