logo elektroda
logo elektroda
X
logo elektroda

Controlling Relay Output via Email Commands from Predefined Address—Affordable Solutions

Berr1972 105 2
ADVERTISEMENT
  • #1 21570738
    Berr1972
    Level 1  
    Hello,
    I'm looking for a reasonably priced way to be able to control a relay output via email, obviously from a predefined address, based on a predefined command (whether in text or in the subject of a message).

    In a similar way to how we control the control panel with SMS commands, here, for various reasons, the only control option is via e-mail. It would need to be controlled over LTE
    Have any of you dealt with this subject?
    AI: Could you specify the intended use case or environment for this relay control (e.g., home automation, industrial application, remote monitoring, etc.)?
    Industrial Application
    AI: Do you already have any hardware in place (such as a relay module, microcontroller, or LTE modem), or are you looking for a complete ready-made solution?
    NO, complete solution
  • ADVERTISEMENT
  • #2 21570848
    gulson
    System Administrator
    I haven't come across a ready-made solution. You might want to think about a Raspberry Pi solution that reads the mailbox via IMAP using a script in Python. This script can drive the GPIO output. Similarly you could do on OpenWRT software maybe with a Teltonika TRB141
  • #3 21571857
    _jta_
    Electronics specialist
    You can also use a "terminal" (such a minicomputer) - only you need to find one that is reasonably PC-compatible, and has enough RAM and Flash to install some mini-Linux on it. I've been using something like this as a DHCP+DNS server, it's been running for over 10 years now, it has 256M RAM (60% used), 256M Flash (93% used), the system is Slitaz, however TinyCore is probably better (lower requirements, greater choice of programs). I had a Rasbberry Pi permanently on and after about 4 years it died. But the advantage of the TinyCore is lower power consumption.

    Software: can be IMAP protocol from Python, or Pascal (I have the impression that almost 6 years ago I adapted some program in Pascal to download mail - I think I took the sources of the imapcopy package and changed a bit); there is also a program fetchmail - maybe it will fit? Anyway, what you need is to download the mail from the server, and then read the mails - maybe with a program in Python, you need to check who the mail is from, and if it's from an authorised sender, then look for an action command with relay in it.

    This 'terminal' doesn't have a GPIO, like the Raspberry, but it does have ports - the one I used has a serial port (RS232) and a printer port (Centronix 25-pin socket, with TTL signals). Access to the printer port: you probably need a "parport" module, and a copy of something from /dev/ (I can't remember if /dev/lp0, or /dev/parport0, for example), you can give the user the right to write to that copy so you don't have to act as "root" (administrator under Linux). Under Windows (many terminals have Windows, with a licence) you can also somehow, but I don't remember much. The serial port can also be used, I used it to feed signals to the stepper motor driver (enable, direction, step - the latter via TxD).
ADVERTISEMENT