Home
JAQForum Ver 24.01
Log In or Join  
Active Topics
Local Time 16:49 26 Nov 2024 Privacy Policy
Jump to

Notice. New forum software under development. It's going to miss a few functions and look a bit ugly for a while, but I'm working on it full time now as the old forum was too unstable. Couple days, all good. If you notice any issues, please contact me.

Forum Index : Microcontroller and PC projects : Free push notification server

Author Message
MikeO
Senior Member

Joined: 11/09/2011
Location: Australia
Posts: 275
Posted: 09:06pm 28 Jan 2024
Copy link to clipboard 
Print this post

For anyone still struggling with using email as the notification system from Geoff's Watering Controller perhaps this may be worth considering.

I came across this  free service so I thought it may be a perfect solution for the Irrigation system or any time you need to post some info to your phone.

Here is the code with some examples, there are lots more message possibilities see the section in the docs in Publishing>Publish via Get.(Thanks to TheMonkeys code, it was great help in accessing the API) The code will run as is to try , just subscribe to <iff2024> from the app on your phone or web app.







'msg$="message=Reboot"
'msg$="message=Rain-watering%20Off"
'msg$="message=Fault-Watering%20Off"
msg$="message=Status-All%20OK"
ext$="&title=Water%20Irrigation&priority=3&tags=warning"
print notify("ntfy.sh",80,"/irr2024/publish?"+msg$+ext$)

'Send push notification to ntfy
Function notify(servaddr$,servport,tcpreq$) As string
Local return%(64)
WEB OPEN TCP CLIENT servaddr$, servport
notify$="GET "+tcpreq$+" HTTP/1.1"+Chr$(13)+Chr$(10)+"Host: "+servaddr$+":"+Str$(servport)+Chr$(13)+Chr$(10)+"Connection: keep-alive"+Chr$(13)+Chr$(10)+Chr$(13)+Chr$(10)
WEB TCP CLIENT REQUEST notify$, return%()
LongString Print return%()
WEB CLOSE TCP CLIENT
End Function

Edited 2024-01-29 07:15 by MikeO
Codenquilts
 
Geoffg

Guru

Joined: 06/06/2011
Location: Australia
Posts: 3194
Posted: 12:08am 29 Jan 2024
Copy link to clipboard 
Print this post

Excellent.  Thanks Mike.
Geoff
Geoff Graham - http://geoffg.net
 
Print this page


To reply to this topic, you need to log in.

© JAQ Software 2024