Jump to content

Stargazers Lounge Uses Cookies

Like most websites, SGL uses cookies in order to deliver a secure, personalised service, to provide social media functions and to analyse our traffic. Continued use of SGL indicates your acceptance of our cookie policy.

sgl_imaging_challenge_banner_30_second_exp_2_winners.thumb.jpg.b5430b40547c40d344fd4493776ab99f.jpg

steppenwolf

Sending alerts over WiFi network

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?

Share this post


Link to post
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.

Share this post


Link to post
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.

Share this post


Link to post
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 :-\

Share this post


Link to post
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
 

Share this post


Link to post
Share on other sites

Glad you got it working. I may just give this a go myself. Not that I do my imaging unattended really, it's just fun to have a go with new tricks! :)

Share this post


Link to post
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

Share this post


Link to post
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.

Share this post


Link to post
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

Share this post


Link to post
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.

Share this post


Link to post
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:

Share this post


Link to post
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.

  • Like 1

Share this post


Link to post
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.

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


  • Recently Browsing   0 members

    No registered users viewing this page.

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.