Saturday, October 27, 2012

fixing ethernet under lucid

Got a very new computer. Precise works like a charm on it, but no internet connection under lucid. Network card is unclaimed, because the driver is too old.

Download the latest e1000e from sourceforge (2.1.4 at the moment) in /usr/src and extract it. Then create the following dkms.conf in the e1000e directory:
PACKAGE_NAME="e1000e"
PACKAGE_VERSION="2.1.4"
CLEAN="make -C src/ clean"
MAKE="make -C src/ BUILD_KERNEL=$kernelver KERNELDIR=/lib/modules${kernelver}/build"
BUILT_MODULE_NAME[0]="e1000e"
BUILT_MODULE_LOCATION="src/"
DEST_MODULE_LOCATION="/updates"
AUTOINSTALL="yes"
REMAKE_INITRD="yes"
Then 
dkms add -m e1000e -v 2.1.4
dkms build -m e1000e -v 2.1.4
dkms install -m e1000e -v 2.1.4
Note:
Without an internet connection it's pretty hard to install the required packages like dkms, so the trick is to boot into Precise and then chroot into Lucid.

Wednesday, October 24, 2012

Single click in KDE without KDE

Open ~/.kde/share/config/kdeglobals and add/edit

[KDE]
SingleClick=false

save and reopen the applications for the changes to take effect

Monday, October 8, 2012

Mobile Millenium project

http://traffic.berkeley.edu/
Mobile Millennium is a research project that includes a pilot traffic-monitoring system that uses the GPS in cellular phones to gather traffic information, process it, and distribute it back to the phones in real time.

Vehicle platooning in the EU

http://www.euronews.com/2012/09/24/test-driving-a-road-train/
The EU funded SARTRE project (Safe Road-Trains for the Environment) is working to develop what is called vehicle platooning. This means that only the first vehicle has a driver. Developers hope that the idea will improve safety, efficiency and mileage, will reduce journey times, road congestion and pollution from cars. Various surveys have shown that 90% of accidents are due to boredom while driving on motorways, but with SARTRE a car can drive itself up the motorway. 

The idea has been around for a long time, maybe over 20 years, and there has been many attempts at it. Maybe this time it's the right attempt. After all the technology has matured a lot, and latest legal developments with the Google car make autonomous vehicles seem more realistic.

Thursday, September 6, 2012

Internet connection sharing

Informations from here:
https://help.ubuntu.com/community/Internet/ConnectionSharing

Use the Advanced Gateway Configuration Method. Basically:
- install dnsmasq
- stop the dnsmasq service
- edit /etc/dnsmasq.conf and add the following lines
interface=eth0
dhcp-range=192.168.1.50,192.168.1.90,infinite
dhcp-host=golfcart-lowlevel,192.168.1.3,infinite
- start dnsmasq

On Precise, the network manager has its own instance of dnsmasq running, so there is some conflict. The following might help get rid of it:
http://sokratisg.wordpress.com/2012/03/31/ubuntu-precise-12-04-get-rid-of-nms-dnsmasq-and-setup-your-own/

INSTRUCTIONS TO CONFIGURE THE MASTER COMPUTER AS A GATEWAY WITH DNS AND DHCP

The master computer connects to the internet via the 3G USB dongle. Other
computers on the LAN should benefit from that connection.

In the following:
- internet connection comes from broadband --> ppp0
- LAN is connected on eth3
- LAN subnet mask is 192.168.1.0
- master's IP is 192.168.1.2
- lowlevel's IP is 192.168.1.3



I followed the guide at:
https://help.ubuntu.com/community/Internet/ConnectionSharing


a) Using network manager, configure the ethernet connection to be static IP
192.168.1.2 : in the IPv4 tab set Method to Manual, Address to 192.168.1.2,
Netmask to 192.168.1.0 and leave the gateway field empty (or 0.0.0.0)
Click Routes and select "use this connection only for resources on its network".


b) DHCP / DNS
set up the box as a DHCP server so that whoever connects can get and IP and
connect to the internet.

sudo apt-get install dnsmasq
sudo /etc/init.d/dnsmasq stop

Edit /etc/dnsmasq.conf and add the following two lines:
interface=eth3
dhcp-range=192.168.1.50,192.168.1.90,infinite
dhcp-host=golfcart-lowlevel,192.168.1.3,infinite

the last line assigns a fixed IP to golfcart-lowlevel

sudo /etc/init.d/dnsmasq start



c) Install a script that will run at boot time to create iptables rules
sudo ./install
this copies load_iptables to /etc/init.d and sets it up as a boot up script
check that script to see how iptables are configured
to verify that they are: sudo iptables-save

the iptables script is:
# delete existing rules
iptables -F
iptables -t nat -F
iptables -t mangle -F
iptables -X
iptables -t nat -X
iptables -t mangle -X

# enable ip forwarding
echo "1" > /proc/sys/net/ipv4/ip_forward

