amiga-dev-kit FPV example
Link to FPV/code.py
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.
Check out the video from our first farm test!
Downloadable PDF of the diagram found here
There are two discrete radio links in this setup:
- Analog video stream
- 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:
Description | Recommendation | Purchase Link | Price |
---|---|---|---|
Microcontroller kit | farm-ng microcontroller kit | farm-ng store link | $100 |
Radio control receiver | FrSky x8r | Amazon link | $40 |
Radio remote control | FrSky Taranis X9D Plus SE 2019 | Amazon link | $300 |
Remote control battery | 7.4V 3000mAh 8C 2S LiPo Battery | Amazon link | $20 |
FPV video camera | Inexpensive and works | Amazon link | $25 |
FPV video transmitter/receiver | Inexpensive and works | Amazon link | $30 |
Small FPV video screen | LCD 5802D 7" Receiver Monitor | getfpv link | $90 |
DC/DC Buck converter - 24v to 12v | Amazon Link | $15 | |
DC/DC Buck converter - 24v to 5v | *This comes with our microcontroller kit | Amazon Link | $11 |
Alternate step down, cheaper/smaller option | Will required a voltmeter to adjust output | Amazon link | $8 |
Enclosure | Hammond 1554 JGY (abs, gray, solid lid) | Mouser Link | $14 |
Cord grip kit | We used a single PG-13.5 | Amazon Link | $22 |
VHB Double-stick tape for mounting stuff | Our favorite | Amazon 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 battery | This should work (not tested) | Amazon Link | $15 |
- 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)
- SBUS (which is compatible with UART ports on the
- The recommended video transmitter/receiver requires an old-school RCA capable monitor on the receiver side, we recommend one above
What is SBUS?
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
Shown above, is the entire receiver rover side of the FPV setup, correctly wired and unpacked. See also the wiring diagram above.
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
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.
- Connect your microcontroller to a PC
- Drop the
code.py
file and thelib/
folder directly into the root of the mounted CIRCUITPY drive.
Running the example
- Wire up the SBUS
- From
amiga-dev-kit/circuitpy/
, drop thecode.py
file and thelib/
folder directly into the root of the mountedCIRCUITPY
drive. - Connect the microcontroller to the Amiga's canbus
- Enable
Auto mode
on the Amiga's dashboard - Request
Auto Active
mode by pushing the left joystick all the forward.- You should now see the
Auto Active
mode enabled (green).
- You should now see the
- Use the right joystick to enjoy driving the Amiga remotely!