Cosmostreamer wired for DJI gimbals - Assembly instruction

If you have basic skills in dealing with the Raspberry Pi microcomputer, you can download a ready image of Cosmostreamer and try to make your own box. But a license still have to buy, otherwise will not work connect to DJI gimbals.



Required parts list

1. Raspberry Pi Zero 1.3 or W

Raspberry Pi Zero 1.3

2. MicroSD card 4Gb or more

3. CAN-adapter

CAN-adapter based on MCP2515

4. Quartz oscillator

16 MHz quartz oscillator

5. Camera adapter

For DJI Osmo cams (X3 black) connection a DJI Osmo gimbal extension (part89) needed. Inspire cams also can be connected, but for X5/X5R needed a Osmo X5 Adapter


Fore DJI Inspire 1 cams (X3 white, X5, X5R) better to use a DJI Inspire 1 Part 41 Gimbal Mount & Mounting Plate (part41)

and wires DJI Inspire 1 Fast Mounting Gimbal Port Cable (part17)

6. Box

For example, 3D printed. You can download a 3D model and print it by yourself.

7. For soldering

Soldering iron, solder, wires. A little bit of soldering still have to.



Basic assembling

1. Download ZIP-archive with microSD card image,

2. Extract .img file from downloaded ZIP archive

3. Write .img file to microSD card. Use Win32DiskImager application, or any other, that can write images

3.1 If you already has license key - you can install it on microSD card (how to)

4. Insert microSD card into Raspberry Pi Zero

5. Ok, basic assembly is done. Now power on Raspberry Pi Zero (5V on micro-USB power port), it must start booting.

6. After boot ended HDMI will show something like this:

"Bad license key" message means license key wrong or absent. In the bottom left corner message contains Raspberry Pi Zero serial number and Cosmostreamer Wired application version.

Without correсt license key all features will work, except camera control and video connection



License key

For normal Cosmostreamer Wired operation license key needed. It is a small string, those written in file /boot/license.txt on microSD

At the current time there is no automatic key retrieve system. So you need to send e-mail to Please, specify a serial key of you Raspberry Pi (see on HDMI on bottom-left corner) and your PayPal account in this e-mail. I will issue a bill for payment and after payment i will send you a license key for Cosmostreamer Wired on your Raspberry Pi Zero.

The license key is unique for each Raspberry Pi Zero!

For install new license key, plug microSD card with flashed firmware image (see. chapter 3) into a PC card-reader. Operating system will discover a this card. If you OS is Windows - it will be a disk with label "boot". Copy a file license.txt from letter on this disk.




Software update

When i fixing bugs or adding some features to Cosmostreamer application, i make a special file for update. You not needed to rewrite microSD card, you can just install update file.

1. Download update file by this link (add link). Change log and old versions here.

2. Insert microSD with firmware to your PC. If you OS is Windows - it will be a disk with label "boot".

3. Copy downloaded update file onto this disk

4. Eject microSD card from PC and plug back to Raspberry Pi Zero

5. Power on your Raspberry Pi Zero. Boot will start, during this firmware will be updated and automaticaly restarted.



Common basic connection scheme

For a basic features just a CAN bus and USB needed.



CAN-bus connection

Raspberry Pi Zero has no an own CAN-bus, so we need to connect a CAN-adapter (small MCP2515 based board).

1. Replace quartz oscillator on MCP2515 board. In stock there is a only 8Mhz crystal, but we need a 16MHz. Unsolder 8MHz and solder 16MHz crustal. It is easy, just two pins.

2. Connect MCP2515 board to Raspberry Pi Zero. DON'T FORGET TO CUT A LANE HOW IT DRAWED ON IMAGE.

Now we have a two CAN output wires: LO and HI. Later we will connect them to camera.



USB connection

More easy than CAN. Just connect Raspberry Pi's USB and DJI camera connector.

Here is two variants. Use standart Raspberry Pi's micro-USB connector, or solder wires to solder points on back side of Raspberry Pi Zero.

1-st variant. Using a micro-USB connector.

2-nd variant. Soldering to a solder points.



Camera conection

DJI cameras for Osmo or for Inspire 1 has a own connector, with some differencies. X5/X5R can't be connected directly to Osmo connector, because the ring is some more than needed. Need to use a Osmo X5 adapter.

Osmo cams (X3 black) can't be connected to a Inspire 1 camera mount, because there is no some pins (control will be work, but not a video).

Connection with Osmo adapter has advantage - more cable length from Raspberry Pi Zero to camera, up to 1.5 meters long.

With a Inspire adapter maximum USB and CAN cable len from Raspberry Pi Zero to camera - around 20 cm. If more - video will be choppy or not be work.



