Attached is a sketch from Random Nerd Tutorials to send a Whatsapp message using the ESP8266.
It all works perfectly but I would like to know if, and more importantly how, I can send a "String" such as :
("%02d:%02d:%02d" , time_hour , time_min , time_sec)
Basically I can send text or values (temperature in my case) as separate Whatsapp messages but I would like to send a single message such as :
"New all time low = 1.2 degrees at 10:21:45"
I think it could be either method it's just where to put it in the original sketch?
If I try to add anything to the 'urlEncode(message)' I get errors.
If I try to change the message in the void loop I get errors
You call the sendMessage() function with the message to be sent. Build your required message just befoer the function call and use it as the parameter sent to sendMessage()
The complete sketch is massive.
I am currently using the sketch I previously posted within my main sketch and I am sending separate messages such as:
"Minimum temperature reached "
(temperature value)
"At "
(time_hour, time_min, time_sec)
You can posts sketches big as 120000 characters as code-sections.
If you want to play a game of posting only a small part of your code which then later turns out that the bug is somewhere in that part of the code you have not posted go ahead distracting finding the solution.
otherwise poste a the complete sketch and post where in your code the error occurs
My problem is not with my main sketch.
If I cant find a way to send the required string in the original posted sketch then I am not going to attempt to add it to my main sketch
The "sendMessage()" function takes a String so you can pass anything that can be converted to a String. That can be a character array, character pointer, or String.