古人智慧

Just Do it!
上士聞道,勤而行之;中士聞道,若存若亡;下士聞道,大笑之。不笑,不足以爲道。
~ 道德經 41

「實現夢想不是追逐成功,而是在於賦予生命意義,人生中的每個決定與聲音都有其重要含義。」"The key to realizing a dream is to focus not on success but on significance — and then even the small steps and little victories along your path will take on greater meaning."
電視名人-歐普拉·溫芙蕾(OPRAH WINFREY)

搜尋此網誌

Translation

2015年5月30日 星期六

[Banana Pro] Building u-boot, script.bin and linux-kernel

這幾天這個link被移掉,好不容易找到,就乾脆把它copy下來。。。
因爲要開始做一些device driver,最好是kernel自己重新build,並把header file和相關files保留給接下來build driver module使用,不然會遇到module無法被kernel接受。


只要照着做,把script.bin, uImage, modules做好copy到SD卡就可開機。


refer to:

BananaPro/Pi:Building u-boot, script.bin and linux-kernel


Note: all of the following instructions (and also in the sections 2, 3 and 4 
following on from this page) have to be carried out on a Linux computer, not the Bananan Pro/Pi itself!!

This page describes the process of combining sunxi u-boot, the Linux kernel and other bits together to create the basis of a bootable OS from scratch, and which can also be the basis for further hacking. 
Of course, we are not building a whole distribution here, we're only building u-boot, the kernel and a handful of tools, and then using an existing root file system to get a usable OS. Depending on the size of the root file system, we suggest you use a 4GB or larger SD card – a type class 10 would be faster and more stable. SD card partitioning and formatting will be taken care of later. 
We'll outline on this page two methods to build what we need: one is step by step, the other is the easiest way by using sunxi BSP.

2015年5月24日 星期日

[3DP] 吹風機掛架 Hair-Dryer holder

吹風機的體積不小,電線又長,收藏真是讓人頭疼。
每次用吹風機時,都沒地方掛,放在洗臉槽旁又很危險,怕不小心被電到,不然就短路。
今天剛好有個靈感,試看看吧!
作品分享:http://www.thingiverse.com/thing:845034
開始畫圖,SketchUp是個不錯的3D建模的軟件,可以很快把心中的想法用簡單的工具畫出3D模型。不過,如果想在菱菱角角弄個R角,在這軟件還真難做。。。XD
這是用Sketchup畫出來的結構圖,有180°和90°的插頭。


2015年5月10日 星期日

[Banana Pro][WiringBP] How to control the GPIO by C/C++



上次用Python做GPIO控制,個人認為用於簡單電路測試或控制足夠。但是,未來有一些計劃會用到interrupt,用C/C++開發應該會是主要做法。


WiringBP是由LeMaker改寫Drogon開發的Wiring Pi
root@bpro:/home/regis# git clone https://github.com/LeMaker/WiringBP -b bananapro
root@bpro:/home/regis# chmod +x ./build
root@bpro:/home/regis# sudo ./build

安裝好之後,查看GPIO的status:
root@bpro:/home/regis/WiringBP/examples# gpio readall 



[Banana Pro][RPi.GPIO_BP]用Python來寫GPIO控制程式


本次實驗是用Python來做GPIO控制,做法非常簡單易用。

先確定系統在更新狀態:
root@bpro:/home/regis# apt-get update
root@bpro:/home/regis# apt-get upgrade

再來安裝 git:
root@bpro:/home/regis# apt-get install git
root@bpro:/home/regis# apt-get install python-dev
root@bpro:/home/regis# apt-get install gcc g++ make git-core vim

裝Python的gpio控制模組:
### For Banana Pro
root@bpro:/home/regis# git clone https://github.com/LeMaker/RPi.GPIO_BP -b bananapro
root@bpro:/home/regis# cd RPi.GPIO_BP
root@bpro:/home/regis# python setup.py install
root@bpro:/home/regis# sudo python setup.py install

[Banana Pro][Wifi]解決Wifi不通 - 1'st step Wifi enable


當Banana Pro板子與HD組好後,就開始要試試他的功能。
我用HDMI接上電視,開機很順利的到login畫面,
但是,我沒usb keyboard,也不知Wifi是否有通,就算通也不知ip address。。。

這一關就卡住了。。。
後來,借了usb keyboard,總算可以login,但是發現Wifi是不運作的,真是糟啊!

[Banana Pro]解決Power Key無法關機










我在使用這系統時,發現按了Power button(左上角)時,系統並不會下指令讓Banana Pro關機。

上網搜尋一番,找到方法如下:














先安裝ACPI 模組:
regis@bpro:~$ sudo apt-get install acpid

[Banana Pro] - boot from SATA 120G HD ﹣﹣ 用HD開機

拿到板子後,做了很多實驗,也安裝不少軟件和設定,其中遇到很多問題,裝了一堆不知名的軟件模組,搞的Linux有點亂。

想了幾個解決方案,那就是用HD切幾個partition,其中2個來做實驗,只留一個乾淨來做使用。而SD卡就專職開機就好,避免開機失敗。

就開始吧~~~~

root@bpro / # fdisk /dev/sda
Command (m for help): p

Disk /dev/sda: 120.0 GB, 120034123776 bytes
255 heads, 63 sectors/track, 14593 cylinders, total 234441648 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes

Disk identifier: 0x00002b91

[Banana Pro]測試Linux的I2C tools [GY-273] [HMC5883]三軸電子羅盤 e-compass




用了Arduino之後,買了不少module都是I2C的interface。
本次實驗就用GY-273電子羅盤來試試Banana Pro的I2C的功能。
因為Bananian Linux是非常乾淨的OS,必須先安裝I2C tools

regis@bpro:~$ sudo apt-get install i2c-tools python-smbus 

安裝成功之後,會有這幾個features
i2cdetect – 用來列舉I2C bus和上面所有的裝置
i2cdump – 顯示裝置上所有register的值
i2cget – 讀取裝置上某個register的值
i2cset – 寫入裝置上某個register


2015年5月9日 星期六

BananaPro + HD holder by 3D printer


因為Banana Pro是用SD卡來啟動,
這幾天安裝gcc compiler和GPIO的部份時,
發現SD卡空間有限,
而且,
如果不小心可能開不了機。

Banana Pro有SATA的interface,
可以很容易接上SATA的HD,
剛好手邊有一顆2.5" 120GB,
就上吧!!


《成果圖》

2015年5月6日 星期三

Banana Pro case by 3D printer


 話說想玩玩其他系統,
沒錯,
這次買了 ~ 香蕉你的芭樂~
經過漫長等待
終於到手了!!!


開箱~~~~~~