1

I want to control my Raspberry Pi from a long distance not using WiFi and be able to send my data to it and receive data from it distance could be like 12 kilometres for more than it and and if possible w.hat is the cheapest way to do it

MatsK
  • 2,478
  • 3
  • 12
  • 20
  • some sort of radio – Jaromanda X Sep 15 '19 at 02:14
  • 1
    @Atharva Patil, Ah, let me see. AdaFruit's 433/900 mHz toys can only do <500m. For >12km, you need to play with Ham Radio. (1) 433Mhz RF Transceiver 500m - AdaFruit https://www.adafruit.com/product/3071 (2) Amateur Radio Wiki http://www.amateur-radio-wiki.net/index.php?title=What_is_Amateur_Radio%3F (3) Amateur Radio Intro https://ethw.org/Amateur_Radio (4) Amateur Radio Frequency Allocations https://en.wikipedia.org/wiki/Amateur_radio_frequency_allocations#Very_high_frequencies_and_ultra_high_frequencies – tlfong01 Sep 15 '19 at 03:04
  • Though ham radio communication is almost free (need an operator license), the initial investment of the radio equipment is high, comparing to 433MHz transceiver modules. A cheaper initial investment way is to buy a GSM/LTE/3G/4G SIM800 module. You can search this forum for "SIM800" to find more details on using this SIM800 (need suscription) card wtih Rpi: (1) https://raspberrypi.stackexchange.com/questions/102239/response-to-a-incoming-call-using-python-script/102243#102243. (2) https://raspberrypi.stackexchange.com/questions/55382/how-to-connect-sim800-gsm-add-on-to-raspberrypi-3. – tlfong01 Sep 15 '19 at 06:25
  • @Atharva Patil, Your "sending and receiving data from it" is vague. Is data text/binary/image/files? Then any FTP server can do. If need friend user interface, then a http server entertain HTML etc. For long range, you can break fire wall and proxes using good guys and bad guys' methods. A hobbyist like me, and new to ftp/http servers, can start playing with PureFTPd, a humble ftp server that is easy (relative to Apache, I mean) for newbie to set up and use. The basic PureFTPd is safe to use within a home Ethernet (no WiFi). Of course you bad guys can break jail and FTP anywhere, ... :) – tlfong01 Sep 16 '19 at 02:15
  • So you want to "control" the Rpi far away? There are many good, bad, and evil ways. I am a good guy, now brainstorming a way to "control" the rpi over there, with Pure-FTPd. You can ftp a "control command" text file to the FTP folder 12km away, where a python program looping to check if any file coming up, read/decode control commands in file and do clever things. Of course your friends may LOL and ask you why not use advanced TCP sockets etc etc. In order not to lose face, you can say: "OK, OK, but socket programming is tedious, not so secure as my Pure-FTPd, blah, blah, blah, ... – tlfong01 Sep 16 '19 at 02:32

1 Answers1

1

You can connect the Raspberry Pi with an ethernet cable to an internet router and then use OpenVPN to communicate with it.

Ingo
  • 40,606
  • 15
  • 76
  • 189
  • I don't know Open VPN, so I wikied and made a summary: (1) (*) Open-source (GPL) commercial, using VPN to create point-to-point or site-to-site connect in routed or bridged configurations and remote access facilities, (*) Available in Linux, macOS and Windows, Windows Mobile, iOS, Android, (*) Uses SSL (256bit)/TLS (rather than IKE, IPsec, L2TP or PPTP) for key exchange (*) , / to continue, ... – tlfong01 Sep 16 '19 at 01:40
  • (2) (*) Capable of traversing NAT, (*) Allows peers to authenticate each other using pre-shared secret keys, certificates or username/password (*) Uses OpenSSL, can setup HMAC Firewall, Support mbed TLS, (*) Supports IPv6 VPN inside tunnel, (*) Can work through most proxy servers (including HTTP), (*) Good at working through network address translation (NAT) and getting out through firewalls, (*) Server can push configuration options to the clients, including IP addresses, routing commands, / to continue, ... – tlfong01 Sep 16 '19 at 01:41
  • (3) (*) Offers networking interfaces with universal TUN/TAP driver, (*) Can create layer-3 based IP tunnel (TUN), or layer-2 based Ethernet TAP that can carry any type of Ethernet traffic, (*) Can compress data stream using LZO, (*) Use IANA assigned port 1194, (*) Uses TCP and UDP, desirable alternative to IPsec in situations where an ISP may block specific VPN protocols, (*) When using TCP tunnel, performance might be bad if un-tunneled link bad, causing TCP meltdown, (*) Runs in userspace instead of requiring IP stack (kernel) operation, / to continue, ... – tlfong01 Sep 16 '19 at 01:43
  • (4) (*) Able to drop root privileges, prevent swapping sensitive data to disk, enter a chroot jail after initialization. (*) Spport PKCS11-based cryptographic tokens smart cards. My conclusion is that OpenVPN is good for me, for the following reasons: GPL, Windows/Linux/Android/PKC11 smart card OK, can jail break firewalls, proxies. I am a hobbyist doing Micky Mouse projects, So I don't care much about security, but using OpenVPN can let me show off that I have heard of weird names I don't understand: NAT, SSL, TLS, LZO, HMAC, TUN, TAP, IANA, ... – tlfong01 Sep 16 '19 at 01:50
  • @tlfong01 You are right. OpenVPN is very popular for really secure communication. Its also frequently used by professionals and in enterprises. Because it's open source it is very unlikely that it has backdoors. – Ingo Sep 16 '19 at 08:46