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

  • some sort of radio – Jaromanda X Sep 15 '19 at 2: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 adafruit.com/product/3071 (2) Amateur Radio Wiki amateur-radio-wiki.net/index.php?title=What_is_Amateur_Radio%3F (3) Amateur Radio Intro ethw.org/Amateur_Radio (4) Amateur Radio Frequency Allocations en.wikipedia.org/wiki/… – tlfong01 Sep 15 '19 at 3: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) raspberrypi.stackexchange.com/questions/102239/…. (2) raspberrypi.stackexchange.com/questions/55382/…. – tlfong01 Sep 15 '19 at 6: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 2: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 2:32

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

  • 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 1: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 1: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 1: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 1: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 8:46

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.