Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 13 Next »

This page details the key features of Opal-6 IoT Development Kit (ODK) and how you can work with them using Linux.

Debug Console

The debug console is the main source of communication to Opal-6 and is important to get up and running.  The console gives you full access to U-Boot and the Linux command prompt. 

To get connected:

  • Connect a USB cable from your development host to the Opal-6 serial debug port (USB mini-B connector next to the Ethernet connector).
  • We recommend tera-term as a terminal application.  This will show available ports making it easy to see the new virtual serial port created when you connected Opal-6 to your PC.  Alternatively, you can locate the COM port number using Windows Device Manager.
  • The serial port settings are: 115200, 8 bit data, no flow control, no parity, 1 stop bit
  • Now reset your Opal-6 board and you should see the boot sequence messages. When the boot is complete you can login into Linux with user 'root' and no password

Changing Displays

Your Opal-6 board arrives preconfigured for HDMI displays however if you plan to use an LVDS touchscreen you will need to do the following:

  • Reset your board and immediately press any key from within the debug console, you will be presented with the U-Boot prompt '=>'
  • Type the following commands to enable LVDS output"

=> run lvds0
=> saveenv

  • Type 'boot' or reset your board to start with LVDS support

Configuring a Static IP for Ethernet

Opal-6 boards are pre-configured to use DHCP when connected to ethernet. If you require a static IP to be assigned then do the following:

  • Open the file '/etc/network/interfaces' in a text editor
    • You will find 'vi', 'nano' and 'mousepad' contained in the demo image for your convenience
  • Change the 'iface eth0 inet dhcp' line to the following:

iface eth0 inet static
    address 192.168.1.69
    netmask 255.255.255.0
    gateway 192.168.1.254

Replace the addresses above with ones appropriate for your network.

Configuring a Wireless Connection

Opal-6 boards can support both PCI-e and USB wireless adapters. We have included and tested support for the following adapters:

  • Intel AC7260HMW PCI-e wireless-ac adapter
  • Asus N10 Nano USB adapter

Other adapters may work out of the box depending on driver requirements however it is possible you may need to configure and rebuild the Linux kernel to include the drivers should you decide to use a different adapter

Configuring a wireless network is a little more involved than ethernet however we have included a small helper script in our demo image to help speed up the process. We shall demonstrate both using the script and one manual method below.

Using the 'add_wifi' script:

  • From within your debug terminal, type the following:

add_wifi <your_ssid> <your_password>
e.g. add_wifi myssid mypassword

  • The script will encypt your password and create the appropriate entries in /etc/network/interfaces and /etc/wpa_supplicant.conf. This configuration will automatically reconnect your wireless network on reboot.
  • Now you can type 'ifup wlan0' or simply reset your Opal-6 board to connect to your wireless network

You can delete all your wireless network configurations with the 'delete_all_wireless_networks' command.

The manual method:

There are two stages to configuring a wireless network:

  1. Configure wpa_supplicant with details of your network
  2. Configure /etc/network/interfaces to startup your wireless network using wpa_supplicant

Lets start with configuring wpa_supplicant:

  • We will use wpa_passphrase to generate the required network entry. This will also encrypt your password. The following command will generate the entry:

wpa_passphrase your_ssid your_password

  • Now append the output to the /etc/wpa_supplicant.conf file using your favourite editor.
  • You can perform the above steps in one operation with the following command:

wpa_passphrase your_ssid your_password >> /etc/wpa_supplicant.conf

Now append the following lines to /etc/network/interfaces:

auto wlan0
iface wlan0 inet dhcp
pre-up wpa_supplicant -iwlan0 -c/etc/wpa_supplicant.conf -B
post-down killall -q wpa_supplicant

Your network is now configured to start automatically on boot. You can start it now by typing 'ifup wlan0' or by resetting your board.

Configuring the Modem

We have tested 3G modems from Telit, specifically the HE910 PCI-e model. Note that this modem actually uses the USB interface provided through the PCI-e connector.

Support for this modem is configured through the /etc/ppp/peers/providers and /etc/chatscripts/pap files. The pap file has been preconfigured to handle the correct dial strings for this modem and therefore should not need edited. The providers file has been preconfigured for an APN of 'internet' and an 'anonymous' user. If your mobile ISP requires a different set of parameters then you will need to edit this file to include the correct APN and username/password.

Once the files have been configured you can start the modem by typing 'pon'. This will start up the modem and connect to the configured mobile network. Typing 'ifconfig' should show an interface called 'ppp0' with it's assigned ip address. You can now access the internet as you would with any other network interface.

CAN Interfaces

The Linux socketCAN commands can be used to do a quick test on the CAN channels. For demonstration purposes you can loop the two CAN interfaces together by connecting CAN-H to CAN-H and CAN-L to CAN-L on both.

The CAN channels are labelled CAN1 and CAN2 on the ODK. This corresponds with the i.MX6 numbering, however Linux uses the identifiers can0 and can1.

Use the following commands for setup:

canconfig can0 bitrate 250000
canconfig can1 bitrate 250000
ifconfig can0 up
ifconfig can1 up

The commands above specify the data rate as 250kbps.  Other data rates can be used.

To send test data, use the cansend command:

cansend can0 -i0x123 0x11 0x22 0x33 0x44

This sends 4 bytes on can0

To receive data, use canecho (to received on can1 in this example):

canecho can1 -v

MIPI Camera

The ODK supports a Leopard Imaging OV5640 sensor. We will use the Gstreamer tools and libraries to demonstrate some basic operations. GStreamer has a vast array of features which are outside the scope of this Getting Started guide however a quick Google search will produce many useful results and information.

If you are running these commands from the debug terminal, please run the following command first to configure the X-display:

export DISPLAY=:0

Use the following command to display the output from the camera in a desktop window (ctrl-c to exit):

gst-launch-1.0 imxv4l2videosrc device=/dev/video1  ! imxeglvivsink

To capture video from the camera, convert to h264 and save to file (ctrl-c to exit):

gst-launch-1.0 imxv4l2videosrc device=/dev/video1 ! imxvpuenc_h264 ! filesink location=test.h264

To playback the video:

gst-play-1.0 test.h264

To examine which pipelines are supported in our demo image you can type the following:

gst-inspect-1.0

Or to list only IMX hardware accelerated pipelines:

gst-inspect-1.0 | grep imx

 

On this page

 

 

  • No labels