iMX6 TinyRex – Streaming video input over WiFi

On this page you can find steps how to send HDMI Input video over WiFi. Then we will play the stream on a PC connected to the WiFi network. These steps was originally created by Dale Matthews. Thank you Dale. :)

Here is a list of items which we used:

  • iMX6 TinyRex Development kit
  • PCIe WiFi card Intel 4965AGN with 2 antennae
  • HDMI video source connected to TinyRex board
  • PC where stream will be played
  • Router with WiFi support

1. Prepare the board
Before you connect the power, plug in PCIe WiFi card. Do not forget to use antennae (plug them into coaxial connectors 1 and 3). Connect HDMI input source. Boot up the board.

2. Connect iMX6 TinyRex to the network
Check if WiFi card was detected:

# dmesg | grep iwl4965
iwl4965: Intel(R) Wireless WiFi 4965 driver for Linux, in-tree:
iwl4965: Copyright(c) 2003-2011 Intel Corporation
iwl4965 0000:01:00.0: Detected Intel(R) Wireless WiFi Link 4965AGN, REV=0x4
iwl4965 0000:01:00.0: device EEPROM VER=0x36, CALIB=0x5
iwl4965 0000:01:00.0: Tunable channels: 13 802.11bg, 19 802.11a channels
iwl4965 0000:01:00.0: loaded firmware version 228.61.2.24

Enable wireless networking (you may need to run it twice if any message occurs):

ip link set wlan0 up

We will use feature connmanctl to connect to the network. We will enable WiFi and scan for available networks first:

# connmanctl enable wifi
Enabled wifi
# connmanctl scan wifi
Scan completed for wifi

List the networks:

# connmanctl services
    s15as                wifi_0013e8442b51_7331356173_managed_psk
    AMS                  wifi_0013e8442b51_414d53_managed_psk
    Daryl                wifi_0013e8442b51_446172796c_managed_psk
    SuperBarter          wifi_0013e8442b51_5375706572426172746572_managed_psk

To connect to the password protected network we will start agent routine. We need to jump into interactive mode:

# connmanctl
connmanctl> agent on
Agent registered

Find your network from available services and copy its hash string (e.g. our network is called “s15as” with string “wifi_0013e8442b51_7331356173_managed_psk”). Type the network password when you will be asked:

connmanctl> connect wifi_0013e8442b51_7331356173_managed_psk
  Passphrase = [ Type=psk, Requirement=mandatory ]
Passphrase? <YOUR PASSWORD>
connmanctl> wlan0: authenticate with d4:ca:6d:6b:64:57
wlan0: send auth to d4:ca:6d:6b:64:57 (try 1/3)
wlan0: authenticated
wlan0: waiting for beacon from d4:ca:6d:6b:64:57
wlan0: associate with d4:ca:6d:6b:64:57 (try 1/3)
wlan0: RX AssocResp from d4:ca:6d:6b:64:57 (capab=0x431 status=0 aid=2)
IPv6: ADDRCONF(NETDEV_CHANGE): wlan0: link becomes ready
wlan0: associated
Connected wifi_0013e8442b51_7331356173_managed_psk

Quit the interactive mode

connmanctl> quit

and check if IP address was assigned:

# ifconfig
eth0      Link encap:Ethernet  HWaddr 00:0D:15:00:DE:C7
          UP BROADCAST MULTICAST  MTU:1500  Metric:1
          RX packets:0 errors:0 dropped:0 overruns:0 frame:0
          TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:0 (0.0 B)  TX bytes:0 (0.0 B)

lo        Link encap:Local Loopback
          inet addr:127.0.0.1  Mask:255.0.0.0
          inet6 addr: ::1/128 Scope:Host
          UP LOOPBACK RUNNING  MTU:65536  Metric:1
          RX packets:10 errors:0 dropped:0 overruns:0 frame:0
          TX packets:10 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0
          RX bytes:700 (700.0 B)  TX bytes:700 (700.0 B)

