Skip to main content

amiga-dev-kit FPV example

fpv-in-truck-16x9-reduced

tip

If you have not gone through any of our examples yet, you should start with the Hello Main Loop example.

This example shows how to connect inexpensive off the shelf FPV equipment to your Amiga to enable realtime video streaming and teleoperation through remote control. This makes the Amiga remotely operable from the comfort of your office (or cab of your truck) and we're pretty psyched by how low cost and practical FPV control of the Amiga is.

Hot off the press!

Check out the video from our first farm test!

fpv_wiring_diagram

Downloadable PDF of the diagram found here

There are two discrete radio links in this setup:

  1. Analog video stream
  2. Digital data stream (abstracting a UART serial connection via this simple but perhaps esoteric SBUS format)

As such, there are two transmitters, and two receivers as shown in the diagram above. They are completely separate from one another, with exception to their shared power sources.

Parts required:

DescriptionRecommendationPurchase LinkPrice
Microcontroller kitfarm-ng microcontroller kitfarm-ng store link$100
Radio control receiverFrSky x8rAmazon link$40
Radio remote controlFrSky Taranis X9D Plus SE 2019Amazon link$300
Remote control battery7.4V 3000mAh 8C 2S LiPo BatteryAmazon link$20
FPV video cameraInexpensive and worksAmazon link$25
FPV video transmitter/receiverInexpensive and worksAmazon link$30
Small FPV video screenLCD 5802D 7" Receiver Monitorgetfpv link$90
DC/DC Buck converter - 24v to 12vAmazon Link$15
DC/DC Buck converter - 24v to 5v*This comes with our microcontroller kitAmazon Link$11
Alternate step down, cheaper/smaller optionWill required a voltmeter to adjust outputAmazon link$8
EnclosureHammond 1554 JGY (abs, gray, solid lid)Mouser Link$14
Cord grip kitWe used a single PG-13.5Amazon Link$22
VHB Double-stick tape for mounting stuffOur favoriteAmazon Link$15
Micro-grip rod (monitor to controller hack)B&H Link$8
Micro-grip head (monitor to controller hack)B&H Link$48
Charger for the RC controller batteryThis should work (not tested)Amazon Link$15
info
  • We chose the FrSky x8r radio receiver because it supports:
    • SBUS (which is compatible with UART ports on the Amiga Dev Kit microcontroller)
    • Sending telemetry for two way communication (note: this tutorial only demonstrates one-way communication - joystick to rover)
  • The recommended video transmitter/receiver requires an old-school RCA capable monitor on the receiver side, we recommend one above

What is SBUS?

SBUS references

This topic is explained more thoroughly on: Uninverted SBUS and Smart Port on Frsky Receivers

We also recommend watching this video overview on SBUS, that visually explains inverted vs. non-inverted uart and packet structure.

The SBUS protocol is fairly simple.

  • A 25 byte packet
    • start byte of 0x0F
    • 16x 11-bit integers packed into the rest
    • second to last byte is a parity byte
    • end byte of 0x00

This is a useful resource for decoding the packets

The UART needs to be configured with:

busio.UART(None, board.RX, baudrate=100000, bits=8, parity=0, stop=2, timeout=0.002, receiver_buffer_size=256)

TODO support TX over the x8r smart bus.

Wiring

fpv wiring example Shown above, is the entire receiver rover side of the FPV setup, correctly wired and unpacked. See also the wiring diagram above.

caution

SBUS is "inverted" UART, we want the un-inverted signal. So need to do a little hardware hacking...

The only aspect of the wiring that is not obvious in the wiring diagrams, is that in order to get a non-inverted UART signal out of the RC receiver on the rover side, you need to open the enclosure and solder a wire to one of the test points on the PCB as shown below. So we cracked open the x8r receiver, and soldered a wire directly to the output pin before it gets inverted, and connected this wire to UART RX pin on the Feather.

Wiring the receiver to access the un-inverted signal

x8r-receiver-solder-point-reduced PXL_20220818_203916771 Screen Shot 2022-09-09 at 3 05 53 PM PXL_20220818_204444320 PXL_20220818_204942366 PXL_20220818_204956620 PXL_20220818_205352767 MP PXL_20220818_214950616

Pairing the Taranis to the X8R Receiver

This video does a great job of demonstrating this process and can be found here. If the X8R displays a solid green light, you have successfully paired the two and can move on to the next step - setting up the Feather to read the commands sent from the joystick, and pass those over Canbus to the Amiga dashboard / controller to command the robot.

Code

The code for this example can be found here and builds on top of the hello_main_loop example, but replaces the keyboard input with radio control. Installing the example code.py file & lib/ directory follow the same procedure.

  1. Connect your microcontroller to a PC
  2. Drop the code.py file and the lib/ folder directly into the root of the mounted CIRCUITPY drive.

Running the example

  1. Wire up the SBUS
  2. From amiga-dev-kit/circuitpy/, drop the code.py file and the lib/ folder directly into the root of the mounted CIRCUITPY drive.
  3. Connect the microcontroller to the Amiga's canbus
  4. Enable Auto mode on the Amiga's dashboard
  5. Request Auto Active mode by pushing the left joystick all the forward.
    • You should now see the Auto Active mode enabled (green).
  6. Use the right joystick to enjoy driving the Amiga remotely!