With Osmo adapter

Take a Osmo adapter (DJI Osmo gimbal extension (part89)).

We need only female connector, cut on length that you want.

Cable pinout:
Red, GreenPower + (12-26V)
Black, Brown thickPower GND
Thin silverUSB GND
Thick silverPower GND
YellowUSB D+ (Ambarella)
WhiteUSB D- (Ambarella)
Red thinUSB D+ (DM368)
BlueUSB D- (DM368)
Brown thinCAN HI

CAN HI и LO used for control commands and telemetry.

USB D+ D- (Ambarella) и USB GND used for video receive from Osmo cams X3 black, X3+ black

USB D+ D- (DM368) и USB GND used for video receive from cams X3 white, Z3, X5, X5R

Connect wires with same names, USB wires or for DM368 or for Ambarella.



With Inspire adapter

Easy. 10-pin connector - for camera power. From 12 to 26 Volts. 8-pin connector - for USB и CAN.



RC receiver connection


All channels are connected with the example for Turnigy 9X. Mode 2. Model type: Acro

Channels set-up

channel 1 - PAN
channel 2 - ROLL
channel 3 - TILT
channel 4 - ZOOM (if supported)
channel 5 - (AUX-CH "GEAR") - RECORD
channel 6 - (AUX-CH "HOV THRO") - EV compensation
channel 7 - (AUX-CH "THRO HOLD") - MENU (labeled as CENTER on image)
channel 8 - (AUX-CH "HOV PIT") - MANUAL FOCUS (if supported)

Need to enable auxillary channels in Turnigy settings. Enter menu, part "AUX-CH" and set values:

For another remote control system - read it's manual, how to set-up auxillary channels.

Don't forget to enable RC in Cosmostreamer Wired config file. After transmitter is powered on HDMI will show "RC calibrating" message. Near will be axis values shown. It was made for easy config. Check channels with my scheme.

Channels calibrating is at first transmitter power on. Need to move left and right stick up-down, left-right to minimal and maximal position. And rotate EV and FOCUS to min max position. After this calibrating is over. Move pan/tilt stick to down-left position and quckly release. All message for RC will be hidden. Normal working mode is on.



Custom I2C joystick



Camera shield

For camera mechanical protection motorized shield control supported. Shield automatically opens when photo or video recording is active and automatically closes after timeout (shield_timeout param in config file)



Config file

Cosmostreamer Wired settings saved in file /boot/cosmostreamer-wired.conf. It is a usual text file, which can be edited. You can insert microSD into card-reader and edit this file.

Config parameters description

Parameter Description
disabled=0 Run Cosmostreamer wired application at boot or not. Used for debug.
0 - run
1 - don't run
camera_type=0 Camera type
0 - X3 black (from Osmo)
1 - X3 white, Z3, X5, X5R
device_mode=0 Camera work mode
0 - as Osmo (always horizontal)
1 - as Inspire (free movement)
cooperative_mode=0 Cooperative mode
0 - without Inspire flight controller
1 - with Inspire flight controller
control_enabled=1 Camera control
0 - disabled
1 - enabled
hdmi_enabled=1 Use HDMI or TV-out
1 - show video on HDMI
0 - show video on TV-out
rc_input_enabled=0 0 - do not use RC receiver
1 - use RC receiver
rc_input_speed_pan=100 Pan speed for RC receiver. From 0% to 100%.
rc_input_speed_tilt=100 Tilt speed for RC receiver. From 0% to 100%.
rc_input_speed_dutch=100 Dutch speed for RC receiver. From 0% to 100%.
i2c_input_enabled=0 0 - do not use I2C joystick
1 - use I2C joystick
i2c_input_speed_pan=100 Pan speed for I2C joystick. From 0% to 100%.
i2c_input_speed_tilt=100 Tilt speed for I2C joystick. From 0% to 100%.
i2c_input_speed_dutch=100 Dutch speed for I2C joystick. From 0% to 100%.
osd_enabled=1 1 - show OSD
0 - don't show
hud_enabled=1 1 - show HUD
0 - don't show
osd_borders=30 Set the height of top and bottom black borders below telemetry on HDMI
osd_top_offset=20 Set the vertical top offset 20 pixels for top-sided text labels on HDMI
osd_bottom_offset=20 Set the vertical bottom offset 20 pixels for bottom-sided text labels on HDMI
shield_enabled=0 0 - don't control a camera shield
1 - control a camera shield
shield_timeout=0 Time (in seconds) for automatical shield close
shield_open=1950 PPM position of servo for shield in opened state (in microseconds)
shield_close=1000 PPM position of servo for shield in closed state (in microseconds)