wlan0     Link encap:Ethernet  HWaddr 00:13:E8:44:2B:51
          inet addr:192.168.120.99  Bcast:192.168.120.255  Mask:255.255.255.0
          inet6 addr: fe80::213:e8ff:fe44:2b51/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:28 errors:0 dropped:0 overruns:0 frame:0
          TX packets:51 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:2727 (2.6 KiB)  TX bytes:10266 (10.0 KiB)

We can also ping the PC where video will be played:

# ping -c 4 192.168.10.90
PING 192.168.10.90 (192.168.10.90): 56 data bytes
64 bytes from 192.168.10.90: seq=0 ttl=63 time=5.802 ms
64 bytes from 192.168.10.90: seq=1 ttl=63 time=1.627 ms
64 bytes from 192.168.10.90: seq=2 ttl=63 time=1.003 ms
64 bytes from 192.168.10.90: seq=3 ttl=63 time=0.986 ms

--- 192.168.10.90 ping statistics ---
4 packets transmitted, 4 packets received, 0% packet loss
round-trip min/avg/max = 0.986/2.354/5.802 ms

We are successfully connected to the network. Filesystem will remember the settings and autoconnect to the network next time.

3. Prepare PC where steam will be played
For PC you can use any operating system. We will use Ubuntu machine as an example. Before you start, be sure that it is connected to the same network as TinyRex.

Check if you have VLC player installed (search for “vlc” in your package manager). If you did not find it, install it:

sudo apt-get update
sudo apt-get install vlc browser-plugin-vlc

You can also use any other media player which can open SDP files.

Now we will create a SDP file

nano tinyrex-streaming-test.sdp

with configuration needed to play the stream (copy and paste this into the file):

v=0
o=- 1223457093460663 1 IN IP4 127.0.0.1
s=RTSP Server
i=Codec00
t=0 0
a=tool:LIVE555 Streaming Media v2008.07.24
a=type broadcast
b=AS:21
a=control:*
a=source-filter: incl IN IP4 127.0.0.1
a=rtcp-unicast: reflection
m=video 5550 RTP/AVP 96    
a=rtpmap:96 H264/90000
a=framerate=30
a=fmtp:96 profile-level-id=42001e; sprop-parameter-sets=Z0JAH6aAUAW5AA\\=\\=\\,aM44gAA\\=\;

To start the stream we need to know the PC’s IP address:

# ifconfig
eth0      Link encap:Ethernet  HWaddr 00:1b:24:59:69:a3
          inet addr:192.168.10.90  Bcast:192.168.10.255  Mask:255.255.255.0
          inet6 addr: fe80::21b:24ff:fe59:69a3/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:357 errors:0 dropped:0 overruns:0 frame:0
          TX packets:75 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:44432 (44.4 KB)  TX bytes:12096 (12.0 KB)
          Interrupt:16

lo        Link encap:Local Loopback
          inet addr:127.0.0.1  Mask:255.0.0.0
          inet6 addr: ::1/128 Scope:Host
          UP LOOPBACK RUNNING  MTU:16436  Metric:1
          RX packets:70 errors:0 dropped:0 overruns:0 frame:0
          TX packets:70 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0
          RX bytes:5344 (5.3 KB)  TX bytes:5344 (5.3 KB)

4. Streaming
Before we start, be sure your router is not blocking port 5550.

Check if HDMI source is active and start the video capture on iMX6 TinyRex board. Do not forget to change udpsink parameter for PC’s IP address (in our case to 192.168.10.90):

gst-launch imxv4l2src ! vpuenc codec=avc bitrate=4000000 ! rtph264pay config-interval=3 pt=96 ! udpsink host=192.168.10.90 port=5550 -v

Now finally you can open prepared SDP file in VLC Player on PC:

vlc tinyrex-streaming-test.sdp

You should now see the stream playing.