0
\$\begingroup\$

I've got a pet project in which I'm trying to write/build a self learning autopilot for my rc plane. I've got a Raspberry Pi with an IMU and a pitot tube in the plane and it can now control the servos of the plane. So far so good.

I'm now thinking about connectivity. I want to be able to send commands in json from my laptop to the Raspberry Pi in the plane. I got it working over wifi, but that means I need to take my router outside when I go flying. Plus the range of the wifi is not very good (I tested it outside and it comes to about 50 meters).

Conventional rc transmitters and receivers have way better ranges (up to 1000 meters) than my wifi from the router does, so I'm wondering how I can leverage that technology. I see plenty of rc receivers around to buy, but they all work with a number of channels, instead of a data link over which you can send arbitrary data/json. I searched around for things like "raspberry pi rc receiver" and "USB rc receiver" but apart from some tips on how to turn your raspi into a transmitter to an rc car (for which I don't know the range), I can't find anything about longer range receivers for the pi, or rc transmitters to attach to my laptop with which I can just send and receive arbitrary json.

Does anybody know whether there are any simple modules which I can attach to my raspi and laptop to send json with this rc technology to and from the pi over a range of at least 200 meters? All tips are welcome!

\$\endgroup\$

closed as too broad by brhans, Chris Stratton, laptop2d, Finbarr, Dwayne Reid Jan 6 at 17:15

Please edit the question to limit it to a specific problem with enough detail to identify an adequate answer. Avoid asking multiple distinct questions at once. See the How to Ask page for help clarifying this question. If this question can be reworded to fit the rules in the help center, please edit the question.

  • \$\begingroup\$ tiny antennas have tiny areas to gather in the EM energy. You need to use a much lower frequency than WiFi. \$\endgroup\$ – analogsystemsrf Dec 25 '18 at 0:31
  • 1
    \$\begingroup\$ Most serious hobby RC gear uses the nRF24, its semi/compatibles, or incompatible competitors like the A7105 or (EOL) CYRF6936. But a pi is a grossly unsuitable choice for an autopilot. That is a job for an MCU with a simple software stack, not a desktop OS running off a flaky SD card. You also don't want json for control, rather compact binary packets. \$\endgroup\$ – Chris Stratton Dec 25 '18 at 1:14
  • \$\begingroup\$ You will find the USB WiFi antenna's have much more range, but it will cost you a USB port on your Rpi, and a change in some files so eth0=wlan0, and shutdown the internal WiFi. The whip antenna may imbalance your rc plane. The above comments are important as well. Just creating a control panel (in Python 3) to flash some LED's in sequence used 10% of the CPU's resources. The Pi is a toy for children. It is not even a complete basic motherboard. It has no RTC. It has no shutdown sequencer unless you buy one as a pi-hat. It has no multi-task queue. Fast interrupts can damage the SD card. \$\endgroup\$ – Sparky256 Dec 25 '18 at 2:39
  • \$\begingroup\$ @analogsystemsrf - but I see systems such as the Flysky fs-i6 with the FSiA6B receiver, which operate on 2.4GHz but according to some reviews still manage to get a range of 400meter to 4km on a clear day. Wifi is also on 2.4GHz, so why shouldn't I be able to get such a range? \$\endgroup\$ – kramer65 Dec 25 '18 at 6:19
  • \$\begingroup\$ Look at LORA modules. (ICs available but modules better cost/benefit). One example. and A zillion examples \$\endgroup\$ – Russell McMahon Dec 25 '18 at 10:34
1
\$\begingroup\$

WiFi should be able to work well for your application.
ESP8266, ESP32 and their kin should be suitable. Operation with external antennas at 2.4 GHz can achieve ranges of many km - especially in ground to aerial operation.


But, look at LORA ("Long Range") modules which should easily meet your needs.
LORA - Wikipedia. Ranges of "over 10km in rural areas" are cited (antennae unspecified) but there is every reason to expect that this range can be exceeded in ground to air operation with 'sensible' antennae.

