Difference between revisions of "What can I do with IGEPv2"

From IGEP - ISEE Wiki

Jump to: navigation, search
m (Mount a MicroSD card)
 
(45 intermediate revisions by 5 users not shown)
Line 9: Line 9:
  
  
__TOC__
+
= Overview =
  
 +
This is the 2/3 chapter of the Getting Started with IGEPv2 Tutorial Guide.
  
= Overview =
+
In this second chapter, we will learn some basics tasks. Upon completion, you will be ready to continue with chapter 3/3 that explains more advanced tasks.
  
This is the 2/3 chapter of IGEPv2 Tutorial Guide.
 
  
We will learn some basic tasks such to send a file between IGEPv2 and your PC , handle the IGEPv2 Leds, update the pre-installed software to the latest release, etc.
+
__TOC__
  
  
 
= What can I do =
 
= What can I do =
  
== Handle the gpio-LED's ==
+
You must logged in the board.
{{#lst:How to handle the gpio-LED|IGEPv2}}
 
  
== Send a file between your PC and IGEPv2 via SCP ==
+
== How to use serial console ==
{{#lst:Transfer files via SCP|Instructions}}
 
  
== Update your pre-installed software ==
+
Connect a serial (COM port) cable (known as the AT/Everex Cable) to the 10-pin header J960 on the board. Now you need a Null-Modem DB9 male-make serial cable. Connect the cable between the board and your PC. Open the serial on your PC using your preferred serial communications program (minicom) and configure the port as follows:
  
=== Overview ===
+
* 115200
 +
* 8N1
 +
* no flow control (either software or hardware)
  
# Download the latest firmware''' into an external computer
+
Open the serial port and the debug shell prompt should appear.
# Uncompress the downloaded file
 
# Create a MicroSD card in your external computer
 
# Plug the MicroSD card to IGEPv2 and boot from it.
 
  
=== Requirements ===
+
A detailed guide on how to connect via serial debug port can be found by following this link: [[Using serial debug port to communicate]]
  
* a '''microSD card'''
+
== Handle the GPIO-LEDS ==
* a '''computer''' with microSD card reader (or with adapter)
 
* a '''GNU/Linux distribution installed''' on the computer (a Linux partition or a virtual machine on Windows)
 
** the main reason is that Windows does not detect multiple partitions on a microSD card
 
  
=== Basic ===
+
The board has two user bicolor (green/red) leds available that can be controlled. In its simplest form, you can control of LEDs from
 +
userspace. LEDs appear in /sys/class/leds/ and you can turn on and off with following commands:
  
We are now going to update the pre-installed software to the latest version.
+
$ echo 0 > /sys/class/leds/d240\:green/brightness
  
{{#lst:How to create a SD-card with the latest software image|IGEPv2}}
+
$ echo 1 > /sys/class/leds/d240\:red/brightness
 +
$ echo 0 > /sys/class/leds/d240\:red/brightness
  
 +
$ echo 1 > /sys/class/leds/d440\:green/brightness
 +
$ echo 1 > /sys/class/leds/d440\:red/brightness
  
== Flash the latest software image ==
+
A detailed guide on how use GPIO-LEDS can be found by following this link: [[How to handle the gpio-LED]]
  
{{:How to flash the latest software image}}
+
== Handle generic GPIO ==
 +
See [[How_to_use_GPIOs|GPIOs HOWTO]] to know details about that.
 +
Quick example could be:
 +
<pre>echo 156 > /sys/class/gpio/export
 +
echo out > /sys/class/gpio/gpio156/direction
 +
echo 0 > /sys/class/gpio/gpio156/value</pre>
  
 +
<pre>echo 157 > /sys/class/gpio/export
 +
echo in > /sys/class/gpio/gpio157/direction
 +
cat /sys/class/gpio/gpio157/value</pre>
  
''' Know more '''
+
== How to use UART1 (RS232) ==
  
IGEPv2 can run many other software distributions. Check the [[:Category:Software distributions]] to learn how to install other distributions.
+
The board has another UART available on J960 connector (UART1). This UART is shared with RS485 so it's incompatible use both interfaces at the same time. For that reason to use UART1 for RS232 comunications you should disable RS485 interface. You can do this [[How_do_I_edit_my_kernel_command_line | adding following kernel cmdline parameter]]
  
== Basic instructions ==
+
board.ei485=no
  
IGEPv2 is '''compatible with many Linux distributions'''. In this tutorial we are using Poky Linux, which is the pre-installed software from ISEE.
+
Now, you can connect the serial AT/Everex Cable to the 10-pin header J960 on the board. In that case the first pin of the AT/Everex Cable (red) should be connected to the pin number 10 of the header J960. You also need a Null-Modem DB9 male-make serial cable. Connect the cable between the target board and your PC.
  
In case you are not familiar with Bash instructions, here comes some basic instructions to help you startup with the board.
+
Open the serial port on your PC using your preferred serial communications program (minicom) and configure the port as follows:
  
First of all, '''log in to IGEPv2''' with a console from your host PC (via serial port or via SSH), as shown previous sections in this article. Remember the default settings:
+
* 115200
 +
* 8N1
 +
* no flow control (either software or hardware)
  
login: root
+
On the target board open a serial port as follows:
password: (none: press return)
 
  
Once you are logged in IGEPv2, run the following commands:
+
  $ microcom -s 115200 /dev/ttyS0
  
cd /
+
Now when you write a character in you PC serial port, the character should appear in the target board.
ls
 
  
You have moved to the root directory, that is "/".
+
A detailed guide on how use UARTS can be found by following this link: [[How to use UARTs]]
The instruction "ls" lists all the existing files and directories in the current "path".
 
  
Now let's go to the directory /home/root/ with:
+
== How to use RS-485  ==
  
cd /home/root/
+
{{#lst:How to use RS485|overview}}
 +
A detailed guide on how use UARTS can be found by following this link: [[How to use RS485]]
  
You can always check at which directory you are with the instruction:
+
== Get sound in (audio in) ==
  
pwd
+
External Audio input devices, such as a powered microphone or the audio output of a PC or MP3 player, can be connected to the via a 3.5mm jack (Audio IN).
 
 
Most instructions include a 'help' option that can be accessed by inserting the parameter --help. Check out the help page of 'echo' instruction, for example:
 
 
 
echo --help
 
 
 
You can try the instruction by yourself and type:
 
 
 
echo Hello
 
 
 
You have sent the text "Hello" to the standard output, that is the console you are interacting with.
 
 
 
But you can change and 'redirect' the output by using the character '>' :
 
 
 
echo Hello world! > /home/root/name.file
 
 
 
Now notice you have redirected the output to a file called name.file :
 
 
 
ls
 
 
 
You can append any file using '>>' instead of '>'.
 
You can print the content of the file to the standard output:
 
 
 
cat /home/root/name.file
 
 
 
'''Building a basic script'''
 
 
 
You can create a script that can run any instruction you want to use in Bash. The main advantage is that you do not have to compile the code, as is auto-interpereted by the system.
 
 
 
We are going to create a basic 'Hello World' script that is going to run the same command you have actually used before:
 
 
 
echo "echo Hello world!" > /home/root/example.sh
 
cat example.sh
 
  
Now you have created a file called example.sh, but by default it has no execute permissions (x):
+
Note that the board has been designed to use Line In for the audio input which means users need to add some type of pre-amp for a microphone to work or use a powered microphone. For a pre-amp for a microphone you can use MAX9812.
  
ls -la
+
Enable capture:
  
We are going to add permission to the file by:
+
<pre>amixer -c 0 sset 'Analog Right AUXR' cap
 +
amixer -c 0 sset 'Analog Left AUXL' cap </pre>
  
chmod a+x example.sh
+
You can record audio in with the application arecord, for example:
ls -la
 
  
Now you can run the script:
+
<pre>arecord -t wav -c 2 -r 44100 -f S16_LE -v audio-in.wav</pre>
 
 
./example.sh
 
 
 
You can edit this file (example.sh) with 'vi', the pre-installed text editor in IGEPv2.
 
 
 
vi example.sh
 
 
 
Press ESC and:
 
 
 
* :q! , to exit without saving
 
* :w , to save
 
* :wq , to quit and save
 
* i , to insert text
 
 
 
'''Other simple & useful instructions'''
 
 
 
* mkdir
 
* rmdir
 
* find
 
* grep
 
 
 
You can stop any instruction by pressing CTRL+C
 
 
 
 
 
== Mount a MicroSD card ==
 
 
 
''' Basic '''
 
 
 
Log into IGEPv2 and run any of the following commands:
 
 
 
* Access to Generic FAT32 microSD:
 
 
 
mount -t vfat /dev/mmcblk0 /mnt/tmp/
 
 
 
* Access to Generic USB Flash disk:
 
 
 
mount -t vfat /dev/sda1 /mnt/tmp/
 
 
 
* Safety Remove microSD:
 
 
 
umount /mnt/tmp
 
 
 
* Access to IGEP demo microSD:
 
 
 
mount -t jffs2 /dev/mmcblk0 /mnt/tmp/
 
 
 
== How to use RS-485  ==
 
 
 
Follow the link to the extensive article: [[How_to_use_RS485_on_IGEP0020_board|How to use RS-485 on IGEPv2 board]]
 
 
 
 
 
== Get sound in (audio in) ==
 
 
 
''' Basic '''
 
 
 
External Audio input devices, such as a powered microphone or the audio output of a PC or MP3 player, can be connected to the via a 3.5mm jack (Audio IN).
 
 
 
You can record audio in with the application Arecord, for example:
 
 
 
arecord -t wav -c 2 -r 44100 -f S16_LE -v audio-in.wav
 
  
 
Following output is expected on console:
 
Following output is expected on console:
Line 217: Line 131:
 
  boundary    &nbsp;: 1073741824
 
  boundary    &nbsp;: 1073741824
  
When ever you think you want to stop recording just press CTRL+C  
+
When ever you think you want to stop recording just press CTRL+C
 
 
  
 
== Get sound out (audio out) ==
 
== Get sound out (audio out) ==
  
''' Basic '''
+
Connect an external output audio device to the 3.5mm jack Audio Out connector in the board, such as external stereo powered speakers.
 
 
Connect an '''external output audio device''' to the 3.5mm jack Audio Out connector in IGEPv2, such as external stereo powered speakers.
 
  
 
The amplifiers for the headset output are disabled by default, so the first thing you'll do is enable these amplifiers with:
 
The amplifiers for the headset output are disabled by default, so the first thing you'll do is enable these amplifiers with:
  
  amixer set -D hw:0 'Headset' 0dB
+
  $ amixer set -D hw:0 'Headset' 0dB
  amixer set -D hw:0 'HeadsetL Mixer AudioL2' on
+
  $ amixer set -D hw:0 'HeadsetL Mixer AudioL2' on
  amixer set -D hw:0 'HeadsetR Mixer AudioR2' on
+
  $ amixer set -D hw:0 'HeadsetR Mixer AudioR2' on
  
 
Then you can easily play a *.wav sound with the application Aplay, for example:
 
Then you can easily play a *.wav sound with the application Aplay, for example:
  
  aplay audio-in.wav
+
  $ aplay audio-in.wav
  
 +
== How to use wifi ==
  
== Connect to the Serial Debug interface ==
+
If you have a wireless network adapter in your computer you can also connect to the board using the ad hoc network connection that the firmware configures byu default.
  
''' Basic '''
+
Use your wireless manager to connect to the wireless network called in the form
  
[[Image:DSC 0177.JPG|thumb|550px|right|AT/Everex Cable connected to the 10-pin serial header on IGEPv2]]
+
IGEP_xx
  
In the preinstalled software, the serial port is configured as a '''Debug interface'''.  
+
After connecting, a DHCP IP address should be adquired. Now you can access, for example with ssh, to the target board connecting to the 192.168.7.1 address.
  
Therefore, if you connect an external device to the serial port you will be able to see the '''Linux Kernel traces''', as the system boots.
+
$ ssh root@192.168.6.1
  
 +
A detailed guide on how use wifi can be found by following this link: [[Using IGEP WLAN to communicate]]
  
Follow these steps:
+
== How to use bluetooth ==
  
* Connect an '''AT/Everex Cable''' to the '''10-pin serial header''' on IGEPv2 and a '''[http://en.wikipedia.org/wiki/Null_modem null modem] DB9 male-male''' serial cable between the board and your host machine.
+
A detailed guide on how use bluetooth can be found by following this link: [[How to setup Marvell bluetooth]]
  
* Refer to the article: '''[[How_to_setup_the_IDC10_cable|How to setup the IDC10 cable]]''' to setup the IDC10 cable.
+
== How to use the SD card ==
  
* You can also use a Serial port in your host machine you might need a '''USB to Serial converter''' to communicate via this port.
+
You can connect a micro SD card for storage. After plugin the SD card the kernel should detect the card and automount in /media directory.
  
* Run a serial console, or any program that can interact with the serial port in your host machine, such Minicom, PuTTy (Linux, Windows), Terminal (Windows), etc.
+
== How to use the USB OTG ==
  
* Refer to this extended article about '''[[Using serial debug port to communicate]]''' to setup the right configuration of your serial console.
+
In order to act in host mode and add some peripherals like keyboard, mouse or pendrives you require a special cable that grounds the ID pin. Since the OTG port only provides 100mA of power a USB hub is recommended.
  
 +
Though a common USB Standard-A to Mini-B type cable the port acts as a device. In this mode you can connect to the board using the USB Ethernet Gadget. Use this cable between your computer and the target board and connect with:
  
Now, as you are connected to the '''serial debug port''', you will see the system traces as the board is starting up.
+
$ ssh root@192.168.7.1
 
 
Finally you will see the boot prompt asking for login.
 
 
 
 
 
[[Image:Poky-prompt-screenshot.png|thumb|550px|center|IGEPv2 Serial Debug interface prompt]]
 
  
 +
A detailed guide on how use wifi can be found by following this link: [[Using USB ethernet gadget to communicate]]
  
 
{{Template:Navigation/IGEP Technology Guides/What can I do/Ending}}
 
{{Template:Navigation/IGEP Technology Guides/What can I do/Ending}}
 
{{Table/IGEP Technology Devices
 
|Tech_Family={{#lst:Template:Links|IGEPv2_Tech_Family}}
 
|Tech_ID={{#lst:Template:Links|IGEPv2_Tech_ID}}
 
|Name={{#lst:Template:Links|IGEPv2_Name}}
 
|Image={{#lst:Template:Links|IGEPv2_Image}}
 
|ISEE_MainPage={{#lst:Template:Links|IGEPv2_ISEE_MainPage}}
 
|ISEE_Hardware={{#lst:Template:Links|IGEPv2_ISEE_Hardware}}
 
}}
 
  
 
[[Category:IGEP Technology Devices Guides]]
 
[[Category:IGEP Technology Devices Guides]]

Latest revision as of 12:36, 11 May 2016


Overview

This is the 2/3 chapter of the Getting Started with IGEPv2 Tutorial Guide.

In this second chapter, we will learn some basics tasks. Upon completion, you will be ready to continue with chapter 3/3 that explains more advanced tasks.



What can I do

You must logged in the board.

How to use serial console

Connect a serial (COM port) cable (known as the AT/Everex Cable) to the 10-pin header J960 on the board. Now you need a Null-Modem DB9 male-make serial cable. Connect the cable between the board and your PC. Open the serial on your PC using your preferred serial communications program (minicom) and configure the port as follows:

  • 115200
  • 8N1
  • no flow control (either software or hardware)

Open the serial port and the debug shell prompt should appear.

A detailed guide on how to connect via serial debug port can be found by following this link: Using serial debug port to communicate

Handle the GPIO-LEDS

The board has two user bicolor (green/red) leds available that can be controlled. In its simplest form, you can control of LEDs from userspace. LEDs appear in /sys/class/leds/ and you can turn on and off with following commands:

$ echo 0 > /sys/class/leds/d240\:green/brightness
$ echo 1 > /sys/class/leds/d240\:red/brightness
$ echo 0 > /sys/class/leds/d240\:red/brightness
$ echo 1 > /sys/class/leds/d440\:green/brightness
$ echo 1 > /sys/class/leds/d440\:red/brightness

A detailed guide on how use GPIO-LEDS can be found by following this link: How to handle the gpio-LED

Handle generic GPIO

See GPIOs HOWTO to know details about that. Quick example could be:

echo 156 > /sys/class/gpio/export 
echo out > /sys/class/gpio/gpio156/direction
echo 0 > /sys/class/gpio/gpio156/value
echo 157 > /sys/class/gpio/export 
echo in > /sys/class/gpio/gpio157/direction
cat /sys/class/gpio/gpio157/value

How to use UART1 (RS232)

The board has another UART available on J960 connector (UART1). This UART is shared with RS485 so it's incompatible use both interfaces at the same time. For that reason to use UART1 for RS232 comunications you should disable RS485 interface. You can do this adding following kernel cmdline parameter

board.ei485=no

Now, you can connect the serial AT/Everex Cable to the 10-pin header J960 on the board. In that case the first pin of the AT/Everex Cable (red) should be connected to the pin number 10 of the header J960. You also need a Null-Modem DB9 male-make serial cable. Connect the cable between the target board and your PC.

Open the serial port on your PC using your preferred serial communications program (minicom) and configure the port as follows:

  • 115200
  • 8N1
  • no flow control (either software or hardware)

On the target board open a serial port as follows:

 $ microcom -s 115200 /dev/ttyS0

Now when you write a character in you PC serial port, the character should appear in the target board.

A detailed guide on how use UARTS can be found by following this link: How to use UARTs

How to use RS-485

This How-To is meant to be a starting point for people to learn to use RS-485 port on IGEP devices as quickly and easily as possible. We use IGEP YOCTO Firmware and RS485 example which describe how to setup and write data on the RS-485 port.

A detailed guide on how use UARTS can be found by following this link: How to use RS485

Get sound in (audio in)

External Audio input devices, such as a powered microphone or the audio output of a PC or MP3 player, can be connected to the via a 3.5mm jack (Audio IN).

Note that the board has been designed to use Line In for the audio input which means users need to add some type of pre-amp for a microphone to work or use a powered microphone. For a pre-amp for a microphone you can use MAX9812.

Enable capture:

amixer -c 0 sset 'Analog Right AUXR' cap
amixer -c 0 sset 'Analog Left AUXL' cap 

You can record audio in with the application arecord, for example:

arecord -t wav -c 2 -r 44100 -f S16_LE -v audio-in.wav

Following output is expected on console:

Recording WAVE 'audio-in.wav' : Signed 16 bit Little Endian, Rate 44100 Hz, Stereo
Plug PCM: Hardware PCM card 0 'TWL4030' device 0 subdevice 0
Its setup is:
stream       : CAPTURE
access       : RW_INTERLEAVED
format       : S16_LE
subformat    : STD
channels     : 2
rate         : 44100
exact rate   : 44100 (44100/1)
msbits       : 16
buffer_size  : 32768
period_size  : 2048
period_time  : 46439
tick_time    : 7812
tstamp_mode  : NONE
period_step  : 1
sleep_min    : 0
avail_min    : 2048
xfer_align   : 2048
start_threshold  : 1
stop_threshold   : 32768
silence_threshold: 0
silence_size : 0
boundary     : 1073741824

When ever you think you want to stop recording just press CTRL+C

Get sound out (audio out)

Connect an external output audio device to the 3.5mm jack Audio Out connector in the board, such as external stereo powered speakers.

The amplifiers for the headset output are disabled by default, so the first thing you'll do is enable these amplifiers with:

$ amixer set -D hw:0 'Headset' 0dB
$ amixer set -D hw:0 'HeadsetL Mixer AudioL2' on
$ amixer set -D hw:0 'HeadsetR Mixer AudioR2' on

Then you can easily play a *.wav sound with the application Aplay, for example:

$ aplay audio-in.wav

How to use wifi

If you have a wireless network adapter in your computer you can also connect to the board using the ad hoc network connection that the firmware configures byu default.

Use your wireless manager to connect to the wireless network called in the form

IGEP_xx

After connecting, a DHCP IP address should be adquired. Now you can access, for example with ssh, to the target board connecting to the 192.168.7.1 address.

$ ssh root@192.168.6.1

A detailed guide on how use wifi can be found by following this link: Using IGEP WLAN to communicate

How to use bluetooth

A detailed guide on how use bluetooth can be found by following this link: How to setup Marvell bluetooth

How to use the SD card

You can connect a micro SD card for storage. After plugin the SD card the kernel should detect the card and automount in /media directory.

How to use the USB OTG

In order to act in host mode and add some peripherals like keyboard, mouse or pendrives you require a special cable that grounds the ID pin. Since the OTG port only provides 100mA of power a USB hub is recommended.

Though a common USB Standard-A to Mini-B type cable the port acts as a device. In this mode you can connect to the board using the USB Ethernet Gadget. Use this cable between your computer and the target board and connect with:

$ ssh root@192.168.7.1

A detailed guide on how use wifi can be found by following this link: Using USB ethernet gadget to communicate



You have successfully completed this chapter of the guide.


Continue this tutorial guide: 3/3 - Start developing under IGEP Technology
Igep forum.png If you have any question, don't ask to ask at the IGEP Community Forum or the IGEP Community Chat Irc.png