This page details the key features of the Opal-6 IoT Development Kit (ODK) and how to access them with Linux.
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:
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
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:
'/etc/network/interfaces'
in a text editorvi
', 'nano
' and 'mousepad
' contained in the demo image for your convenienceiface 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.
Opal-6 boards can support both PCI-e and USB wireless adapters. We have included and tested support for the following adapters:
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.
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 ' |
There are two stages to configuring a wireless network:
To configure the wpa_supplicant:
wpa_passphrase your_ssid your_password
/etc/wpa_supplicant.conf
file using your favourite editor.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.
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.
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
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
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.
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 |