ION

From CAEN RFID support

Jump to: navigation, search

Image:ION.jpg

The CAEN RFID ION system has been developed to allow people in having a reliable and versatile product for their RFID applications. People may develop their applications on a normal PC and then move them into the ION system with very few modifications!

In order to reach this goal CAEN RFID has developed a Debian/Linux based system on top of an ATOM based PC board.

Contents

GIT repository

Latest code version for the CAEN RFID ION system is on our GIT repositories.

Getting help

We published a proper mail list regarding the ION system usage and development where you can see for help in managing the device, however your are encouraged to check the ION FAQs page before asking something...

If you are a CAENRFID's customer you can also try our customers' support.

Restoring factory defaults

You can restore the ION to factory defaults by using the live image. You can get such image on our FTP server, then see the Live Image HOWTO to know how to prepare it.

Once you have you USB key with the live image just plug it into your ION and then turn it on. If you have a serial cable connected with your PC and a serial terminal up and running on it (serial parameters are 115200 8N1) you should see the following boot message:

+-------------------------------------------------------------------------+
| USB disk start up                                                       |  
|                                                                         |
|                                                                         |
|                                                                         |
|                                                                         |
|                                                                         |
|                                                                         |
|                                                                         |
|                                                                         |
|                                                                         |
|                                                                         |
|                                                                         |  
+-------------------------------------------------------------------------+
   Use the ^ and v keys to select which entry is highlighted.
   Press enter to boot the selected OS, 'e' to edit the
   commands before booting, or 'c' for a command-line.


   The highlighted entry will be booted automatically in 2 seconds.   

Then the kernel boots and in the end you should get the console login:

Debian GNU/Linux 6.0 ion ttyS0                                                  
                                                                               
ion login: 

Enter as root with password rootroot and you'll get the root's prompt:

root@ion:~#

Now, in order to restore factory defaults, just type:

# cd /opt/
# ./install
internal settings:                                                              
        temp directory:         /tmp                                            
        log file:               /tmp/install.log                                
        root device:            /dev/sda (512MB NANDrive  )                     
        extended device:        /dev/mmcblk0 (SU08G)                            
                                                                               
press ENTER to continue or CTRL-C to exit                                       

If the root device is correct (the above example is correct) just press ENTER key and then wait...

When finished remove the USB key and just restart your ION.

Automating the recovery process

By editing the /etc/rc.local file on the USB key you can automatize the factory restoring process. Just uncomment the following getty command::

# Decomment below to run the install script automatically...
# /sbin/getty -L ttyS0 -n -l /opt/install 115200 vt100

then plug the USB key into the ION and turn on the system. After a while the ION will be automatically restored to factory defualt.

Note: by using this method you may accidentally delete your data! So use it with caution...

Managing the MAC's firmware

The live image above reinstall the base system from scratch, however if your MAC's firmware is damaged (or just to be updated) you need the following procedure in order to reprogram it.

First of all download the ION MAC's firmware form our FTP server and then on the ION's prompt stop the caenrfidd (or llrpd) daemon:

# /etc/init.d/caenrfidd stop
Stopping caenrfidd daemon: caenrfidd.

then reprogram the MAC's firmware:

root@ion:~# ion-flash-fw harvemac.hex 
...
ion-flash-fw; firmware upgrade succesfully

and the restart the caenrfidd (or llrpd) daemon:

root@ion:~# /etc/init.d/caenrfidd start
Starting caenrfidd daemon: caenrfidd.

Connecting to the ION

By default the ION is configured with the IP address 192.168.0.1 and it has a console over its serial port so you can use these ways to enter into ION.

Configuring ION access

To configure access to your ION, you have to change the subnet of your PC network card; otherwise you can connect via serial interface (see Connecting via Serial port for more details).

You can change your network settings, by configuring network interface of your PC with static ip, using this parameter:

  • IP Addr: 192.168.0.2
  • NetMask: 255.255.255.0
  • No gateway and dns server IP are needed.

Then you can connect with browser (Webmin) or via ssh to ION. See Connecting via Ethernet port for more details. Configuring a subnet with static IPs depends on your Operating System. Please refer to its documentation or contact your system administrator.

Note: After getting access to ION, you can activate automatic IP acquisition from your network (dhcp client) by following this step:

  • Connect to Webmin (see Using the Web Browser Interface)
  • in left menu, select 'Networking' -> 'Network Configuration'
  • in right menu, choose 'Network Interfaces'
  • go to the 'Activated at Boot' tab, clik on the “eth0”, choose “From DHCP” option and click on “Save”
  • select by checking the “eth0” interface and click on “Apply selected interfaces”.
  • Reboot ION

