Showing posts with label based. Show all posts
Showing posts with label based. Show all posts

Friday, May 6, 2011

Ubuntu Linux: Install RT2870 Chipset Based USB Wireless Adapter

This blog post listed Linux Compatible USB wireless adapters. It seems that many new Linux users frequently have problems learning how to install RT2870 driver under Linux. I also received email requesting installation instructions for the same device. This quick tutorial will explains how to install RT2870 based chipset device with WPA2 authentication and TKIP wireless encryption.

The following instructions are tested on:

Ubuntu Linux 10.04.1 LTSKernel - Linux 2.6.32-24-generic-pae i686 (32 bit)WPA2 with Linksys 160N router

The main problem is conflicting driver which are shipped with default kernel. WPA2 is a method of security wireless networking with optional PSK for home users. The default driver only recognizes driver but always failed to join WPA2 based network. The solution is to install RT2870 driver from the vendor site.

Type the following command to black list default drivers:
$ sudo vi /etc/modprobe.d/blacklist.conf
Append the following driver names:

blacklist rt2800usbblacklist rt2x00libblacklist rt2x00usb

Save and close the file. Use the rmmod command to remove current drivers or just reboot the system:
$ sudo modprobe -r driverName
# you need to remove all of the above drivers one by one:
$ sudo modprobe -r rt2800usb
OR simply reboot the systems:
$ sudo reboot

Type the following command to install required packages so that you can compile source code:
$ sudo apt-get install build-essential fakeroot dpkg-dev
Finally, install Linux kernel headers so that you can compile kernel device drivers:
$ sudo apt-get install linux-headers-$(uname -r)

Visit this page and download USB drivers [RT2870USB(RT2870/RT2770)].

Type the following command:
$ tar -jxvf 2010_0709_RT2870_Linux_STA_v2.4.0.1.tar.bz2
$ cd 2010_0709_RT2870_Linux_STA_v2.4.0.1

First, edit config.mk file as follows so that Network Manager can be used to set WPA2 auth info:
$ vi os/linux/config.mk
Set it as follows:

# Support Wpa_SupplicantHAS_WPA_SUPPLICANT=y# Support Native WpaSupplicant for Network MangerHAS_NATIVE_WPA_SUPPLICANT_SUPPORT=y

Save and close the file. To compile the driver, enter:
$ make
Sample outputs:

make -C toolsmake[1]: Entering directory `/tmp/2010_0709_RT2870_Linux_STA_v2.4.0.1/tools'gcc -g bin2h.c -o bin2hmake[1]: Leaving directory `/tmp/2010_0709_RT2870_Linux_STA_v2.4.0.1/tools'/tmp/2010_0709_RT2870_Linux_STA_v2.4.0.1/tools/bin2hcp -f os/linux/Makefile.6 /tmp/2010_0709_RT2870_Linux_STA_v2.4.0.1/os/linux/Makefilemake -C /lib/modules/2.6.32-24-generic-pae/build SUBDIRS=/tmp/2010_0709_RT2870_Linux_STA_v2.4.0.1/os/linux modulesmake[1]: Entering directory `/usr/src/linux-headers-2.6.32-24-generic-pae' CC [M] /tmp/2010_0709_RT2870_Linux_STA_v2.4.0.1/os/linux/../../common/crypt_md5.o CC [M] /tmp/2010_0709_RT2870_Linux_STA_v2.4.0.1/os/linux/../../common/crypt_sha2.o CC [M] /tmp/2010_0709_RT2870_Linux_STA_v2.4.0.1/os/linux/../../common/crypt_hmac.o CC [M] /tmp/2010_0709_RT2870_Linux_STA_v2.4.0.1/os/linux/../../common/crypt_aes.o......... CC [M] /tmp/2010_0709_RT2870_Linux_STA_v2.4.0.1/os/linux/../../common/rtusb_io.o CC [M] /tmp/2010_0709_RT2870_Linux_STA_v2.4.0.1/os/linux/../../common/rtusb_bulk.o CC [M] /tmp/2010_0709_RT2870_Linux_STA_v2.4.0.1/os/linux/../../common/rtusb_data.o CC [M] /tmp/2010_0709_RT2870_Linux_STA_v2.4.0.1/os/linux/../../common/cmm_data_usb.o CC [M] /tmp/2010_0709_RT2870_Linux_STA_v2.4.0.1/os/linux/../../common/ee_prom.o CC [M] /tmp/2010_0709_RT2870_Linux_STA_v2.4.0.1/os/linux/../../common/rtmp_mcu.o CC [M] /tmp/2010_0709_RT2870_Linux_STA_v2.4.0.1/os/linux/../../common/rtusb_dev_id.o CC [M] /tmp/2010_0709_RT2870_Linux_STA_v2.4.0.1/os/linux/../../os/linux/rt_usb.o CC [M] /tmp/2010_0709_RT2870_Linux_STA_v2.4.0.1/os/linux/../../os/linux/rt_usb_util.o CC [M] /tmp/2010_0709_RT2870_Linux_STA_v2.4.0.1/os/linux/../../os/linux/usb_main_dev.o LD [M] /tmp/2010_0709_RT2870_Linux_STA_v2.4.0.1/os/linux/rt2870sta.o Building modules, stage 2. MODPOST 1 modules CC /tmp/2010_0709_RT2870_Linux_STA_v2.4.0.1/os/linux/rt2870sta.mod.o LD [M] /tmp/2010_0709_RT2870_Linux_STA_v2.4.0.1/os/linux/rt2870sta.komake[1]: Leaving directory `/usr/src/linux-headers-2.6.32-24-generic-pae'

Note: You may see a LOTs of warnings during the compilation, and this is *normal* so don't panic.

Type the following command:
$ sudo make install
Sample outputs:

make -C /tmp/2010_0709_RT2870_Linux_STA_v2.4.0.1/os/linux -f Makefile.6 installmake[1]: Entering directory `/tmp/2010_0709_RT2870_Linux_STA_v2.4.0.1/os/linux'rm -rf /etc/Wireless/RT2870STAmkdir /etc/Wireless/RT2870STAcp /tmp/2010_0709_RT2870_Linux_STA_v2.4.0.1/RT2870STA.dat /etc/Wireless/RT2870STA/.install -d /lib/modules/2.6.32-24-generic-pae/kernel/drivers/net/wireless/install -m 644 -c rt2870sta.ko /lib/modules/2.6.32-24-generic-pae/kernel/drivers/net/wireless//sbin/depmod -a 2.6.32-24-generic-paemake[1]: Leaving directory `/tmp/2010_0709_RT2870_Linux_STA_v2.4.0.1/os/linux'

