#Region Project Attributes
#AutoFlushLogs: True
#CheckArrayBounds: True
#StackBufferSize: 300
#End Region
Sub Process_Globals
'These global variables will be declared once when the application starts.
'Public variables can be accessed from all modules.
Public Serial1 As Serial
Public ota As ESP8266OTA
Public wifi As ESP8266WiFi
End Sub
Private Sub AppStart
Serial1.Initialize(115200)
Log("AppStart")
wifi.Connect2("<yourssid>","<yourpassword>")
'add here a versioncheck maybe with httpjob and a version.txt file on the server
dim result as string
result=ota.HTTPUpdate2("siam-online.de",80,"/dummy/src.ino.bin",True)
If result <> "success" Then
Log ("Error: ",result)
End If
'add here a versioncheck maybe with httpjob and a version.txt file on the server
dim result as string
result=ota.HTTPUpdate("http://siam-online.de/dummy/src.ino.bin",False)
If result <> "success" Then
Log ("Error: ",result)
else
'you can send here a notification and then restart your esp8266
ota.ESPRestart
End If
End Sub