SIM900 Sending data to Thingspeak (IoT Server)

Hi. I am trying to get a SIM900 GSM Modem to communicate with Thingspeak to transmit data from a number of sensors (just one at the moment).

I have put together some code (which I have attached) after much searching on the internet however it does not seem to communicate and transmit the data.

From what I can tell it reads the sensor value as I have run this section of the code in isolation with it outputting the value of "value" to the serial monitor.

The hardware set up is fine as the set up sends texts with the data fine and the same set up should be required to send data over the network.

I think the issue may be that it is failing to connect to the internet however I am not 100% as I dont really understand AT commands fully.

I am using a Tesco Mobile Pre-Paid Unlocked SIM card which allows data and I have tested its data connection in a phone so it should not be that which is the issue.

It could be the wrong APN info in the command:
mySerial.println("AT+CSTT="prepay.tesco-mobile.com","tescowap","password"");

I have got these three values from here:
https://www.teamknowhow.com/discover/discover/tesco-apn-settings

If anyone could give me any pointers as to where I am going wrong it would be appreciated and if you need any other info just ask.

Cheers
Calum

upload_test.ino (1.86 KB)