Again visit this page and download "Firmware RT28XX/RT30XX USB series (RT2870/RT2770/RT3572/RT3070)". Unzip and install the firemware:
$ unzip RT2870_Firmware_V22.zip
$ cd RT2870_Firmware_V22/
#### Make a backup of existing old firmware ####
$ mkdir -p $HOME/backup/lib/firmware
$ cp /lib/firmware/rt2870.bin $HOME/backup/lib/firmware
#### Install the firmware (for 64 bit Linux systems, you may have to use /lib64/firmware) #####
$ sudo cp rt2870.bin /lib/firmware/
##### **** backup and move existing driver, do NOT SKIP this STEP ****######
$ sudo mv /lib/modules/$(uname -r)/kernel/drivers/net/wireless/rt2870sta.ko $HOME/backup/

Type the following commands:
$ mkdir -p $HOME/backup/var/lib/usbutils
$ cp /var/lib/usbutils/usb.ids $HOME/backup/var/lib/usbutils
$ sudo wget -O /var/lib/usbutils/usb.ids http://www.linux-usb.org/usb.ids

Connect your USB device and type the following command to verify that Wireless USB LAN adapter is detected:
$ lsusb
Sample outputs:

Bus 002 Device 007: ID 0411:00e8 MelCo., Inc. Buffalo WLI-UC-G300N Wireless LAN AdapterBus 002 Device 006: ID 05ac:0220 Apple, Inc. Aluminum Keyboard (ANSI)Bus 002 Device 005: ID 05ac:1006 Apple, Inc. Hub in Aluminum KeyboardBus 002 Device 004: ID 413c:2513 Dell Computer Corp.Bus 002 Device 003: ID 413c:2513 Dell Computer Corp.Bus 002 Device 002: ID 8087:0020 Intel Corp. Integrated Rate Matching HubBus 002 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hubBus 001 Device 007: ID 413c:8160 Dell Computer Corp.Bus 001 Device 006: ID 413c:8162 Dell Computer Corp.Bus 001 Device 005: ID 413c:8161 Dell Computer Corp.Bus 001 Device 004: ID 0a5c:4500 Broadcom Corp. BCM2046B1 USB 2.0 Hub (part of BCM2046 Bluetooth)Bus 001 Device 003: ID 0a5c:5800 Broadcom Corp. BCM5880 Secure Applications ProcessorBus 001 Device 002: ID 8087:0020 Intel Corp. Integrated Rate Matching HubBus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub

You need to edit /etc/Wireless/RT2870STA/RT2870STA.dat file, enter:
$ sudo vi /etc/Wireless/RT2870STA/RT2870STA.dat
Set SSID (nixcraft is my SSID):

SSID=nixcraft

Set country (IN = INDIA, US = USA, etc):

CountryCode=IN

Set authentication information (do not skip this if you want WPA2 based authentication):

AuthMode=WPA2EncrypType=TKIPWPAPSK=YOUR-PASSWORD-HERE

See README_STA for other detailed information about each field. Save and close the file.

