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月21日 星期六
[XBee] XBee Factory
今天就靠這篇救回我一顆爛掉的XBee, 趕快筆記一下以免以後又要搞很久
2013年9月9日 星期一
2013年9月4日 星期三
[資訊安全] Debug information
今天正想在某個網站採購一些東西, 網頁載入到一半突然噴出這樣的訊息, 這樣甘好?
哪個網站就不說了
2006 MySQL server has gone away in: [select c.categories_id, cd.categories_name from categories c, categories_description cd where c.categories_id=cd.categories_id and c.parent_id= '0' and cd.language_id='1' and c.categories_status='1' order by c.sort_order, cd.categories_name ] 2006 MySQL server has gone away in: [select count(*) as total from sessions where sesskey = '98937f53e2395dcc174f66449017743b']
哪個網站就不說了
2013年9月3日 星期二
[Wordpress] Crayon Syntax Highlighter
開始要在wordpress上面放扣了, 就胡亂找了一些plugin來用一下, 反正就是評比高的就拿來試用看看, 目前是用Crayon Syntax Highlighter感覺很讚, 使用起來也很簡單
安裝後看要不要改設定, Settings > Crayon的Theme有一堆可以用, 還有Font, Toolbar, Code一堆選項可以改
使用上就是在純文字模式下輸入

配合Ultimate Tinymce寫起blog很順手, 再附贈一個教學
reference:
* Top 5 Syntax Highlighter WordPress Plugins
* Learn How To Use The Ultimate TinyMCE Plugin
安裝後看要不要改設定, Settings > Crayon的Theme有一堆可以用, 還有Font, Toolbar, Code一堆選項可以改
使用上就是在純文字模式下輸入
<pre lang="LANG"> // code here </pre>可用的LANG在langs目錄下都查得到, 於是乎範例就像
<pre lang="c">
#include <stdio.h>
void main()
{
printf("Hello World");
return;
}
</pre>

配合Ultimate Tinymce寫起blog很順手, 再附贈一個教學
reference:
* Top 5 Syntax Highlighter WordPress Plugins
* Learn How To Use The Ultimate TinyMCE Plugin
2013年8月29日 星期四
[Python] module & class
最近寫python遇到很笨的問題
$ vi serial.py
import serial
ser = serial.Serial('/dev/ttyUSB0', 9600)
ser.write("hello world!")
錯誤訊息
Traceback (most recent call last): File "serial.py", line 1, in如果照stackoverflow的講法, 應該改為from serial import serialimport serial File "/home/user/python/serial.py", line 4, in ser = serial.Serial('/dev/ttyUSB0', 9600) AttributeError: 'module' object has no attribute 'Serial'
#import serial
from serial import serial
ser = serial.Serial('/dev/ttyUSB0', 9600)
ser.write("hello world!")
錯誤訊息
Traceback (most recent call last): File "serial.py", line 2, in又有人說, 應該改為from serial import *from serial import serial File "/home/user/python/serial.py", line 2, in from serial import serial ImportError: cannot import name serial
#import serial
#from serial import serial
from serial import *
ser = serial.Serial('/dev/ttyUSB0', 9600)
ser.write("hello world!")
錯誤訊息
Traceback (most recent call last): File "serial.py", line 2, in最後把檔名serial.py改掉, 隨便改成foo.py就可以了from serial import serial File "/home/user/python/serial.py", line 2, in from serial import serial ImportError: cannot import name serial
import serial
ser = serial.Serial('/dev/ttyUSB0', 9600)
ser.write("hello world!")
如果再改成
#import serial
from serial import serial
ser = serial.Serial('/dev/ttyUSB0', 9600)
ser.write("hello world!")
錯誤訊息
Traceback (most recent call last): File "s.py", line 2, in如果改回from serial import serial ImportError: cannot import name serial
#import serial
#from serial import serial
from serial import *
ser = serial.Serial('/dev/ttyUSB0', 9600)
ser.write("hello world!")
錯誤訊息
Traceback (most recent call last): File "s.py", line 4, in好吧, 我還沒搞懂python的語法就在亂搞了...ser = serial.Serial('/dev/ttyUSB0', 9600) NameError: name 'serial' is not defined
2013年3月31日 星期日
[RPi] 在Raspberry Pi上使用HDMI轉VGA接頭
話說家中總是有老舊螢幕還是使用VGA介面(D-Sub),那就需要買一個HDMI轉VGA的接頭,再修改Raspberry Pi的/boot/config就可以使用了
簡單說明一定要改的地方有hdmi_drive=2表示強制從HDMI輸出,hdmi_group=2和hdmi_mode=16這兩個參數就視螢幕的解析度調整了
詳細參數可參考官網
簡單說明一定要改的地方有hdmi_drive=2表示強制從HDMI輸出,hdmi_group=2和hdmi_mode=16這兩個參數就視螢幕的解析度調整了
詳細參數可參考官網
# uncomment if you get no picture on HDMI for a default "safe" mode #hdmi_safe=1 # uncomment this if your display has a black border of unused pixels visible # and your display can output without overscan #disable_overscan=1 # uncomment the following to adjust overscan. Use positive numbers if console # goes off screen, and negative if there is too much border #overscan_left=16 #overscan_right=16 #overscan_top=16 #overscan_bottom=16 # uncomment to force a console size. By default it will be display's size minus # overscan. #framebuffer_width=1024 #framebuffer_height=768 # uncomment if hdmi display is not detected and composite is being output hdmi_force_hotplug=1 # uncomment to force a specific HDMI mode (this will force VGA) hdmi_group=2 hdmi_mode=16 # uncomment to force a HDMI mode rather than DVI. This can make audio work in # DMT (computer monitor) modes hdmi_drive=2 # uncomment to increase signal to HDMI, if you have interference, blanking, or # no display config_hdmi_boost=4 # uncomment for composite PAL #sdtv_mode=2 #uncomment to overclock the arm. 700 MHz is the default. arm_freq=1000 # for more options see http://elinux.org/RPi_config.txt gpu_mem=64 core_freq=500 sdram_freq=600 over_voltage=6
2013年2月25日 星期一
[RPi] Disable Screen Blanking in X Window
如果想要把Raspberry Pi當作展示機, 那Raspbian預設10分鐘沒動作畫面就會暗掉就蠻令人困擾的, 通常修改xinitrc就會有作用
reference:
* Disable screen blanking in X-Windows on Raspbian
* How do I prevent the screen from going blank?
$ sudo vi -p ~/.xinitrc /etc/X11/xinit/xinitrc
xset s off # don't activate screensaver xset -dpms # disable DPMS (Energy Star) features. xset s noblank # don't blank the video device exec /etc/alternatives/x-session-manager # start lxde如果再不行的話就要再lightdm.conf新增一個屬性了
$ sudo vi /etc/lightdm/lightdm.conf
[SeatDefaults] xserver-command=X -s 0 -dpms
reference:
* Disable screen blanking in X-Windows on Raspbian
* How do I prevent the screen from going blank?
訂閱:
文章 (Atom)
