8

I make home micro-server (based on Raspberry Pi). It has Internet and works 24/7. The server make some home automation, monitoring and control. It has no static public IP address (it's assigned via DHCP).

I need a way to remotely communicate with the server: I want to send short commands to the server and sometimes get replies.

What are best way to do it? I know a few ways:

  1. Email. I can register an email address with pop3/smtp access for the server and use it to communication. But there is a problem: it's not instant, so it's difficult to make instant transaction, critical reports to me, etc.

  2. SMS. I can connect old GSM-phone or GSM-module to my server and use SMS for communication. It's instant and seems to be OK, but I never worked with GSM and don't know all possible problems.

Help me with a advices, please. If you have already solve the problem for your own server, explain me please its communication way.

2 Answers2

3

Create an account at ANY Dynamic DNS server website. I used dnsdynamic.com as example for simplicity

Open a terminal on your Raspberry Pi and install the update service:

sudo apt-get install ddclient

You can type in settings during the wizard or just press enter. We will edit the configuration file any way.

Edit the configuration file /etc/ddclient.conf and replace everything in it with this:

#
# Configuration file for ddclient generated by debconf
#
# /etc/ddclient.conf
daemon=60                          # check every 60 seconds
syslog=yes                         # log update msgs to syslog
mail=root                          # mail all msgs to root
mail-failure=root                  # mail failed update msgs to root
pid=/var/run/ddclient.pid          # record PID in file.
ssl=yes                            # use ssl-support.
use=web, web=myip.dnsdynamic.com   # get ip from server.
server=www.dnsdynamic.org          # default server
login=[LOGIN]                      # your login
password=[PASSWORD]                # your password
server=www.dnsdynamic.org,         \
protocol=dyndns2                   \
[DOMAIN]

Replace the following [LOGIN], [PASSWORD] and [DOMAIN] with the setting you used.

Save the changes made to the config file, and restart the Raspberry Pi.

Remember to configure your router to forward the necessary ports to your Raspberry Pi.

  1. 21 - FTP
  2. 80 - Web server
  3. 443 - SSL

Piotr Kula
  • 17,336
  • 6
  • 66
  • 105
0

Another option is have your front-end hosted on an internet webserver (and/or apps on your mobile devices) and use a message queue to communicate between them all.

Message queues allow redundancy and abstraction between the front-end(s) and back-end(s)

MQTT is designed for the task and is free

https://en.wikipedia.org/wiki/MQ_Telemetry_Transport

back_ache
  • 101
  • 1