Type the ifconfig command and you should see ra0:
$ ifconfig ra0

ra0 Link encap:Ethernet HWaddr 00:1d:73:bc:e4:6e inet6 addr: fe80::21d:73ff:febc:e46e/64 Scope:Link UP BROADCAST MULTICAST MTU:1500 Metric:1 RX packets:5157 errors:0 dropped:0 overruns:0 frame:0 TX packets:206 errors:0 dropped:0 overruns:0 carrier:0 collisions:0 txqueuelen:1000 RX bytes:1093810 (1.0 MB) TX bytes:16772 (16.7 KB)

You can now connect to the Internet by clicking on Network manager ( The network-manager is the one which is found in the systray. The icon of two computers, one below to the other on the left-side). Clicking on NM-applet will give you the types of connection/hardware you have available > Select Wireless Device > Select nixcraft SSID (or scan of SSID) > Make sure you set "WPA2" as wireless security. Once connected you can browse the Internet or verify IP info:
$ ifconfig ra0
Sample outputs:

ra0 Link encap:Ethernet HWaddr 00:1d:73:bc:e4:6e inet addr:192.168.1.103 Bcast:192.168.1.255 Mask:255.255.255.0 inet6 addr: fe80::21d:73ff:febc:e46e/64 Scope:Link UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1 RX packets:6711 errors:0 dropped:0 overruns:0 frame:0 TX packets:271 errors:0 dropped:0 overruns:0 carrier:0 collisions:0 txqueuelen:1000 RX bytes:1420879 (1.4 MB) TX bytes:22312 (22.3 KB)

Verify gateway or just ping to public ip:
$ route -n
$ ping google.com
$ ping cyberciti.biz

You need to reinstall the driver using the above steps.

Saturday, November 13, 2010

Context and Learning to Programming of Intelligent Equipment

Context and Learning based Approach to Programming of Intelligent Equipment pdf cover page
.. of Automation of Production in Machine Building, … and Computational Intelligence in development of programming languages for industrial applications such as industrial robots … Context and Learning based Approach to Programming of Intelligent Equipment Andrey V. Gavrilov Department of Automation of Production in Machine Building, Novosibirsk State Technical University Karl Marx Av., 20, Novosibirsk 92, 630092 Russia Andr_gavrilov@yahoo.com Abstract In this paper novel approach for programming of intelligent equipment …

One of most actual problems in development of intelligent systems for manufacturing is human- machine interface. Two kinds of such interfaces are known, oriented on programming and learning respectively. Programming is used usually for industrial robots and other technological equipment. Learning is more oriented for service and toy robotics. There are many different programming languages for different kinds of intelligent equipment, for industrial robots-manipulators, mobile robots, technological equipment [1, 2]. The re-programming of industrial robotic systems is still a difficult, costly, and time consuming operation. In order to increase flexibility, a common approach is to consider the work- cell programming at a high level of abstraction, which enables a description of the sequence of actions at a task-level. A task-level programming environment provides mechanisms to automatically convert high- level task specification into low level code. Task-level programming languages may be procedure oriented [3] and declarative oriented [4, 5, 6, 7] and now we have a tendency to focus on second kind of languages. But in current time practically all programming languages for manufacturing are deterministic and not oriented on usage of learning and fuzzy concepts like in service or military robotics. But it is possible to expect in recent future reduce of difference between industrial and service applications. For example, known plans of Toyota Inc. to employ humanoid robots in automobile manufacturing. So it seems interesting and perspective to apply achievements of AI and Computational Intelligence in development of programming languages for industrial applications such as industrial robots or technological equipment. In this paper we suggest novel approach to programming of robots and technological equipment based on usage of context and learning and so oriented on usage of natural language for learning. In this approach we do not distinguish learning and programming combining in one system declarative (description of context) and procedural knowledge (routines for processing of context). Also here new Context Based Language for Robot (CBLR) is proposed and elements of one are described. This suggested approach is based on research of author during development of system software for transportation industrial robots based on learning [8, 9] and development of software for searching of documents by natural language query [10]. 2. Previous example of usage of similar approach for programming of transportation industrial robots… The language BLRP consisted of following groups of commands: 1) For assignment of context, 2) For control of moving, 3) For control of execution of routines, 4) For definition of conditions, 5) For determination of points in environment (service area) of robot, 6) For description of state of robot and technological equipment, 7) Serving commands. Architecture of software developed for robot consists of subsystems for programming, checking and execution of routines (figure 1). Context included main following parameters: 1) X, Y, Z - coordinates of point, 2) Description of condition operator, 3) State of equipment, 4) State of robot, 5) Number of link of robot, 6) Number of cell of equipment, 7) Number of object. Number in these parameters means identifier. Fig. 1. Architecture of software for transport robot. Programming in this system was replaced by learning. Result of one was knowledge base with associations between words of natural language and sequences of commands for description of context and….