Opal-6 Linux Features - Quick Start Guide
- John Inglis
- Martin Welford
This page details the key features of the Opal-6 IoT Development Kit (ODK) and how to access them with Linux.
Debug Console
The debug console is the main source of communication to Opal-6 and 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).
- Start a terminal application on your PC. We recommend Tera Term. 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
The ODK supports HDMI and LVDS panels. The setup of these is configured through the video environment variable in u-boot.
To change the display support, use the u-boot serial debug terminal. Enter the following to change the display and boot to Linux:
run <display>, where <display> is hdmi, lvds0 or lvds1
save
boot
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
- You will find '
- 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
Supported Adapters
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 using the add_wifi script
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.
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.
Manually configuring Wireless Networks
There are two stages to configuring a wireless network:
- Configure wpa_supplicant with details of your network
- Configure /etc/network/interfaces to startup your wireless network using wpa_supplicant
To configure the wpa_supplicant:
- Use wpa_passphrase to generate the required network entry. This will also encrypt your password.
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 uses the USB interface provided through the PCI-e connector.
Support for this modem is configured through the /etc/ppp/peers/provider
and /etc/chatscripts/pap
files. The pap file has been pre-configured to handle the correct dial strings for this modem and therefore should not need edited. The providers file has been pre-configured 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
RS485
UART2 is the serial port connected to the RS485 transceiver. The serial driver in Linux is setup to automatically enable the transmitter when using this port.
Use microcom /dev/ttymxc1 to test sending and receiving data.
+5V Digital Inputs and Outputs
These are accessible as GPIO via standard Linux gpio commands. This post explains it as well as any we have seen.
The GPIO to use for the I/O are:
Function | i.MX6 GPIO | Linux GPIO |
---|---|---|
IN 1 | 2-00 | 32 |
IN 2 | 2-01 | 33 |
OUT 1 | 2-02 | 34 |
OUT 2 | 2-03 | 35 |