Personal tools

Log in

Changes

From IGEP - ISEE Wiki

Jump to: navigation, search

What can I do with IGEPv2

2,722 bytes removed, 12:36, 11 May 2016
no edit summary
__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 =
== Handle You must logged in the gpio-LED's ==board.
''' Basic '''== How to use serial console ==
In this tutorial, we are going Connect a serial (COM port) cable (known as the AT/Everex Cable) to use the '''4 LED's available in 10-pin header J960 on the board''', which probably is . Now you need a Null-Modem DB9 male-make serial cable. Connect the most simple feature in cable between the board, but sometimes you may want LED's to be a way of checking and your PC. Open the status of some of serial on your applications. PC using your preferred serial communications program (minicom) and configure the port as follows:
You can easily '''turn LED's on and off''' using the 'echo' instruction.* 115200* 8N1* no flow control (either software or hardware)
Log into IGEPv2 (for example via SSH, as shown in Open the previous chapter), serial port and run the following commands to turn LED's on:debug shell prompt should appear.
<pre>echo 1 &gt; /sys/devices/platform/leds-gpio/leds/d240\A detailed guide on how to connect via serial debug port can be found by following this link:green/brightnessecho 1 &gt; /sys/devices/platform/leds-gpio/leds/d240\:red/brightnessecho 1 &gt; /sys/devices/platform/leds-gpio/leds/d440\:green/brightnessecho 1 &gt; /sys/devices/platform/leds-gpio/leds/d440\:red/brightness</pre> [[Using serial debug port to communicate]]
You can turn them down using == Handle the same command and write '0' instead of '1'. 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:
''' Know more ''' $ echo 0 > /sys/class/leds/d240\:green/brightness
IGEPv2 LED's are controlled with it's platform device at $ echo 1 > /sys/devicesclass/platformleds/d240\:red/brightness $ echo 0 > /sys/class/leds-gpio/ledsd240\:red/brightness
If you want to trigger the $ echo 1 > /sys/class/leds you can enable this mode and select the trigger source (none by default) to/d440\: mmc0, mmc1, timer, heartbeat and default-on.<brgreen/brightness $ echo 1 > /sys/class/leds/d440\:red/brightness
To enable any of A detailed guide on how use GPIO-LEDS can be found by following this modes you just have to change a parameter in the directory of the led you want link: [[How to control. You can see all the possibilities using handle the instruction 'cat':<br> gpio-LED]]
== Handle generic GPIO ==See [[How_to_use_GPIOs|GPIOs HOWTO]] to know details about that.Quick example could be:<pre>$ cat echo 156 > /sys/class/gpio/export echo out > /sys/devicesclass/gpio/gpio156/directionecho 0 > /sys/platformclass/leds-gpio/ledsgpio156/d240\:greenvalue</triggerpre>
[none] mmc0 mmc1 timer heartbeat default-on<pre>echo 157 > /sys/class/gpio/export echo in > /sys/class/gpio/gpio157/directioncat /sys/class/gpio/gpio157/value</pre>
In the example above, we have checked the status of the trigger in led D240:green. Mode 'none' is selected. == How to use UART1 (RS232) ==
To change 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 example, to the ''timer'' mode RS232 comunications you should disable RS485 interface. You can use 'echo':do this [[How_do_I_edit_my_kernel_command_line | adding following kernel cmdline parameter]]
<pre>echo timer &gt; /sys/devices/platform/leds-gpio/leds/d240\:green/trigger</pre> board.ei485=no
Now, you can connect the serial AT/Everex Cable to the 10-pin header J960 on the board. In this that case, we have set the trigger first pin of the AT/Everex Cable (red) should be connected to the 'timer' modepin number 10 of the header J960. Now you can set You also need a Null-Modem DB9 male-make serial cable. Connect the time for what cable between the led is ON target board and the time it is OFF using:your PC.
<pre>echo 250 &gt; /sys/devices/platform/leds-gpio/leds/d240\Open the serial port on your PC using your preferred serial communications program (minicom) and configure the port as follows:green/delay_onecho 750 &gt; /sys/devices/platform/leds-gpio/leds/d240\:green/delay_off</pre>
Now the selected led is configured with a timer consisting of 250 miliseconds ON and 750 miliseconds OFF.* 115200* 8N1* no flow control (either software or hardware)
On the target board open a serial port as follows:
== Send a file between your PC and IGEPv2 via SCP == $ microcom -s 115200 /dev/ttyS0
''' Basic '''Now when you write a character in you PC serial port, the character should appear in the target board.
In a Linux host PC, you A detailed guide on how use UARTS can be found by following this link: [[How to use SCP (secure copy) via SSH to transfer files between IGEPv2 and your PC.UARTs]]
Now let's transfer a file called original.file in your host PC == How to IGEPv2 in /home/root/use RS-485 ==
In your Host PC open Terminal and type{{#lst:How to use RS485|overview}}A detailed guide on how use UARTS can be found by following this link: [[How to use RS485]]
scp -r original.file root@< IGEPv2 IP >:/home/root/destination.file== Get sound in (audio in) ==
You can repeat the process from the IGEPv2 consoleExternal Audio input devices, and transfer a file from IGEPv2 to your Host PC.  == Update your pre-installed software == === Overview === # Download the latest firmware''' into an external computer# Uncompress the downloaded file# Create such as a MicroSD card in your external computer# Plug the MicroSD card to IGEPv2 and boot from it. === Requirements === * a '''microSD card'''* a '''computer''' with microSD card reader (powered microphone 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 === We are now going to update the pre-installed software to the latest version. {{#lst:How to create a SD-card with the latest software image|IGEPv2}}  == Flash the latest software image == If you followed the previous section you have IGEPv2 with the latest firmware '''running from MicroSD card'''. But you might want to write the firmware to the flash memory, so '''you won't need the MicroSD card when booting''' the board. The software provided by ISEE has a script that flashes the content audio output of your MicroSD Card to the flash memory in your IGEPv2. You have to run this script, that is located at /opt/firmware directory. Log into IGEPv2 and run the following commands:  cd /opt/firmware ./flash.sh This will last a few minutes. When it is ready, unplug the SD card from IGEPv2 and reboot the board:  reboot You will have the new firmware running from IGEPv2 flash memory.  ''' Know more ''' IGEPv2 can run many other software distributions. Check the [[:Category:Software distributions]] to learn how to install other distributions.  == Basic instructions == IGEPv2 is '''compatible with many Linux distributions'''. In this tutorial we are using Poky Linux, which is the pre-installed software from ISEE. In case you are not familiar with Bash instructions, here comes some basic instructions to help you startup with the board. First of all, '''log in to IGEPv2''' with a console from your host PC (via serial port or via SSH)MP3 player, as shown previous sections in this article. Remember the default settings:  login: root password: (none: press return) Once you are logged in IGEPv2, run the following commands:  cd / ls You have moved to the root directory, that is "/".The instruction "ls" lists all the existing files and directories in the current "path". Now let's go to the directory /home/root/ with:  cd /home/root/ You can always check at which directory you are with the instruction:  pwd 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" connected 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 via 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 system3We 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 5mm jack (xAudio IN):  ls -la We are going to add permission to the file by:  chmod a+x example.sh ls -la Now you can run the script:  ./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 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 stop any instruction by pressing CTRL+Cuse MAX9812.
Enable capture:
== Mount a MicroSD card =={| cellspacing="<pre>amixer -c 0" cellpadding="5" border="1" align="center" width="100%" style="text-align: left;"sset 'Analog Right AUXR' cap|amixer -| bgcolor="#cccccc" |c 0 sset 'Analog Left AUXL''Overview'''|-| Mount the MicroSD card partitions into IGEPv2|}cap </pre>
You can record audio in with the application arecord, for example:
=== 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]]  == How to 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:  <pre>arecord -t wav -c 2 -r 44100 -f S16_LE -v audio-in.wav</pre>
Following output is expected on console:
boundary &nbsp;: 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:
== How to get sound out (audio out) == $ 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
''' Basic '''Then you can easily play a *.wav sound with the application Aplay, for example:
Connect an '''external output $ aplay audio device''' to the 3.5mm jack Audio Out connector -in IGEPv2, such as external stereo powered speakers.wav
The amplifiers for == 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 headset output are disabled by firmware configures byu default. Use your wireless manager to connect to the wireless network called in the form  IGEP_xx After connecting, so the first thing a DHCP IP address should be adquired. Now you'll do is enable these amplifiers can access, for example withssh, 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 ==
amixer set -D hw:0 'Headset' 0dB amixer set -D hw:0 'HeadsetL Mixer AudioL2' on amixer set -D hw:0 'HeadsetR Mixer AudioR2' onIn 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.
Then Though a common USB Standard-A to Mini-B type cable the port acts as a device. In this mode you can easily play a *connect to the board using the USB Ethernet Gadget.wav sound Use this cable between your computer and the target board and connect with the application Aplay, for example:
aplay audio-in$ ssh root@192.wav168.7.1
A detailed guide on how use wifi can be found by following this link: [[Using USB ethernet gadget to communicate]]
{{Template:Navigation/IGEP Technology Devices Guides/Next Step|Name={{#lst:Template:Links|IGEPv2_Name}}|Community_MainPage={{#lst:Template:Links|IGEPv2_Community_MainPage}}|Next_Step=Start developing under IGEP TechnologyWhat can I do/Ending}}
[[Category:IGEP Technology Devices Guides]]
0
edits