Push notifications

Hi volks

I am looking for a way to send push notifications. Like for example door or window open. Is there a concrete approach in xod to implement something like this?


That depends on how you want to “push notifications”. Turning on an alarm or LED is easy. Sending a text or email is probably possible with an internet connection, but not so easy…

Easy can anyone I prefer the hard way :slight_smile:
I would actually like to receive an e-mail and an internet connection with router is available on site.
I would be very grateful for a suggestion on how to implement it

First you will need an Arduino that supports networking. There is a xod/net section that provides basic network functions, but does not provide a wrapper for email. There are several ways to deliver email, most of which require access to some sort of mail relay or gateway. SMTP through an open relay would probably be the easiest to implement using basic network functions, but does require the open relay… Other options include IMAP and POP (with variations available on both of these) as well as HTTP/HTTPS or custom API. A completely different direction would be to use serial connection back to computer & have the computer send the email when input is received; the input could be subject or body of email (but that just moves the programming for email from Arduino to the computer…)

Unfortunately, there are no built-in methods or libraries to help you with sending email, so it will not be trivial if you do not already understand how email delivery works. Sending email used to be pretty trivial, but SPAM ruined that. If you managed to find an open email relay on the internet, there is very little chance anyone would accept your email because spammers will be using it & most of the internet will have it black-listed. Using any reputable existing mail relay will require you to have an account to authenticate with to send the email (i.e. gmail, aol, yahoo, etc.). If you have to use encryption for your chosen mail relay, coding on the Arduino becomes even harder.

Sorry to be so depressing. While it is possible to send email from Arduino, it is not trivial & a newbie trying to do it on their own is not likely to succeed. If you have some programming experience and a low-level understanding of networking, you stand a pretty good chance. Things might go a little better if you can find an existing Arduino IDE library that can be wrapped to work from within XOD, but wrapping libraries is not trivial either. Having so many options for sending email makes creating a generic solution that can be shared even more challenging.

XOD is great for beginners linking together existing nodes and libraries, but having to abstract out some of the complexities while creating new nodes can make extending XOD a little trickier…

Thank you for taking so much time to clarify the possibilities.
My experiences with XOD and the comiunity are only positive. XOD is in my opinion not only suitable for beginners, because it is very similar to programs that already exist for over 20 years and work on the basis of logical graphic links. For example the programming of Siemens PLC (FBS / Function block diagram). I see XOD more as programming for all e.g. Low Code / No Code from SAP ( No-code development platform). Not everyone needs to know coding, but creating logical sequences should be an easy task for most people. XOD should be more known, but it lacks a channel on Youtube/Instagram on which every week is shown how easy it is to implement something without coding skills.

Again to my question: Would it be easier to send push notifications if you have your own mail server?
Or a website that sends emails without a query?

If you have a mail server that will relay SMTP email for you without authentication, then it just becomes a simple matter of connecting to port 25 and sending a series of lines ending with Carriage Return. At a minimum, you should have:

helo <my hostname>
mail from: <from address>
rcpt to: <to address>

The period (.) on a line by itself is the end of the data command. <message> should contain the following (but you might be able to get by with less):

From: <from address>
To: <to address>
Subject: <email subject>

<actual text of message>

Ideally, you would check response after each command, but you can probably get away with ignoring responses and hoping there are no errors.

Although I have lots of email experience, I don’t have an Arduino capable of network connection, so I haven’t worked with that at all.

FYI: although you can setup a mail server of your own without much trouble, getting your destination servers to accept email from it instead of blocking it as a likely source of SPAM can be tricky. This is why something like a gmail account is often used to send the email, but that requires authentication before sending the email and adds complexity to your Arduino code.