After unsuccessful attempt to compile Archlinux-rt kernel,
I encountered a very good guide describing how to compile a Debian Linux-rt kernel with Xenomai for the RaspberryPi. and a completing page for creating the RPI image.
I can't say I understand it completely, but I managed to combine to two guides and compile my own RaspberryPi Linux-rt kernel.
I'm sure some of the steps are missing and things change very quickly (e.g. links, kernel versions and patches) so anyone following my steps should take that into consideration and adapt to changes.
I started by installing a fresh Debian 32bit x86 on a virtual box.
Follow the picnc guides but remember to adapt the patches and kernel version differences.
I'll try to redo the process and give here a complete guide at a later stage.
"And earthquakes are to a girls guitar they're just another good vibration"
InSAR Processing and more
Showing posts with label software. Show all posts
Showing posts with label software. Show all posts
Tuesday, November 26, 2013
Thursday, August 1, 2013
Machinoid Real-Time Linux for RaspberryPi
Download and install Machinoid following: http://www.machinoid.com/?p=10
apt-get install libtool gfortran
apt-get install libusb-1.0
install xenomai following the instructions in the link above.
sysctl vm.min_free_kbytes=8192
vi /etc/ld.so.conf.d/xenomai.conf
add 2 lines:
# xenomai default configuration
/usr/xenomai/lib
ldconfig
install wifi drivers (after I got problems with rt2800usb driver):
apt-get install firmware-ralink
create new file /etc/modprobe.d/8192cu.conf
add:
# Disable power saving
options 8192cu rtw_power_mgnt=0 rtw_enusbss=1 rtw_ips_mode=1
apt-get install libtool gfortran
apt-get install libusb-1.0
install xenomai following the instructions in the link above.
sysctl vm.min_free_kbytes=8192
vi /etc/ld.so.conf.d/xenomai.conf
add 2 lines:
# xenomai default configuration
/usr/xenomai/lib
ldconfig
install wifi drivers (after I got problems with rt2800usb driver):
apt-get install firmware-ralink
create new file /etc/modprobe.d/8192cu.conf
add:
# Disable power saving
options 8192cu rtw_power_mgnt=0 rtw_enusbss=1 rtw_ips_mode=1
in /etc/dhcp/dhcp.conf
uncomment the timeout line and edit:
timeout 100;
Sunday, July 7, 2013
LSM303 accelerometer on RaspberryPi
After getting my new LSM303 accelerometer, I got my great electronics tec. Daviv Shtibelman to wire it up for RPI.
Connecting LSM303 pins 1 (SCL), 2 (SDA), 6 (GND) and 8 (V3V) to pins 5 (SCL), 3 (SDA), 6 (GND) and 1 (V3V) on the Pi board.
On my ArchlinuxARM OS I had to install i2c-tools:
> pacman -S i2c-tools
And add i2c modules:
> echo i2c-dev > /etc/modules-load.d/ i2c.conf
> echo i2c-bcm2708 >> /etc/modules-load.d/ i2c.conf
> reboot
now to check it works:
> i2cdetect -y 1
got a message like this:
0 1 2 3 4 5 6 7 8 9 a b c d e f
00: -- -- -- -- -- -- -- -- -- -- -- -- --
10: -- -- -- -- -- -- -- -- -- 19 -- -- -- -- 1e --
20: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
30: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
40: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
50: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
60: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
70: -- -- -- -- -- -- -- --
Now, following this, I test it and it works. Now I'm up for creating my own code.
Made some changes to the code:
main.cpp
LSM303DLHC.cpp:
Connecting LSM303 pins 1 (SCL), 2 (SDA), 6 (GND) and 8 (V3V) to pins 5 (SCL), 3 (SDA), 6 (GND) and 1 (V3V) on the Pi board.
On my ArchlinuxARM OS I had to install i2c-tools:
> pacman -S i2c-tools
And add i2c modules:
> echo i2c-dev > /etc/modules-load.d/ i2c.conf
> echo i2c-bcm2708 >> /etc/modules-load.d/ i2c.conf
> reboot
now to check it works:
> i2cdetect -y 1
got a message like this:
0 1 2 3 4 5 6 7 8 9 a b c d e f
00: -- -- -- -- -- -- -- -- -- -- -- -- --
10: -- -- -- -- -- -- -- -- -- 19 -- -- -- -- 1e --
20: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
30: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
40: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
50: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
60: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
70: -- -- -- -- -- -- -- --
Now, following this, I test it and it works. Now I'm up for creating my own code.
Made some changes to the code:
main.cpp
#include"LSM303DLHC.h"
#include<stdio.h>
#include <unistd.h>
/*
getHeading() calculates a tilt-compensated heading.
A float between 0 and 360 degrees is returned. You need
to pass this function both a magneto and acceleration array.
Headings are calculated as specified in AN3192:
http://www.sparkfun.com/datasheets/Sensors/Magneto/Tilt%20Compensated%20Compass.pdf
*/
float getHeading(LSM303& lsm303dlhc);
#define PI 3.141592654
int main(void)
{
uint8_t bajt;
const char *fileN = "/dev/i2c-1";
LSM303 lsm303dlhc(fileN);
lsm303dlhc.enalbe();
while(1)
{
lsm303dlhc.readAccelerationRaw();
lsm303dlhc.readMagnetometerRaw();
printf("acc [m/s^2]: \e[27;1;31m %f \e[m \e[27;1;32m %f \e[m \e[27;1;34m %f \e[m mag: \e[27;1;31m %d \e[m \e[27;1;32m %d \e[m \e[27;1;34m %d\e[m %fdeg\n",
(int16_t)lsm303dlhc.acc_x_raw*0.00957,(int16_t)lsm303dlhc.acc_y_raw*0.00957,-(int16_t)lsm303dlhc.acc_z_raw*0.00957,
(int16_t)lsm303dlhc.mag_x_raw, (int16_t)lsm303dlhc.mag_y_raw, (int16_t)lsm303dlhc.mag_z_raw,getHeading(lsm303dlhc));
usleep(10);
}
}
float getHeading(LSM303& lsm303dlhc)
{
float heading,pitch,roll,xh,yh,zh;
// see section 1.2 in app note AN3192
int magValue[3];
float accelValue[3];
magValue[0] = (int16_t)lsm303dlhc.mag_x_raw;
magValue[1] = (int16_t)lsm303dlhc.mag_y_raw;
magValue[2] = (int16_t)lsm303dlhc.mag_z_raw;
accelValue[0] = (int16_t)lsm303dlhc.acc_x_raw*0.000976531;
accelValue[1] = (int16_t)lsm303dlhc.acc_y_raw*0.000976531;
accelValue[2] = -(int16_t)lsm303dlhc.acc_z_raw*0.000976531;
// see appendix A in app note AN3192
pitch = asin(-accelValue[0]);
roll = asin(accelValue[1]/cos(pitch));
xh = magValue[0] * cos(pitch) + magValue[2] * sin(pitch);
yh = magValue[0] * sin(roll) * sin(pitch) + magValue[1] * cos(roll) - magValue[2] * sin(roll) * cos(pitch);
zh = -magValue[0] * cos(roll) * sin(pitch) + magValue[1] * sin(roll) + magValue[2] * cos(roll) * cos(pitch);
heading = 180*atan2(yh,xh)/PI;
if (heading <0)
heading += 360;
return heading;
}
#include<stdio.h>
#include <unistd.h>
/*
getHeading() calculates a tilt-compensated heading.
A float between 0 and 360 degrees is returned. You need
to pass this function both a magneto and acceleration array.
Headings are calculated as specified in AN3192:
http://www.sparkfun.com/datasheets/Sensors/Magneto/Tilt%20Compensated%20Compass.pdf
*/
float getHeading(LSM303& lsm303dlhc);
#define PI 3.141592654
int main(void)
{
uint8_t bajt;
const char *fileN = "/dev/i2c-1";
LSM303 lsm303dlhc(fileN);
lsm303dlhc.enalbe();
while(1)
{
lsm303dlhc.readAccelerationRaw();
lsm303dlhc.readMagnetometerRaw();
printf("acc [m/s^2]: \e[27;1;31m %f \e[m \e[27;1;32m %f \e[m \e[27;1;34m %f \e[m mag: \e[27;1;31m %d \e[m \e[27;1;32m %d \e[m \e[27;1;34m %d\e[m %fdeg\n",
(int16_t)lsm303dlhc.acc_x_raw*0.00957,(int16_t)lsm303dlhc.acc_y_raw*0.00957,-(int16_t)lsm303dlhc.acc_z_raw*0.00957,
(int16_t)lsm303dlhc.mag_x_raw, (int16_t)lsm303dlhc.mag_y_raw, (int16_t)lsm303dlhc.mag_z_raw,getHeading(lsm303dlhc));
usleep(10);
}
}
float getHeading(LSM303& lsm303dlhc)
{
float heading,pitch,roll,xh,yh,zh;
// see section 1.2 in app note AN3192
int magValue[3];
float accelValue[3];
magValue[0] = (int16_t)lsm303dlhc.mag_x_raw;
magValue[1] = (int16_t)lsm303dlhc.mag_y_raw;
magValue[2] = (int16_t)lsm303dlhc.mag_z_raw;
accelValue[0] = (int16_t)lsm303dlhc.acc_x_raw*0.000976531;
accelValue[1] = (int16_t)lsm303dlhc.acc_y_raw*0.000976531;
accelValue[2] = -(int16_t)lsm303dlhc.acc_z_raw*0.000976531;
// see appendix A in app note AN3192
pitch = asin(-accelValue[0]);
roll = asin(accelValue[1]/cos(pitch));
xh = magValue[0] * cos(pitch) + magValue[2] * sin(pitch);
yh = magValue[0] * sin(roll) * sin(pitch) + magValue[1] * cos(roll) - magValue[2] * sin(roll) * cos(pitch);
zh = -magValue[0] * cos(roll) * sin(pitch) + magValue[1] * sin(roll) + magValue[2] * cos(roll) * cos(pitch);
heading = 180*atan2(yh,xh)/PI;
if (heading <0)
heading += 360;
return heading;
}
LSM303DLHC.cpp:
#include"LSM303DLHC.h"
#include<math.h>
#include<stdio.h>
/*Conection to Raspberry PI:
LSM303 Raspberry PI
VDD -> 3V3(PIN 1)
SDA -> SDA(PIN 3)
SCL -> SCL(PIN 5)
GND -> GND(PIN 6)
*/
#define LSM303DLHC_MAG_ADDRESS (0x3C >> 1)
#define LSM303DLHC_ACC_ADDRESS (0x32 >> 1)
LSM303::LSM303(const char * i2cDeviceName) : i2c_lsm303(i2cDeviceName)
{
}
uint8_t LSM303::readAccRegister(uint8_t regAddr)
{
i2c_lsm303.addrSet(LSM303DLHC_ACC_ADDRESS);
return i2c_lsm303.readByte(regAddr);
}
uint8_t LSM303::readMagRegister(uint8_t regAddr)
{
i2c_lsm303.addrSet(LSM303DLHC_MAG_ADDRESS);
return i2c_lsm303.readByte(regAddr);
}
void LSM303::writeAccRegister(uint8_t regAddr,uint8_t byte)
{
i2c_lsm303.addrSet(LSM303DLHC_ACC_ADDRESS);
i2c_lsm303.writeByte(regAddr, byte);
}
void LSM303::writeMagRegister(uint8_t regAddr, uint8_t byte)
{
i2c_lsm303.addrSet(LSM303DLHC_MAG_ADDRESS);
i2c_lsm303.writeByte(regAddr, byte);
}
void LSM303::enalbe(void)
{
writeAccRegister(LSM303_CTRL_REG1, 0b10010111);
writeAccRegister(LSM303_CTRL_REG4, 0b00001000);
writeMagRegister(LSM303_MR_REG, 0x00);
}
void LSM303::readAccelerationRaw(void)
{
uint8_t block[6];
i2c_lsm303.addrSet(LSM303DLHC_ACC_ADDRESS);
i2c_lsm303.readBlock(0x80 | LSM303_OUT_X_L_A, sizeof(block), block);
acc_x_raw = (int16_t)(block[0] | (block[1] << 8)) >> 4;
acc_y_raw = (int16_t)(block[2] | block[3] << 8) >> 4;
acc_z_raw = (int16_t)(block[4] | block[5] << 8) >> 4;
}
void LSM303::readMagnetometerRaw(void)
{
uint8_t block[6];
i2c_lsm303.addrSet(LSM303DLHC_MAG_ADDRESS);
i2c_lsm303.readBlock(0x80 | LSM303_OUT_X_H_M, sizeof(block), block);
mag_x_raw = (int16_t)(block[1] | block[0] << 8);
mag_y_raw = (int16_t)(block[5] | block[4] << 8);
mag_z_raw = (int16_t)(block[3] | block[2] << 8);
}
void LSM303::readAcceleration(void)
{
readAccelerationRaw();
}
#include<math.h>
#include<stdio.h>
/*Conection to Raspberry PI:
LSM303 Raspberry PI
VDD -> 3V3(PIN 1)
SDA -> SDA(PIN 3)
SCL -> SCL(PIN 5)
GND -> GND(PIN 6)
*/
#define LSM303DLHC_MAG_ADDRESS (0x3C >> 1)
#define LSM303DLHC_ACC_ADDRESS (0x32 >> 1)
LSM303::LSM303(const char * i2cDeviceName) : i2c_lsm303(i2cDeviceName)
{
}
uint8_t LSM303::readAccRegister(uint8_t regAddr)
{
i2c_lsm303.addrSet(LSM303DLHC_ACC_ADDRESS);
return i2c_lsm303.readByte(regAddr);
}
uint8_t LSM303::readMagRegister(uint8_t regAddr)
{
i2c_lsm303.addrSet(LSM303DLHC_MAG_ADDRESS);
return i2c_lsm303.readByte(regAddr);
}
void LSM303::writeAccRegister(uint8_t regAddr,uint8_t byte)
{
i2c_lsm303.addrSet(LSM303DLHC_ACC_ADDRESS);
i2c_lsm303.writeByte(regAddr, byte);
}
void LSM303::writeMagRegister(uint8_t regAddr, uint8_t byte)
{
i2c_lsm303.addrSet(LSM303DLHC_MAG_ADDRESS);
i2c_lsm303.writeByte(regAddr, byte);
}
void LSM303::enalbe(void)
{
writeAccRegister(LSM303_CTRL_REG1, 0b10010111);
writeAccRegister(LSM303_CTRL_REG4, 0b00001000);
writeMagRegister(LSM303_MR_REG, 0x00);
}
void LSM303::readAccelerationRaw(void)
{
uint8_t block[6];
i2c_lsm303.addrSet(LSM303DLHC_ACC_ADDRESS);
i2c_lsm303.readBlock(0x80 | LSM303_OUT_X_L_A, sizeof(block), block);
acc_x_raw = (int16_t)(block[0] | (block[1] << 8)) >> 4;
acc_y_raw = (int16_t)(block[2] | block[3] << 8) >> 4;
acc_z_raw = (int16_t)(block[4] | block[5] << 8) >> 4;
}
void LSM303::readMagnetometerRaw(void)
{
uint8_t block[6];
i2c_lsm303.addrSet(LSM303DLHC_MAG_ADDRESS);
i2c_lsm303.readBlock(0x80 | LSM303_OUT_X_H_M, sizeof(block), block);
mag_x_raw = (int16_t)(block[1] | block[0] << 8);
mag_y_raw = (int16_t)(block[5] | block[4] << 8);
mag_z_raw = (int16_t)(block[3] | block[2] << 8);
}
void LSM303::readAcceleration(void)
{
readAccelerationRaw();
}
Sunday, June 30, 2013
Real-Time Kernel for RaspberryPi
After installing and running ArchLinuxARM on my RaspberryPi, I tried to compile a real-time kernel.
With the help of moonman, following this ArchLinuxARM forum thread, I downloaded the RT patch:
https://www.kernel.org/pub/linux/kernel/projects/rt/3.6/patch-3.6.11.4-rt36.patch.gz
and the PKGBUILD:
# git clone https://github.com/archlinuxarm/PKGBUILDs.git
following this, I updated pacman:
# pacman -Syy
and installed some packages:
# pacman -S kernel26-headers file base-devel abs
next
# cd PKGBUILDs/core/linux-raspberrypi
and edit the PKGBUILD file to include the patch in the source array:
source=('config'
'change-default-console-loglevel.patch'
'usb-add-reset-resume-quirk-for-several-webcams.patch'
'args-uncompressed.txt'
'boot-uncompressed.txt'
'imagetool-uncompressed.py'
'https://raspy-juice.googlecode.com/svn/trunk/linux-rtc/0001-rtc-pcf8523.patch'
'https://raspy-juice.googlecode.com/svn/trunk/linux-rtc/0002-pcf8523-i2c-register-dt.patch'
'patch-3.6.11.4-rt36.patch')
add a patch line:
With the help of moonman, following this ArchLinuxARM forum thread, I downloaded the RT patch:
https://www.kernel.org/pub/linux/kernel/projects/rt/3.6/patch-3.6.11.4-rt36.patch.gz
and the PKGBUILD:
# git clone https://github.com/archlinuxarm/PKGBUILDs.git
following this, I updated pacman:
# pacman -Syy
and installed some packages:
# pacman -S kernel26-headers file base-devel abs
next
# cd PKGBUILDs/core/linux-raspberrypi
and edit the PKGBUILD file to include the patch in the source array:
source=('config'
'change-default-console-loglevel.patch'
'usb-add-reset-resume-quirk-for-several-webcams.patch'
'args-uncompressed.txt'
'boot-uncompressed.txt'
'imagetool-uncompressed.py'
'https://raspy-juice.googlecode.com/svn/trunk/linux-rtc/0001-rtc-pcf8523.patch'
'https://raspy-juice.googlecode.com/svn/trunk/linux-rtc/0002-pcf8523-i2c-register-dt.patch'
'patch-3.6.11.4-rt36.patch')
add a patch line:
patch -Np1 -i "${srcdir}/patch-3.6.11.4-rt36.patch"
and add md5sums at the end of the PKGBUILD file. to get the correct number run:
# md5sum patch-3.6.11.4-rt36.patch
next for the build:
# makepkg --asroot -Acs
The process has failed with some rejections of patches. So we need to manually apply the patches:
first look for rejections:
# find . -name "*.rej"
then edit the file and the .rej file:
# vim XXX.c XXX.c.rej
replacing XXX with the file path and name.
Then use :split to split the screen :next to change one screen to .rej file and ctrl+ww to switch between files.
add the lines marked by + and remove lines marked by - (lines with no +- sign are used for orientation.
after manually patching all files, edit the PKGBUILD file to ignore the kernel git and the patches (adding # at the start of the line)
add a line to src/linux/security/apparmor/sid.c:
"#include <linux/cache.h>"
add a line to src/linux/security/apparmor/sid.c:
"#include <linux/cache.h>"
re-run:
# makepkg --asroot
Now for the installation part:
# pacman -U linux-headers-raspberrypi-3.6.11-11-armv6h.pkg.tar.xz linux-raspberrypi-3.6.11-11-armv6h.pkg.tar.xz
And reboot.
Well, it didn't work.
Now for the installation part:
# pacman -U linux-headers-raspberrypi-3.6.11-11-armv6h.pkg.tar.xz linux-raspberrypi-3.6.11-11-armv6h.pkg.tar.xz
And reboot.
Well, it didn't work.
Wednesday, January 16, 2013
Fedora 17 Linux packges
These are MY needed packages, feel free to follow my steps or ignore this.
1. Add rpmfusion to yum repo list:
> sudo yum localinstall --nogpgcheck http://download1.rpmfusion.org/free/fedora/rpmfusion-free-release-stable.noarch.rpm http://download1.rpmfusion.org/nonfree/fedora/rpmfusion-nonfree-release-stable.noarch.rpm
2.
sudo yum install -y yumex tcsh gmt ImageMagick ipython scipy scitools spyder gthumb nautilus-open-terminal bluecurve-icon-theme gnome-applets gnome-themes bluecurve-gnome-theme filezilla gimp swig lshw lshw-gui gnome-tweak-tool libreoffice gv gcc gcc-gfortran gcc-c++ dconf-editor tigervnc-server
install chrome from google
install virtualbox from oracle site.
copy panels:
on old machine: dconf dump /org/gnome/gnome-panel/ > panels
on new machine: dconf load /org/gnome/gnome-panel/ < panels
change with dconf-editor:
/org/gnome/desktop/interface/icon-theme to Bluecurve
/org/gnome/desktop/wm/preferences/theme Clearlooks
/org/gnome/desktop/background/show-desktop-icons True
change user shell to tcsh: sudo usermod -s /bin/tcsh USERNAME
install microsoft fonts:
wget http://www.my-guides.net/en/images/stories/fedora12/msttcore-fonts-2.0-3.noarch.rpm
sudo rpm -ivh msttcore-fonts-2.0-3.noarch.rpm
6.Install obspy as root:
sudo easy_install -N obspy.core obspy.mseed obspy.sac obspy.gse2 obspy.imaging obspy.signal obspy.arclink obspy.datamark obspy.db obspy.earthworm obspy.fissures obspy.iris obspy.neries obspy.realtime obspy.segy obspy.seg2 obspy.seisan obspy.seishub obspy.sh obspy.taup obspy.wav obspy.xseed
1. Add rpmfusion to yum repo list:
> sudo yum localinstall --nogpgcheck http://download1.rpmfusion.org/free/fedora/rpmfusion-free-release-stable.noarch.rpm http://download1.rpmfusion.org/nonfree/fedora/rpmfusion-nonfree-release-stable.noarch.rpm
2.
sudo yum install -y yumex tcsh gmt ImageMagick ipython scipy scitools spyder gthumb nautilus-open-terminal bluecurve-icon-theme gnome-applets gnome-themes bluecurve-gnome-theme filezilla gimp swig lshw lshw-gui gnome-tweak-tool libreoffice gv gcc gcc-gfortran gcc-c++ dconf-editor tigervnc-server
install chrome from google
install virtualbox from oracle site.
copy panels:
on old machine: dconf dump /org/gnome/gnome-panel/ > panels
on new machine: dconf load /org/gnome/gnome-panel/ < panels
change with dconf-editor:
/org/gnome/desktop/interface/icon-theme to Bluecurve
/org/gnome/desktop/wm/preferences/theme Clearlooks
/org/gnome/desktop/background/show-desktop-icons True
change user shell to tcsh: sudo usermod -s /bin/tcsh USERNAME
install microsoft fonts:
wget http://www.my-guides.net/en/images/stories/fedora12/msttcore-fonts-2.0-3.noarch.rpm
sudo rpm -ivh msttcore-fonts-2.0-3.noarch.rpm
6.Install obspy as root:
sudo easy_install -N obspy.core obspy.mseed obspy.sac obspy.gse2 obspy.imaging obspy.signal obspy.arclink obspy.datamark obspy.db obspy.earthworm obspy.fissures obspy.iris obspy.neries obspy.realtime obspy.segy obspy.seg2 obspy.seisan obspy.seishub obspy.sh obspy.taup obspy.wav obspy.xseed
Thursday, May 10, 2012
Howto run a process automatically when a certain mail is downloaded by Thunderbird
In order to run a file whenever a certain mail arrives to my inbox I created a filter using the Thunderbird add-on FiltaQuilla. The add-on expand the messages filtering options and add an option to "run a file". when a certain mail match the filter, Thunderbird will run the file specified. I use a python code - code.py so in the filter configuration under Linux (Fedora core 14) I use this line:
/usr/bin/python,/home/UserName/code.py,-a
The line is a comma separated 3 parts line. The first part is the python interperter, the second is the script name to run and the last part is an argument needed for the script to run. Omitting the first part and the filter wont work.
/usr/bin/python,/home/UserName/code.py,-a
The line is a comma separated 3 parts line. The first part is the python interperter, the second is the script name to run and the last part is an argument needed for the script to run. Omitting the first part and the filter wont work.
Thursday, July 28, 2011
HowTo use a computer without a screen attached
The Problem:
I have a Linux machine (Fedora 14) with no screen attached. I view the graphics via VNC server. I had to adjust the system to use the Nvidia driver and tweak it for no screen.
The solution:
First we need to install the Nvidia driver. Then, we need to adjust the X configuration for no screen and our preferred resolution.
for more details see: http://forums.fedoraforum.org/showthread.php?t=204752
1. Update the kernel:
2. Add rpmfusion to your repository.
3. Depending on your card add nvidia akmod to the kernel and the proper driver. for a Gforce 9500GT on my 64bit machine:
4. Edit the xorg.conf file. don't forget to adjust the Nvidia card for no screen attached by adding:
Option "ConnectedMonitor" "CRT"
to the device section and adjust the screen resolution under the Screen section:
I have a Linux machine (Fedora 14) with no screen attached. I view the graphics via VNC server. I had to adjust the system to use the Nvidia driver and tweak it for no screen.
The solution:
First we need to install the Nvidia driver. Then, we need to adjust the X configuration for no screen and our preferred resolution.
for more details see: http://forums.fedoraforum.org/showthread.php?t=204752
1. Update the kernel:
su yum update kernel* reboot
2. Add rpmfusion to your repository.
su rpm -Uvh http://download1.rpmfusion.org/free/fedora/rpmfusion-free-release-stable.noarch.rpm http://download1.rpmfusion.org/nonfree/fedora/rpmfusion-nonfree-release-stable.noarch.rpm
3. Depending on your card add nvidia akmod to the kernel and the proper driver. for a Gforce 9500GT on my 64bit machine:
yum install akmod-nvidia-260.19.36-1.fc14.x86_64 xorg-x11-drv-nvidia-libs-260.19.36-1.fc14.x86_64
4. Edit the xorg.conf file. don't forget to adjust the Nvidia card for no screen attached by adding:
Option "ConnectedMonitor" "CRT"
to the device section and adjust the screen resolution under the Screen section:
Section "Device"
Identifier "Card0"
Driver "nvidia"
Option "ConnectedMonitor" "CRT"
EndSection
Section "Screen"
Identifier "Screen0"
Device "Card0"
Monitor "Monitor0"
SubSection "Display"
Viewport 0 0
Modes "1280x1024"
EndSubSection
EndSection
Thursday, July 14, 2011
Daichi - ALOS : finding Images and Baseline Calculation
Using JAXA satellite "DAICHI" (ALOS) for SAR Interferometry might raise the need for calculating perpendicular baselines. One can use AUIG site to locate the needed images for interferometry and use PALSAR baseline calculator CalcBP for calculating perpendicular baselines. more info is available here.
Thursday, March 31, 2011
Installing Linux Fedora Core 14
Well, after a long time using Fedora 11 I'm moving on to Fedora 14.
Here I'll detail the steps I used for the installation.
I generally follow my Fedora 10 installation guide with some changes of course.
LiveCD:
I use a liveCD (download page) to install.
after loading the system via cd,
I use the "Install to Hard Drive" icon.
next,next,next.
Giving the Hostname, setting location, giving a good root password.
File System:
Since I use several hard drives I need to configure the file system. I use one 1.5TB disk as my home, another one for data and processing and one for the system so all the installation will only deal with the last one. later I'll mount all the rest of the disks.
so the type of installation for me is "Replace Existing Linux System(s)", but with "Review and modify layout" switch on and I select the system disk as "Install Target Devices".
Next I change the partitions and mount points of all disks as needed.
Finally, The boot loader is set up and the system is installed on the hard drive.
Updates and softwares:
As a first step few softwares should be installed and update (this might take forever):
Customizing:
remove SElinux policy
disable filrewall
configure remote desktop
add user to sudo:
su --login -c 'visudo'
Now go below the line:
root ALL=(ALL) ALL
press a, and type the following
username ALL=(ALL) ALL
where username is the username you use to login. Next press Escape.
Now, if you want to be prompted for your root password each time you use the sudo command go to this line:
# %wheel ALL=(ALL) ALL
and with your cursor pointing on # press x
If you don't want to be prompted for your root password each time you use the sudo command go to this line:
# %wheel ALL=(ALL) NOPASSWD: ALL
and with your cursor pointing on # press x
Next, press :wq to save and exit. (type the : as well)
* Adding your user to the wheel group
Just type:
su -c 'gpasswd -a username wheel'
* Testing sudo
To test if you have done it correctly as a simple user type:
$ sudo whoami
If everything is working properly the command should return the word 'root'.
change autologin for user:
sudo vi /etc/gdm/custom.conf
under [daemon], add:
AutomaticLoginEnable=true
AutomaticLogin=yourUserName
edit /etc/fstab for mounting external HD (LAN):
//XXX.XX.XX.XX/DATA /mountpoint cifs auto,owner,rw,username=XXX,uid=XXX,gid=XXX 0 0
NOTE! - it will not mount on startup. need to do: "sudo mount mountpoint" to mount. one can add password=[user-passwd] after username=[username] or instead username and password : credentials=[path to a file containing user and password]
the file should contain the remote system properties:
username=[username]
password=[userpassword]
Enable Num Lock on GNOME startup:
su -c 'yum install numlockx'
su -c 'cp /etc/gdm/Init/Default /etc/gdm/Init/Default_backup'
su -c 'gedit /etc/gdm/Init/Default'
And add the following lines at the end of the file before the exit 0.
if [ -x /usr/bin/numlockx ]; then
/usr/bin/numlockx on
fi
set the samba server
set the mail server:
sudo vi /etc/ssmtp/ssmtp.conf
change the line:
mailhub=mail
to:
mailhub=[your outgoing mail server]
Set the screen resolution for vnc and no monitor:
create xorg.conf file
sudo Xorg :1 -configure
sudo cp /root/xorg.conf.new /etc/X11/xorg.conf
and add lines to the xorg.conf file:
Section "Monitor"
Identifier "Monitor0"
ModelName "LCD Panel 1280x1024"
HorizSync 31.5 - 64.0
VertRefresh 56.0 - 65.0
Option "dpms"
EndSection
Section "Device"
### Available Driver options are:-
### Values: <i>: integer, <f>: float, <bool>: "True"/"False",
### <string>: "String", <freq>: "<f> Hz/kHz/MHz",
### <percent>: "<f>%"
### [arg]: arg optional
#Option "SWcursor" # [<bool>]
#Option "HWcursor" # [<bool>]
#Option "NoAccel" # [<bool>]
#Option "ShadowFB" # [<bool>]
#Option "UseFBDev" # [<bool>]
#Option "Rotate" # [<str>]
#Option "VideoKey" # <i>
#Option "FlatPanel" # [<bool>]
#Option "FPDither" # [<bool>]
#Option "CrtcNumber" # <i>
#Option "FPScale" # [<bool>]
#Option "FPTweak" # <i>
#Option "DualHead" # [<bool>]
Identifier "Card0"
Driver "vesa"
BusID "PCI:1:0:0"
EndSection
Section "Screen"
Identifier "Screen0"
Device "Card0"
Monitor "Monitor0"
SubSection "Display"
Viewport 0 0
Depth 24
Modes "1280x1024"
EndSubSection
EndSection
set the panels and desktop background as you like it.
Install RPMfusion repositories following: www.rpmfusion.org/Configuration
add true type fonts from windows
Here I'll detail the steps I used for the installation.
I generally follow my Fedora 10 installation guide with some changes of course.
LiveCD:
I use a liveCD (download page) to install.
after loading the system via cd,
I use the "Install to Hard Drive" icon.
next,next,next.
Giving the Hostname, setting location, giving a good root password.
File System:
Since I use several hard drives I need to configure the file system. I use one 1.5TB disk as my home, another one for data and processing and one for the system so all the installation will only deal with the last one. later I'll mount all the rest of the disks.
so the type of installation for me is "Replace Existing Linux System(s)", but with "Review and modify layout" switch on and I select the system disk as "Install Target Devices".
Next I change the partitions and mount points of all disks as needed.
Finally, The boot loader is set up and the system is installed on the hard drive.
Updates and softwares:
As a first step few softwares should be installed and update (this might take forever):
system-config-network
yumex
gconf-editor
gedit-plugins
gthumb
nautilus0open-terminal
tango-icon-theme
tango-icon-extras
fonts for Hebrew
all stix fonts
cm-lgc fonts
blender
gimp
gv
ImageMagick
inkscape
filezilla
thunderbird
emacs
open office
vim-enhanced
gcc
gmt
grace
HDF
HDF5
lapack
netcdf
numpy
python support for open office
compat-gcc
glade3
ipython
pango-devel
wget
tcsh
system-config-samba
system-config-users
system-config-nfs
dos2unix
selinux configuration gui
matplotlib
scipy
scitools
kdocker
numlockx
bluecurve icons
ssmtp
yumex
gconf-editor
gedit-plugins
gthumb
nautilus0open-terminal
tango-icon-theme
tango-icon-extras
fonts for Hebrew
all stix fonts
cm-lgc fonts
blender
gimp
gv
ImageMagick
inkscape
filezilla
thunderbird
emacs
open office
vim-enhanced
gcc
gmt
grace
HDF
HDF5
lapack
netcdf
numpy
python support for open office
compat-gcc
glade3
ipython
pango-devel
wget
tcsh
system-config-samba
system-config-users
system-config-nfs
dos2unix
selinux configuration gui
matplotlib
scipy
scitools
kdocker
numlockx
bluecurve icons
ssmtp
Customizing:
remove SElinux policy
disable filrewall
configure remote desktop
add user to sudo:
su --login -c 'visudo'
Now go below the line:
root ALL=(ALL) ALL
press a, and type the following
username ALL=(ALL) ALL
where username is the username you use to login. Next press Escape.
Now, if you want to be prompted for your root password each time you use the sudo command go to this line:
# %wheel ALL=(ALL) ALL
and with your cursor pointing on # press x
If you don't want to be prompted for your root password each time you use the sudo command go to this line:
# %wheel ALL=(ALL) NOPASSWD: ALL
and with your cursor pointing on # press x
Next, press :wq to save and exit. (type the : as well)
* Adding your user to the wheel group
Just type:
su -c 'gpasswd -a username wheel'
* Testing sudo
To test if you have done it correctly as a simple user type:
$ sudo whoami
If everything is working properly the command should return the word 'root'.
change autologin for user:
sudo vi /etc/gdm/custom.conf
under [daemon], add:
AutomaticLoginEnable=true
AutomaticLogin=yourUserName
edit /etc/fstab for mounting external HD (LAN):
//XXX.XX.XX.XX/DATA /mountpoint cifs auto,owner,rw,username=XXX,uid=XXX,gid=XXX 0 0
NOTE! - it will not mount on startup. need to do: "sudo mount mountpoint" to mount. one can add password=[user-passwd] after username=[username] or instead username and password : credentials=[path to a file containing user and password]
the file should contain the remote system properties:
username=[username]
password=[userpassword]
Enable Num Lock on GNOME startup:
su -c 'yum install numlockx'
su -c 'cp /etc/gdm/Init/Default /etc/gdm/Init/Default_backup'
su -c 'gedit /etc/gdm/Init/Default'
And add the following lines at the end of the file before the exit 0.
if [ -x /usr/bin/numlockx ]; then
/usr/bin/numlockx on
fi
set the samba server
set the mail server:
sudo vi /etc/ssmtp/ssmtp.conf
change the line:
mailhub=mail
to:
mailhub=[your outgoing mail server]
Set the screen resolution for vnc and no monitor:
create xorg.conf file
sudo Xorg :1 -configure
sudo cp /root/xorg.conf.new /etc/X11/xorg.conf
and add lines to the xorg.conf file:
Section "Monitor"
Identifier "Monitor0"
ModelName "LCD Panel 1280x1024"
HorizSync 31.5 - 64.0
VertRefresh 56.0 - 65.0
Option "dpms"
EndSection
Section "Device"
### Available Driver options are:-
### Values: <i>: integer, <f>: float, <bool>: "True"/"False",
### <string>: "String", <freq>: "<f> Hz/kHz/MHz",
### <percent>: "<f>%"
### [arg]: arg optional
#Option "SWcursor" # [<bool>]
#Option "HWcursor" # [<bool>]
#Option "NoAccel" # [<bool>]
#Option "ShadowFB" # [<bool>]
#Option "UseFBDev" # [<bool>]
#Option "Rotate" # [<str>]
#Option "VideoKey" # <i>
#Option "FlatPanel" # [<bool>]
#Option "FPDither" # [<bool>]
#Option "CrtcNumber" # <i>
#Option "FPScale" # [<bool>]
#Option "FPTweak" # <i>
#Option "DualHead" # [<bool>]
Identifier "Card0"
Driver "vesa"
BusID "PCI:1:0:0"
EndSection
Section "Screen"
Identifier "Screen0"
Device "Card0"
Monitor "Monitor0"
SubSection "Display"
Viewport 0 0
Depth 24
Modes "1280x1024"
EndSubSection
EndSection
set the panels and desktop background as you like it.
Install RPMfusion repositories following: www.rpmfusion.org/Configuration
add true type fonts from windows
Monday, April 27, 2009
ROI PAC installation
UPDATE: Oct 9, 2011 (for version 3.0.1):
first download ROI-PAC and test data from open channel Foundation
I will assume the tar files are extracted at home directory (~), but it can be anywhere you wish.
don't forget to grand read/write access to relevant users.
make sure you have at least gcc and gfortran installed on your system.
go to ~/ROI_PAC_3_0_1/ROI_PAC/ directory.
follow steps described in ~/ROI_PAC_3_0_1/ROI_PAC/AAREADME_BUILD_ROIPAC up until line:
which uncompress
make sure you have a TEST DIR testing data to test the compiled program. this directory should be tared but not gzipped using:
gunzip roi_pac_test_dir.tar.gz
this will convert the roi_pac_test_dir.tar.gz to roi_pac_test_dir.tar
then create a directory test-runs in the ROI_PAC directory.
cd test_runs
and run the multitest.sh script:
../contrib/multitest.sh /FULLPATH/roi_pac_testdir.tar /FULLPATH/ROI_PAC_3_0_1/ROI_PAC/multibuild-xxxxxx-yyyy/installs/share/roi_pac /FULLPATH/ROI_PAC_3_0_1/ROI_PAC/multibuild-xxxxxx-yyyy/installs/BUILD1/bin ... ... ... /FULLPATH/ROI_PAC_3_0_1/ROI_PAC/multibuild-xxxxxx-yyyy/installs/BUILDN/bin
where:
FULLPATH is the path to your home directory (or where ever the install is)
xxxxxx-yyyy is the multibuild date-time stamp
and BUILD1 to BUILDN are all the compilers sub directories in /FULLPATH/ROI_PAC_3_0_1/ROI_PAC/multibuild-xxxxxx-yyyy/installs/ e.g. defaults, gfortran, gfortran64 etc.
check for the fastest build by checking the batchlog files for each build in test-runs directory.
go to multibuild directory and into installs. get the bin directory from the desired compiler directory and copy it to the ~/ROI_PAC_3_0_1/ROI_PAC directory.
look also at ROI_PAC Wiki for updates and patches.
now you can use ROI PAC, but keep in mined orbits and other auxiliary data should also be available for processing.
first download ROI-PAC and test data from open channel Foundation
I will assume the tar files are extracted at home directory (~), but it can be anywhere you wish.
don't forget to grand read/write access to relevant users.
make sure you have at least gcc and gfortran installed on your system.
go to ~/ROI_PAC_3_0_1/ROI_PAC/ directory.
follow steps described in ~/ROI_PAC_3_0_1/ROI_PAC/AAREADME_BUILD_ROIPAC up until line:
which uncompress
make sure you have a TEST DIR testing data to test the compiled program. this directory should be tared but not gzipped using:
gunzip roi_pac_test_dir.tar.gz
this will convert the roi_pac_test_dir.tar.gz to roi_pac_test_dir.tar
then create a directory test-runs in the ROI_PAC directory.
cd test_runs
and run the multitest.sh script:
../contrib/multitest.sh /FULLPATH/roi_pac_testdir.tar /FULLPATH/ROI_PAC_3_0_1/ROI_PAC/multibuild-xxxxxx-yyyy/installs/share/roi_pac /FULLPATH/ROI_PAC_3_0_1/ROI_PAC/multibuild-xxxxxx-yyyy/installs/BUILD1/bin ... ... ... /FULLPATH/ROI_PAC_3_0_1/ROI_PAC/multibuild-xxxxxx-yyyy/installs/BUILDN/bin
where:
FULLPATH is the path to your home directory (or where ever the install is)
xxxxxx-yyyy is the multibuild date-time stamp
and BUILD1 to BUILDN are all the compilers sub directories in /FULLPATH/ROI_PAC_3_0_1/ROI_PAC/multibuild-xxxxxx-yyyy/installs/ e.g. defaults, gfortran, gfortran64 etc.
check for the fastest build by checking the batchlog files for each build in test-runs directory.
go to multibuild directory and into installs. get the bin directory from the desired compiler directory and copy it to the ~/ROI_PAC_3_0_1/ROI_PAC directory.
- note: I moved the bin directory to: ~/ROI_PAC_3_0/ROI_PAC/BIN/LIN
look also at ROI_PAC Wiki for updates and patches.
now you can use ROI PAC, but keep in mined orbits and other auxiliary data should also be available for processing.
Installing Linux Fedora Core 10
Most of the info can be found here
I will only add some relevant steps to InSAR processing as I use it and steps I found useful.
installing gnome and most of the distro (including tcsh as it is my favorite shell)
- change nautilus to open always in browser
- remove SElinux policy
- remove option in keyboard options - allow mouse to be controlled by keypad
- add vino vnc option to user
- change autologin for user: vi /etc/gdm/gdm.schemas
- add user to sudo:
su --login -c 'visudo'
Now go below the line:
root ALL=(ALL) ALL
press a, and type the following
username ALL=(ALL) ALL
where username is the username you use to login. Next press Escape.
Now, if you want to be prompted for your root password each time you use the sudo command go to this line:
# %wheel ALL=(ALL) ALL
and with your cursor pointing on # press x
If you don't want to be prompted for your root password each time you use the sudo command go to this line:
# %wheel ALL=(ALL) NOPASSWD: ALL
and with your cursor pointing on # press x
Next, press :wq to save and exit. (type the : as well)
* Adding your user to the wheel group
Just type:
su -c 'gpasswd -a username wheel'
* Testing sudo
To test if you have done it correctly as a simple user type:
$ sudo whoami
If everything is working properly the command should return the word 'root'.
- adding windows fonts:
wget http://www.my-guides.net/en/images/stories/fedora10/msttcore-fonts-2.0-2.noarch.rpm
su -c 'rpm -ivh msttcore-fonts-2.0-2.noarch.rpm'
- open terminal here in nautilus
su -c 'yum install nautilus-open-terminal'
- Enable Num Lock on GNOME startup
su -c 'yum install numlockx'
su -c 'cp /etc/gdm/Init/Default /etc/gdm/Init/Default_backup'
su -c 'gedit /etc/gdm/Init/Default'
And add the following lines at the end of the file before the exit 0.
if [ -x /usr/bin/numlockx ]; then
/usr/bin/numlockx on
fi
- add to install:
yum extender
yum Fastest Mirror Plugin
GMT
qgis
grace
filezilla
ipython
KDocker
google-earth
wine
g77
bluecurve icons
gnash - for flash viewing
- setting /etc/X11/xorg.conf for display with no monitor attached:
make sure to use a video card which is not onboard (or perhaps this is only valid for the 965 intel mobo?)
- edit /etc/fstab for mounting external HD (LAN):
//XXX.XX.XX.XX/DATA /mountpoint cifs auto,owner,rw,username=XXX,uid=XXX,gid=XXX 0 0
NOTE! - it will not mount on startup. need to do: "sudo mount mountpoint" to mount. one can add password=[user-passwd] after username=[username] or instead username and password : credentials=[path to a file containing user and password]
the file should contain the remote system properties:
username=[username]
password=[userpassword]
- adding python modules
for gui: http://easygui.sourceforge.net/index.html
scipy
numpy
matplotlib
ipython
pylab
in a case of emergency: enabling write on a system error:
mount -t ext3 /dev/sda1 / -o remount,rw
- installing ROI PAC
- adding axillary data
Subscribe to:
Posts (Atom)