Jump to content

Banner.jpg.b83b14cd4142fe10848741bb2a14c66b.jpg

Sending alerts over WiFi network


steppenwolf

Recommended Posts

There is a very interesting thread here on the subject of rain sensors and one of the solutions is to use the alarm feature of MaxIm DL to send an alert via Skype to an iPhone. I like the concept but would prefer to make use of the network connection that I already have to my observatory so that an alert could be sent via the network either to another PC or even better to my iPhone which is also on the WiFi network.

Does anyone know of a way of doing this? I'm thinking that if I get a 'Star Faded' alarm then this could be a warning of a whole multitude of errors including cloud/rain and this would set off a script in MaxIm that would send an alert over the wired network to my WiFi hub and thence to my iPhone.

Any thoughts, clever people out there?

Link to comment
Share on other sites

I'm not sure you can send an alert to a device. You can send an alert to an app that's running on a device. However, since you already have an email app running on your phone (or PC), it seems to me that is the simplest solution: just have Maxim script an email message to your phone's email account.

I have something similar that sends emails from a dedicated RPi to one of my email accounts. When that account receives the email, my phone goes "ding!" :laugh: It would be quite nice if I could customise the email app to speak a message when *that* email arrived, instead of having to go to the bother of reading it.

Link to comment
Share on other sites

I'm not sure you can send an alert to a device. You can send an alert to an app that's running on a device.

That makes sense! So, now to find out how to write a VBS script to send myself an email ...... that would be a rather convenient method as it would hit more than one device (my dedktop PC and my iPhone) so I double my chances of receiving the alert.

Thank you, Pete.

Link to comment
Share on other sites

On a similar note, is anyone aware of a service to convert emails to SMS text messages? Rather old fashioned, I know, but I'd like to do a similar thing to the OP by sending a text to my phone when a certain event occurs. I already have the email part of it running (via ACP observatory control software), so it is 'just' a case of forwarding the email to a service that converts it to an SMS. These services used to exist, but I can't find an active one these days :( Guess everyone has smart phones, and just accepts the email directly :-\

Link to comment
Share on other sites

While SGL has been down, I have been rather busy researching and have got it all up and running!

Thanks, Andy, my solution seems to be based on similar data to that in your link. I couldn't get it to work at first but then found an extra command that resolved the issue -  'smtpusessl'

My solution VB Script is as follows and it works a treat:-

const cdoBasic=1
schema = "http://schemas.microsoft.com/cdo/configuration/"
Set objEmail = CreateObject("CDO.Message")
With objEmail
.From = "name@domain.co.uk"
.To = "name@domain.co.uk"
.Subject = "Star Faded"
.Textbody = "Check for cloud cover or imminent rain"
With .Configuration.Fields
.Item (schema & "sendusing") = 2
.Item (schema & "smtpserver") = "smtp.outlook.com"
.Item (schema & "smtpserverport") = 25
.Item (schema & "smtpusessl") = True
.Item (schema & "smtpauthenticate") = cdoBasic
.Item (schema & "sendusername") = "name@domain.co.uk"
.Item (schema & "smtpaccountname") = "name@domain.co.uk"
.Item (schema & "sendpassword") = "mypassword"
End With
.Configuration.Fields.Update
.Send
End With
 

Link to comment
Share on other sites

My orange webmail provider allows me to identify filter fields or recipients in emails which mean that email needs converting to an SMS. This is how I receove real-time AuroraWatch alerts. The problem this overcomes is the polling frequency from a phone to the email provider means you could be waiting a few hours to find you have an urgent email, unless you are using push email like on a Blackberry. Does an iPhone provide this too ? I didn't think so.

Mike

Link to comment
Share on other sites

unless you are using push email like on a Blackberry. Does an iPhone provide this too ? I didn't think so.

Hi Mike, yes an iPhone will receive 'push' emails but you do need to use iCloud. I have set up a random iCloud email address just for this purpose and currently get an alert within 4 - 6 seconds.

Link to comment
Share on other sites

Be aware any mail going via an SMTP server could potentially be queued for many hours if the server is busy, this is irrespective of the device, app or push method you use. This could be caused by loadsamail, maintenance, fault conditions or congested links at either the ISP or the mail service provider. We all get so used to mail arriving in a minute or so but there are plenty of situations when it can get delayed. Not reliable enough for a rain alarm. Only way to avoid this with mail is run your own SMTP server to accept the incoming mail, or use IMAP and insert the mail directly into your own mailbox. A better solution would be a mini app that received a packet direct across your own network (sadly means writing two apps, one to send and one to receive/notify).

Joe

Link to comment
Share on other sites

I don't know about Maxim DL but I would use a socket (available in both Windows and Linux) to communicate between the sensor computer and the "monitor" computer.  

http://www.thegeekstuff.com/2011/12/c-socket-programming/

You can use C,Python,Java and other languages.  

Unlike smtp/skype there is no third party involved and it just requires your local network to be working.

Also it is simple and very fast.   

If you want a webpage websockets might be the answer.  You would have to run a websocket server on your sensor computer.

libwebsockets is a portable websocket server but it does require a bit of experience.

http://libwebsockets.org/trac/libwebsockets

Then you connect to the websocket server via javascript running on a webpage.

Link to comment
Share on other sites

Be aware any mail going via an SMTP server could potentially be queued for many hours if the server is busy, this is irrespective of the device, app or push method you use.

Quite true but better than I have at the moment (listening for that 'plop-plop' sound on my conservatory roof) :grin: :grin:

I don't know about Maxim DL but I would use a socket (available in both Windows and Linux) to communicate between the sensor computer and the "monitor" computer.

I do like this idea lots but currently it is too far outside my programming comfort zone! :huh:

Link to comment
Share on other sites

I have written a very simple program to demonstrate the principle.

Source code

https://www.dropbox.com/s/4z1jd807wy22rrk/Alerter.cpp

Windows executable

https://www.dropbox.com/s/v56vhufg20jsocw/Alerter.exe

Run from a command line.

cd to the directory you downloaded Alerter.exe to.

On any computer you want to monitor alerts run with no arguments.

Alerter.exe

When an event you want to be notified of occurs run with a message:

Alerter.exe raining

will display the message raining on all monitors

For longer text use quotes.

Alerter.exe "it really is raining a lot"

or

Alerter.exe beep

to cause the monitors to beep.

If the firewall asks to allow permission then allow it.

I'm not sure how well the notifier deals with multiple network interfaces.  I think it sends on all interfaces.

You can try it out running both monitor and notifier on the same computer to get a feel for it.

Link to comment
Share on other sites

I have written a very simple program to demonstrate the principle.

Source code

https://www.dropbox.com/s/4z1jd807wy22rrk/Alerter.cpp

Windows executable

https://www.dropbox.com/s/v56vhufg20jsocw/Alerter.exe

Run from a command line.

cd to the directory you downloaded Alerter.exe to.

On any computer you want to monitor alerts run with no arguments.

Alerter.exe

When an event you want to be notified of occurs run with a message:

Alerter.exe raining

will display the message raining on all monitors

For longer text use quotes.

Alerter.exe "it really is raining a lot"

or

Alerter.exe beep

to cause the monitors to beep.

If the firewall asks to allow permission then allow it.

I'm not sure how well the notifier deals with multiple network interfaces.  I think it sends on all interfaces.

You can try it out running both monitor and notifier on the same computer to get a feel for it.

Testing this morning show that it does only use one interface.  This can be changed by altering the routing table.  See the "route add" command.

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue. By using this site, you agree to our Terms of Use.