Place to put your Basic demos and examples

Moderator: Mmiscool

User avatar
By Don Starkey
#52219 '******************************************************
'* by Don Starkey, 8/4/2016 *
'* Get current time as ASCII String from internet *
'* Send it as a text message to my phone *
'******************************************************

print "Connected to AP"

' Get ASCII time string
Traw = wget("tycho.usno.navy.mil/timer.html")

' Search for marker so we know where to trim
P = instr(Traw,"Universal Time")

' Get formatted string for "Eastern Time" formatted properly
Time = mid(Traw,P + 19,24)
Print "Time: " & Time
' result: "Aug. 05, 03:39:22 PM EDT" in Time variable


' Now, lets send it as a text message
body = Time

' Fill in your SMTP server
server = "mail.xxx.com"
port = 25
user = "yourname@yourserver.com"
password = "yourpassword"

' Fill in where you want your text message sent
' I use Verizon so vtext.com works

sendto = "5551234567@vtext.com"

' Who the message is from, server might need this???
sendfrom = "me@server.com"


mess = "Message from ESP8266: "

print "Sending Message"

setupemail server port user password

print "Set up email server"

email sendto sendfrom mess body

print "Message sent"

end
User avatar
By Mmiscool
#52248 If i might ask what service are you using for the smtp mail. Smtptogo has been giving me trouble lately.
User avatar
By Don Starkey
#52317 I use mail.neo.rr.com without any problems.

On an entirely different note, I can't seem to get things working at home now.
I have 2 other routers in the house and wonder if they are causing a problem.
Do you have the ESP search for an open channel or is it hard coded to a particular channel?
User avatar
By Mmiscool
#52372 Truthfully i don't know. It uses what ever the default behaure is in the arduino environment.