LORA utilises 'spread spectrum' techniques to achieve astounding-but-true real-world link budgets of typically 168 dB. eg -148 dBm RX levels at 100 mW tx power (!).

ICs are available but modules offer vastly better cost-benefit. There are numerous on web Raspberry Pi + LORA related pages.

One example.

A zillion examples

Digikey - LORA modules - wow!!!

Seeed Studio module from Digikey - $US7.91/1 in stock (!)

Datasheet for above - github

Raspberry Pi LORA-GPS module - $35 Digikey. Adds LORA to RasPi and can add GPS functionality with GPS input to RasPi serial port. When are you buying one ? :-).

Wiki for above

LORA alliance home page - more for reference.


LORA SPECIFICATION

Lora Specification for above RasPi module:

168 dB maximum link budget. <- !!! (!!!!!) +20 dBm - 100 mW constant RF output
+14 dBm high efficiency PA.
Programmable bit rate up to 300 kbps.
High sensitivity: down to -148 dBm. <- natural consequence of power and link budget
Bullet-proof front end: IIP3 = -12.5 dBm.
Excellent blocking immunity.
Low RX current of 10.3 mA, 200 nA register retention.
Fully integrated synthesizer with a resolution of 61 Hz.
FSK, GFSK, MSK, GMSK, LoRaTM and OOK modulation.
Built-in bit synchronizer for clock recovery.
Preamble detection.
127 dB Dynamic Range RSSI.
Automatic RF Sense and CAD with ultra-fast AFC.
Packet engine up to 256 bytes with CRC.
Built-in temperature sensor and low battery indicator.

\$\endgroup\$
  • \$\begingroup\$ Thanks for your suggestions. I don't think Lora would meet my needs, because it's more designed for very low traffic sensors. I need to be able to constantly send and receive messages to and from the rc plane. I check out the wifi modules you suggest. I'm currently trying with a Ralink RT5370 ( s.click.aliexpress.com/e/cmDKvGPex) but that only gives me a range of about 75meters. Do you think the ESP8266 or ESP32 will give a better result? I mean: isn't my router also a limiting factor here? \$\endgroup\$ – kramer65 Dec 25 '18 at 12:12
  • \$\begingroup\$ Not really, neither wifi nor LoRa is really suited for this. Not wifi because it has too much overheard and drastically too much state, and is optimized for speed not range. LoRa could be used in some edge cases, but in general is not on suitable frequencies for the data rates needed, and is really designed for range cases beyond what would be permitted here anyway. There are sound reasons pretty much all unlicensed-operator aircraft systems today use simple 2.4 GHz packet radios - re-inventing things without considering the factors that lead to those decisions is unwise \$\endgroup\$ – Chris Stratton Dec 25 '18 at 14:15
  • \$\begingroup\$ @Kramer I'll beg to differ with SOME of your & ChrisStratton's perspectives. LORA is NOT a super low data rate, low energy use system (such as BLE et al). You'd note in the outline spec that I included a bit rate of up to 300 kbps (although that's 'cheating' as it relates to a lower link budget mode). . The RaLINK system is much more like the systems that Chris is objecting to. LORA is far closer to "bare metal" from the users perspective - regardless of what happens inside. | What minimum mean continuous data rate do you consider essential? \$\endgroup\$ – Russell McMahon Dec 26 '18 at 11:24
  • \$\begingroup\$ I need a data rate of somewhere between 20kb and 80kb (I'm still building, so not exactly sure yet). I never seriously considered Lora because of its purpose of low traffic sensors I always read about. I actually have a Lora Pi hat laying around which I haven't used yet. But as far as I know Lora does not support simulataneous bidirectional messages right? I thought a Lora module either sends OR receives at any given time. Or am I not correct? \$\endgroup\$ – kramer65 Dec 26 '18 at 14:14
  • \$\begingroup\$ If you read an actual Semtech data sheet the high data rates modes of LoRa chips are legacy FSK, not LoRA. There are differences between what you learn about a technology from a module's marketing blurb vs spending months and months working with it. \$\endgroup\$ – Chris Stratton Dec 28 '18 at 14:43

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