# set up masquerading
iptables -t nat -A POSTROUTING -o ppp0 -j MASQUERADE
iptables -t nat -A POSTROUTING -o wlan0 -j MASQUERADE

# save these rules
iptables-save > /dev/null
d) configure client to get their IP via DHCP

Friday, August 3, 2012

Grub2

On my machines, I like to have 2 linux partitions, one is my active partition, the other one for experimenting, or as a backup during upgrade periods, etc. So usually what I do is to create a small grub partition (50MB) or so, and use it as a first stage booting:

- From the MBR launch GRUB on the grub partition
- ask which operating system to boot and chainload
- From the partition boot record (PBR), launch GRUB on that partition and boot the kernel

Recent Ubuntu systems do not come with Grub-legacy any more so I had to use GRUB2. Here is the configuration file that goes in the grub partition.

set default="1"

menuentry 'Ubuntu Precise on /dev/sda1 (old install)' {
set root=(hd0,1)
multiboot /boot/grub/core.img
}

menuentry 'Ubuntu Precise on /dev/sda6 (clone of old install)' {
set root=(hd0,6)
multiboot /boot/grub/core.img
}

Friday, June 29, 2012

Gnome Session Over SSH

I managed to start a remote gnome session following this guide.
http://www.bgevolution.com/blog/gnome-session-over-ssh

log in a tty: Cntrl-Alt-F2
start a X session: xinit -- :1
ssh with X forwarding: ssh -X user@host
(optionally use -C for compression)
then start gnome: gnome-session

Apparently, instead of running "gnome-session", it's possible to run "kde"

Very easy, then once it's setup, use Cntrl-Alt-F7 and Cntrl-Alt-F8 to switch between you local and remote session.

Thursday, March 22, 2012

Kiva systems

These little robots move the shelves around the warehouse. They claim that it makes the process of collecting the items more efficient.


These are made by kiva systems: www.kivasystems.com

Recently, Amazon has announced that it will acquire Kiva Systems for $775 million in cash. The deal is expected to close in the second quarter of 2012.

Wired has an interesting article about it too. According to this article on Analog Devices' website, the robots use vision to recognize markers on the floor and under the shelves to localize themselves.

Features of the system includes:
  • after a while, shelves with most demanded articles end up on the border of the warehouse, more readily available than less often asked for items. This increases efficiency, and it's an emerging outcome of the system: no need for optimization of the layout.
  • since the robots can work just as well in the dark, only certain parts of the warehouse have to be illuminated, where the human operators are working, thus reducing electricity consumption (but it probably does make up for the energy consumed by the robots...)
  • I like the collaboration between robots and human. It would have been very costly and actually impossible to have humanoid robots go around the warehouse and collect the items on the shelf. Although this would have been more intuitive (more human like), it is a much better idea to move the shelves around. Great out of the box thinking here..!
Altogether this reminds me of MANNA, a fiction novel by Marshall Brain, in which robots end up dominating our world, starting from ... fast food junctions:
"Depending on how you want to think about it, it was funny or inevitable or symbolic that the robotic takeover did not start at MIT, NASA, Microsoft or Ford. It started at a Burger-G restaurant in Cary, NC on May 17. It seemed like such a simple thing at the time, but May 17 marked a pivotal moment in human history."

Friday, March 9, 2012

Working with a webcam

I am currently working on a project to monitor road traffic from cameras. As a result I am playing with OpenCV (and ROS). I bought 2 Altair USB webcams and got problems with them.

Here are some tools to playback video:
- cheese
- xawtv -v 1 -c /dev/video0
- luvcview -d /dev/video0
- mplayer tv:// -tv driver=v4l2:device=/dev/video1

In particular, luvcview has a nice GUI that allows to control video parameters, which turned out to be necessary to turn off the auto exposure mode and adjust it manually.

I had this problem where it was impossible to playback video from both of them at the same time. The solution was to set an option in the uvcvideo driver:

sudo rmmod uvcvideo
sudo modprobe uvcvideo quirks=128
 
This will be reset every reboot. If this works, create the following file:
 
sudo vi /etc/modprobe.d/uvcvideo.conf 

containing the line:

 
options uvcvideo quirks=128
 
reference: http://renoirsrants.blogspot.com/2011/07/multiple-webcams-on-zoneminder.html 

Friday, March 2, 2012

Mobileye

We got a demo from mobileye recently: http://mobileye.com/
A camera mounted on the windshield, detects cars, lanes and pedestrians, and warns you when you are getting to close or drifting out of your lane. The videos were very convincing. We got to test in real life too, although too briefly to really confirm what had seen in the videos.



The product costs about $1000, including installation. It can be installed in almost any car, but this needs to be done by a professional. Some governments give subsidies for it, and some insurance companies reduce your premium if you install one. Apparently some car manufacturers are planning to include the system in their new cars...