From now, dhcp client on ION network interface is automatic enabled at every boot.

Connecting via Ethernet port

You can login (via SSH) by using it as follow:

ssh root@192.168.0.1

if you get:

The authenticity of host '192.168.0.1 (192.168.0.1)' can't be established.
RSA key fingerprint is bb:e8:94:c9:9c:4d:70:72:d2:a7:c7:9d:32:ab:80:00.
Are you sure you want to continue connecting (yes/no)?

you can safely answer yes and then enter the password rootroot for root account.

Connecting via Serial port

As stated before the serial port can be used as serial console, so you can use your preferred serial application to get a login terminal. Just configure your serial port as 115200 baud with 8N1 and you may get access to the ION's serial console.

Note: by default the ION start up messages are redirected to the serial port so, if you connect your serial client before booting the system, you can see the whole booting up sequence.

However, in some circumstances you may wish using the serial port to talk with other serial devices, in this case, you must before disabling the serial console otherwise bad things may happen... For instance, see here in order to know about how using the caenrfidd daemon through the serial port.

In order to disable the serial console you must modify several parts: the bootloader, the kernel and the init process, so you must get access to the system's command line.

Disabling the serial console from the bootloader

Edit the file /etc/default/grub and comment out the following lines by adding a # as follow:

# Enable the serial console
# GRUB_SERIAL_COMMAND="serial --speed=115200 --unit=0 --word=8 --parity=no --stop"
# GRUB_TERMINAL_INPUT=serial
# GRUB_TERMINAL_OUTPUT=serial

Disabling the serial console from the kernel

Edit the file /etc/default/grub and modify the kernel command line by removing the console option as follow:

GRUB_CMDLINE_LINUX="loglevel=6 reboot=bios"

Disabling serial terminal form the init process

Edit file /etc/inittab and comment out the label T0 as follow:

#T0:23:respawn:/sbin/getty -L ttyS0 115200 vt100

Using the Web Browser Interface

By default you can use the Webmin interface to configure/manage the system. Simply your browser to the URL https://192.168.0.1:10000.

The Web interface is a customization of Webmin, which is a well known web-based interface for system administration for Unix. As Webmin custom interface, it takes all the advatages of expandibility and modularity of Webmin itself. This standard custom version is provided with the minimal set of standard services and functions, that let you control the ION.

Once entered the ip of the web interface,login screen sould appears(first time login or new clear session). If login page appears, the username and password chosen for the system must be introduced. Click Login and the browser session will be enstablished.

Note: By default, the factory username and password are 'root' and 'rootroot'.

Using the Web Test Page

In order to try some basic RFID commands, ION provides a simple application test page. Test page can be found at http standard port (80) then you can connect, by your browser, to the IP choosen for the ION.

For example, considering the same IP as above, the only thing to do is to write it in to your browser and the test page will appear. This page is divided in two part: the command panel on the left side and output box on the right side.

Note: The test page use the caenrfid daemon, so you must assure that the daemon itself is running when you try the function in the page, otherwhise it doens't show any result.

Doing a simple inventory

To do a simple inventory you can use the Inventory button. After pressing the button, a list of founded tags will appears on the right side of the page.

If no tag are present in the RF field a cannot get data (err=202) message will appear on the output box.

Reading and Writing data on tags

The read and write operations on tags can be performed by the relative boxes in the Panel. The parameters are listed below:

  • EPC: specify the ID of the tag, that you can retrieves from an inventory row's result and paste it into the textbox.
  • bank: permits to select the memory bank to write or read from the data.
  • offset: the distance, in byte, from the first byte of the selected memory bank. It must be a pair number.
  • #bytes: the number of bytes to read
  • bytes: the array of byte to write (i.e. E2003F4C). #bytes and bytes must be a pair number of bytes.
  • For example #bytes=3 and bytes=4F3 aren't valid arguments while #bytes=4 and #bytes=4F3D are valid.
  • Password: the access password. Introduce exactly 8 hexadecimal cipher (i.e. 1A3B5CDE), also in default zero password case (00000000).

Locking memory on tags

