2013年11月9日 星期六

[Linux] Ubuntu 10.04在x220下找不到ethernet

因為Ubuntu 12.04用不習慣, 只好裝回10.04, 但杯具馬上發生, 安裝完後竟然找不到ethernet
dmesg|grep -in eth
空
沒有網路也沒辦法下載套件,source等, 什麼都沒辦法做, 還好有估到一篇

解決步驟 1. 查詢裝置類型
$ lspci -nn|grep -in eth
5:00:19.0 Ethernet controller [0200]: Intel Corporation Device [8086:1502] (rev 04)
2. 根據vendor id + device id搜尋, 8086是Intel Corporation, 1502是Intel 82579LM Gigabit Network Card

3. 去intel網站下載適合的驅動程式 先搜尋"82579", 再作業系統欄位選擇"Linux", 會得到e1000e-2.5.4.tar.gz

4. 最後就編譯安裝, 重新啟動網路, 搞定, 看到ifconfig有eth0真是太感動了
$ cd e1000e-2.5.4/src$ make
make -C /lib/modules/2.6.32-38-generic/build SUBDIRS=/home/sosorry/driver/e1000e-2.5.4/src modules
make[1]: Entering directory `/usr/src/linux-headers-2.6.32-38-generic'
  CC [M]  /home/sosorry/driver/e1000e-2.5.4/src/netdev.o
  CC [M]  /home/sosorry/driver/e1000e-2.5.4/src/ethtool.o
  CC [M]  /home/sosorry/driver/e1000e-2.5.4/src/param.o
  CC [M]  /home/sosorry/driver/e1000e-2.5.4/src/82571.o
  CC [M]  /home/sosorry/driver/e1000e-2.5.4/src/ich8lan.o
  CC [M]  /home/sosorry/driver/e1000e-2.5.4/src/80003es2lan.o
  CC [M]  /home/sosorry/driver/e1000e-2.5.4/src/mac.o
  CC [M]  /home/sosorry/driver/e1000e-2.5.4/src/nvm.o
  CC [M]  /home/sosorry/driver/e1000e-2.5.4/src/phy.o
  CC [M]  /home/sosorry/driver/e1000e-2.5.4/src/manage.o
  CC [M]  /home/sosorry/driver/e1000e-2.5.4/src/kcompat.o
  LD [M]  /home/sosorry/driver/e1000e-2.5.4/src/e1000e.o
  Building modules, stage 2.
  MODPOST 1 modules
  CC      /home/sosorry/driver/e1000e-2.5.4/src/e1000e.mod.o
  LD [M]  /home/sosorry/driver/e1000e-2.5.4/src/e1000e.ko
make[1]: Leaving directory `/usr/src/linux-headers-2.6.32-38-generic'
$ sudo make install
make -C /lib/modules/2.6.32-38-generic/build SUBDIRS=/home/sosorry/driver/e1000e-2.5.4/src modules
make[1]: Entering directory `/usr/src/linux-headers-2.6.32-38-generic'
  Building modules, stage 2.
  MODPOST 1 modules
make[1]: Leaving directory `/usr/src/linux-headers-2.6.32-38-generic'
gzip -c ../e1000e.7 > e1000e.7.gz
# remove all old versions of the driver
find /lib/modules/2.6.32-38-generic -name e1000e.ko -exec rm -f {} \; || true
find /lib/modules/2.6.32-38-generic -name e1000e.ko.gz -exec rm -f {} \; || true
install -D -m 644 e1000e.ko /lib/modules/2.6.32-38-generic/kernel/drivers/net/e1000e/e1000e.ko
/sbin/depmod -a || true
install -D -m 644 e1000e.7.gz /usr/share/man/man7/e1000e.7.gz
man -c -P'cat > /dev/null' e1000e || true
e1000e.
$ sudo /etc/init.d/networking restart


reference: Fix for non-working wired ethernet on Dell Latitude E6520 with Intel 82579 based adapter running Ubuntu 10.04 LTS Lucid

2013年11月3日 星期日

[RPi] vcgencmd commands

vcgencmd是firmware#362371才多出來的新功能, 可以配合參數看一些資訊 首先列出可以用的參數
/opt/vc/bin/vcgencmd commands
commands="vcos, ap_output_control, ap_output_post_processing, vchi_test_init, vchi_test_exit, pm_set_policy, pm_get_status, pm_show_stats, pm_start_logging, pm_stop_logging, version, commands, set_vll_dir, led_control, set_backlight, set_logging, get_lcd_info, set_bus_arbiter_mode, cache_flush, otp_dump, codec_enabled, get_camera, get_mem, measure_clock, measure_volts, measure_temp, get_config, hdmi_ntsc_freqs, hdmi_status_show, pwm_speedup, render_bar, disk_notify, inuse_notify, sus_suspend, sus_status, sus_is_enabled, sus_stop_test_thread, egl_platform_switch, mem_validate, mem_oom, mem_reloc_stats, file, vctest_memmap, vctest_start, vctest_stop, vctest_set, vctest_get"
舉例來說, 想看目前安裝的firmware是哪一個版本
/opt/vc/bin/vcgencmd version
Sep  1 2013 23:27:46 
Copyright (c) 2012 Broadcom
version 4f9d19896166f46a3255801bc1834561bf092732 (clean) (release)
比如說想看目前BCM2835這顆SoC上的溫度
/opt/vc/bin/vcgencmd measure_temp
temp=47.1'C
比如說查看目前可以使用的codec
for codec in H264 MPG2 WVC1 MPG4 MJPG WMV9 ; do \
     echo -e "$codec:\t$(vcgencmd codec_enabled $codec)" ; \
done
H264: H264=enabled
MPG2: MPG2=disabled
WVC1: WVC1=disabled
MPG4: MPG4=enabled
MJPG: MJPG=enabled
WMV9: WMV9=disabled
還有很多可以用的參數, 詳見github

reference:
* RPI vcgencmd usage
* VideoCore Tools

2013年10月15日 星期二

[RPi][轉錄] Building and installing wxPython 2.9.4.0 on Raspberry Pi (Raspbian)

直接紀錄步驟好了

1. 安裝必要的套件
$ sudo apt-get install python-wxgtk2.8 python-wxtools wx2.8-i18n libwxgtk2.8-dev libgtk2.0-dev

2. 下載source和patch
$ cd ~
$ wget "http://downloads.sourceforge.net/project/wxpython/wxPython/2.9.4.0/wxPython-src-2.9.4.0.tar.bz2"
$ wget "http://downloads.sourceforge.net/project/wxpython/wxPython/2.9.4.0/wxPython-src-2.9.4.1.patch"
$ tar xvjf wxPython-src-2.9.4.0.tar.bz2
$ patch -p 0 -d wxPython-src-2.9.4.0/ < wxPython-src-2.9.4.1.patch
$ mkdir wxPython-src-2.9.4.0/bld

3. 再安裝相依的套件
$ sudo apt-get install dpkg-dev build-essential swig python-dev libwebkit-dev libjpeg-dev libtiff-dev checkinstall freeglut3 freeglut3-dev libgtk2.0-dev libsdl1.2-dev libgstreamer-plugins-base0.10-dev libgstreamer0.10-dev libgconf2-dev libglapi-mesa libosmesa6 libglu1-mesa-dev libglu1-mesa mesa-common-dev

4. 等非常非常久的編譯和安裝
$ cd wxPython-src-2.9.0.1/wxPython
$ python build-wxpython.py --build_dir=../bld --install

5. 確認版本
$ python -V

6. 複製需要的library
$ sudo cp /usr/local/lib/libwx_* /usr/lib

7. 測試
$ python demo/demo.py

reference: Building and installing wxPython 2.9.4.0 on Raspberry Pi (Raspbian)

2013年9月22日 星期日

[RPi] Raspberry Pi : The Unofficial Tutorial

一篇還不錯的tutorial, 剛好有些東西是我正在找的

2013年9月21日 星期六

[XBee] XBee Factory

今天就靠這篇救回我一顆爛掉的XBee, 趕快筆記一下以免以後又要搞很久
1. Take the module out of the interface board.
2. Connect the interface board to the computer.
3. Open X-CTU make sure Baud Rate is set to 9600
4. Go to "Modem Configuration"
5. Put a check in the "Always update firmware" box
6. Select proper modem from drop down menu,
7. Select proper function set and firmware version from drop down menus.
8. Click on the "Write" button. After a few seconds of trying to read the modem, you will get an Info box that says Action Needed. At this point, CAREFULLY insert the module into the interface board.
9. You may get the info box again a short while after, just use the reset button on the interface board.
reference: Xbee Factory -Hardware reset without serial communication

2013年9月9日 星期一

[海海人生] 公司營業項目

公司營業項目如果從經濟部的公司行號營業項目帶碼表檢索系統找的話永遠不知道應該要選哪個, 不過還好經濟部全國商工行政服務入口網有提供另外一份代碼表和說明, 不過不知道有沒有定期更新就是了