You can lock specified memory zone of a tag by using this function. The parameters in this case are:

  • EPC: specify the ID of the tag, that you can retrieves from an inventory row's result and paste it into the textbox.
  • Bank: Specify which bank have to be locked. Reserved bank is divided in access password and kill password memory.
  • Action: the type of lock to apply to the choose bank.
  • password: The access password (same format as in read and write commands).

Killing a tag

ION provides also the kill function the parameter in this case are only two:

  • EPC: code of the tag that you want kill.
  • password: the kill password.

Managing Debian

The ION's O.S. is Debian/Linux so you need to manage it if you wish use ION's internals.

By default the CAENRFID's Debian APT repository is already set up into the system so, if you wish updating your system just use the command:

# aptitude update

Installing new Debian software

If you wish to install new application provided by the Debian system into the ION you can use the common Debian installation tools (see Debian Documentation on line resource for further info).

You may search for a special package by using the apt-cache command as follow:

$ apt-cache search <string>

The command searches each string occurrences into all Debian packages and prints the results on standard output. Then you can install a package by using the command apt-get as follow:

# apt-get install <package>

For example if you wish installing the PHP5 programming language you may use:

$ apt-cache search php5
cakephp - MVC rapid application development framework for PHP
jffnms - web-based Network Management System (NMS) for IP networks
libgv-php5 - Php5 bindings for graphviz
libphp-jpgraph - Object oriented graph library for php5
libphp-jpgraph-examples - Object oriented graph library for php5 (examples)
libxmpp-php - PHP library allowing communication with XMPP servers
php-auth - PHP PEAR modules for creating an authentication system
php-codesniffer - tokenises PHP code and detects violations of a defined set of coding standards
php-imlib - PHP Imlib2 Extension
php5-adodb - Extension optimising the ADOdb database abstraction library
php5-apache2-mod-bt - PHP bindings for mod_bt
php5-auth-pam - A PHP5 extension for PAM authentication
php5-exactimage - fast image manipulation programs (PHP bindings)
php5-ffmpeg - audio and video support via ffmpeg for php5
...
php5 - server-side, HTML-embedded scripting language (metapackage)

Then use the command (as root):

# apt-get install php5

Using ION GPIO Interfaces

The ION has 13 general purpose input and output (GPIO) interfaces. You can use them to control external devices and/or get specific signal from the environment.

The GPIO can be managed by the Linux's sysfs as follow.

# ls -d /sys/class/gpio/gpio???
/sys/class/gpio/gpio234  /sys/class/gpio/gpio239  /sys/class/gpio/gpio250
/sys/class/gpio/gpio235  /sys/class/gpio/gpio240  /sys/class/gpio/gpio251
/sys/class/gpio/gpio236  /sys/class/gpio/gpio241  /sys/class/gpio/gpio252
/sys/class/gpio/gpio237  /sys/class/gpio/gpio242  /sys/class/gpio/gpio253
/sys/class/gpio/gpio238  /sys/class/gpio/gpio243  /sys/class/gpio/gpio254

For each GPIO you have a dedicated directory. For instance the first GPIO is gpio234 and looking into its directory you have:

# ls /sys/class/gpio/gpio234/
device	direction  power  subsystem  uevent  value

by using file direction you can set the GPIO's direction, and by using file value you can read/write the GPIO level.

For instance, to read from the first GPIO you can do:

ion:~# cat /sys/class/gpio/gpio234/direction 
in
ion:~# cat /sys/class/gpio/gpio234/value     
1

Then, to write a 0 to the same GPIO you should do as follow:

ion:~# echo out > /sys/class/gpio/gpio234/direction
ion:~# cat /sys/class/gpio/gpio234/direction
out
ion:~# echo 0 > /sys/class/gpio/gpio234/value

In order to have a mnemonic name for each GPIOs we provide some symbolic links into /dev directory:

ion:~# ls -d /dev/gpio* 
/dev/gpio0   /dev/gpio11  /dev/gpio3  /dev/gpio6  /dev/gpio9
/dev/gpio1   /dev/gpio12  /dev/gpio4  /dev/gpio7
/dev/gpio10  /dev/gpio2   /dev/gpio5  /dev/gpio8

These manage the corresponding GPIO as described above:

ion:~# cat /dev/gpio0/direction 
in
ion:~# cat /dev/gpio0/value     
1

Using the Virtual developing machine

Our R&D lab has created a developing virtual machine (based on Virtualbox) in order to easily provide a common and standard developing platform. Please visit the page Developing virtual machine for further information.

Personal tools