﻿{"id":1172,"date":"2014-02-09T01:36:05","date_gmt":"2014-02-08T17:36:05","guid":{"rendered":"http:\/\/nick.txtcc.com\/?p=1172"},"modified":"2021-11-17T11:27:03","modified_gmt":"2021-11-17T03:27:03","slug":"cubietruck-%e5%ae%89%e8%a3%85lubuntu%e7%ac%94%e8%ae%b0","status":"publish","type":"post","link":"http:\/\/nick.txtcc.com\/index.php\/linux\/1172","title":{"rendered":"Cubietruck \u5b89\u88c5lubuntu\u7b14\u8bb0"},"content":{"rendered":"<p>\u7cfb\u7edf\u4e0b\u8f7d\u5730\u5740:\u00a0<a href=\"http:\/\/dl.cubieboard.org\/software\/a20-cubietruck\/lubuntu\/\">http:\/\/dl.cubieboard.org\/software\/a20-cubietruck\/lubuntu\/<\/a><\/p>\n<p>\u5176\u5b83\u4e0b\u8f7d\u5730\u5740:\u00a0<a href=\"http:\/\/cubieboard.org\/download\/\">http:\/\/cubieboard.org\/download\/<\/a><\/p>\n<p>\u7ebf\u5237\u5de5\u5177:\u00a0<a href=\"http:\/\/docs.cubieboard.org\/downloads\">http:\/\/docs.cubieboard.org\/downloads<\/a><\/p>\n<p>\u9ed8\u8ba4\u7528\u6237\u540d\u5bc6\u7801linaro:linaro<\/p>\n<h2 id=\"configuration\">Configuration<\/h2>\n<div>\n<h3 id=\"ssh_connecting\">Install tools and change default setting<\/h3>\n#sudo passwd root\n#sudo apt-get install -y bash-completion vim tmux\n#sudo apt-get install -y build-essential make gcc g++ git-core x11vnc\n\n#ls \/sys\/class\/leds\/*\/brightness | xargs -i -n1 echo &#8220;echo 0 > {}&#8221; | sh\n#locale-gen en_US.UTF-8\n#dpkg-reconfigure locales\n#echo &#8220;export LC_ALL=en_US.UTF-8&#8221; >> \/etc\/profile\n#echo &#8220;auto eth0:1&#8221; >> \/etc\/network\/interfaces\n#echo &#8220;iface eth0:1 inet static&#8221; >> \/etc\/network\/interfaces\n#echo &#8220;address 192.168.2.123&#8221; >> \/etc\/network\/interfaces\n#echo &#8220;netmask 255.255.255.0&#8221; >> \/etc\/network\/interfaces\n#echo bcmdhd >> \/etc\/modules\n\n\u00a0\n\n<\/div>\n<h3 id=\"ssh_connecting\">VNC<\/h3>\n<div>\n\n#vi \/etc\/init\/x11vnc.conf\n\nstart on login-session-start\nscript\nx11vnc -display :0 -auth \/var\/run\/lightdm\/root\/:0 -forever -bg -rfbport 5900\nend script\n\n#reboot\n\n<\/div>\n<h3 id=\"set_time_zonedatetime\">Set Time Zone\/DateTime<\/h3>\n<div>\n\n1.Set time zone\n<pre>  $sudo tzselect<\/pre>\nSelect the Asia , press Enter and chose China ,at last selet Beijing.\n\n2. Cope file to \/etc directory\n<pre>  $sudo cp \/usr\/share\/zoneinfo\/Asia\/Shanghai \/etc\/localtime<\/pre>\n3. Update time\n<pre>  $sudo ntpdate time.windows.com<\/pre>\n<\/div>\n<h3 id=\"set_keyboard_language\">Set keyboard language<\/h3>\n<div>\n\nTo be defined \u2026.\n\n<\/div>\n<h3 id=\"flashplayer\">Flashplayer<\/h3>\n<div>\n\nDownload the\u00a0<a title=\"http:\/\/dl.cubieboard.org\/media\/flashplayerarm.tar.gz\" href=\"http:\/\/dl.cubieboard.org\/media\/flashplayerarm.tar.gz\" target=\"_blank\" rel=\"nofollow noopener\">flashplayerarm<\/a>,type:\n<pre>$tar zxvf flashplayerarm.tar.gz  \n$sudo cp libpepflashplayer.so \/usr\/lib\/chromium-browser\/plugins\n$sudo cp default \/etc\/chromium-browser<\/pre>\n<\/div>\n<h3 id=\"wifi\">Wifi<\/h3>\n<div>\n\n<strong>CB1 and CB2 do not integraed wifi chip on board ,but we can use USB WIFI.\u00a0<\/strong>Make sure the wifi driver you use have been loaded. If not ,use\n<pre>  $insmod \/lib\/modules\/3.4.XX\/kernel\/drivers\/net\/wireless\/XXX.ko<\/pre>\n<strong>CB3(cubietruck) has Integrated wifi chip .<\/strong>\n\nType :\u00a0<code>modprobe bcmdhd<\/code>\u00a0to load the driver .\n\nAdd &#8220;bcmdhd&#8221; at the end of file \/etc\/modules\u00a0<strong>to activate WiFi during boot<\/strong>. For ecample with Lubuntu Desktop:\n<pre>  $sudo nano \/etc\/modules<\/pre>\n<strong>Configure wifi at cubieboards and cubietruck the same way as descibed her:<\/strong>\n<pre>  $apt-get install linux-firmware\n  $reboot\n  $ifconfig wlan0 up   \/\/open the wifi ,maybe wlan1 ..\n  $iwlist wlan0 scan   \/\/scan the wifi signal\n  $wpa_passphrase SSID passwd >> \/etc\/wpa_supplicant.conf  \/\/ the SSid is name of signal want to be used\n  $vi \/etc\/network\/interfaces<\/pre>\nAdd below configuration to \/etc\/network\/interfaces\n<pre>  auto wlan0\n  iface wlan0 inet dhcp\n  wpa-conf \/etc\/wpa_supplicant.conf<\/pre>\nAdd below configuration to \/etc\/resolv.conf\n<pre>  nameserver 8.8.8.8<\/pre>\nReboot the cubieboard,auto gain the IP.\n\n<\/div>\n<h3 id=\"setting_cpu_frequency\">Setting CPU Frequency<\/h3>\n<div>\n\nCubieboard CPU frequency can be adjusted in real time, , the following file save as shell file, or placed in \/ etc \/ rc.local before the exit 0 can be executed. Specific CPU frequency maximum and minimum values \u200b\u200bcan be set based on usage .\n<pre>  #!\/bin\/sh\n  echo ondemand > \/sys\/devices\/system\/cpu\/cpu0\/cpufreq\/scaling_governor\n  echo 1000000 > \/sys\/devices\/system\/cpu\/cpu0\/cpufreq\/scaling_max_freq\n  echo 600000 > \/sys\/devices\/system\/cpu\/cpu0\/cpufreq\/scaling_min_freq\n  echo 25 > \/sys\/devices\/system\/cpu\/cpufreq\/ondemand\/up_threshold\n  echo 10 > \/sys\/devices\/system\/cpu\/cpufreq\/ondemand\/sampling_down_factor<\/pre>\nAfter testing, Cubieboard single core version (A10) CPU frequency can be overclocked to 1.2GHz, stable operation (would be better to stick a CPU heatsink); Cubieboard dual-core version (A20) can also be overclocked to 1.2GHz\n<h2 id=\"developing\">Developing<\/h2>\n<div><\/div>\n<h3 id=\"using_serial_debug_port\">Using serial debug port<\/h3>\n<div>\n\nThe tutorial how to use TTL cable:\u00a0<a title=\"http:\/\/linux-sunxi.org\/Cubieboard\/TTL\" href=\"http:\/\/linux-sunxi.org\/Cubieboard\/TTL\" target=\"_blank\" rel=\"nofollow noopener\">http:\/\/linux-sunxi.org\/Cubieboard\/TTL<\/a>\n\nInstall the tool name minicom in your computer:\n<pre>  $sudo apt-get install minicom<\/pre>\nSet the minicom configuratiaon, TTL and cubieboard are connected ,then\u00a0<code>minicom<\/code>in the terminal ,enter into the console.\n\n<\/div>\n<h3 id=\"installing_target_toolchains\">Installing target Toolchains<\/h3>\n<div>\n<pre>  $sudo apt-get update\n  $sudo apt-get upgrade\n  $sudo apt-get install vim build-essential git libusb-1.0-0-dev pkg-config -y<\/pre>\n<\/div>\n<h2 id=\"hardware_testing\">Hardware Testing<\/h2>\n<div>\n\n<strong>The best way to test hardware is install the office firmware from\u00a0<a title=\"http:\/\/dl.cubieboard.org\" href=\"http:\/\/dl.cubieboard.org\/\" target=\"_blank\" rel=\"nofollow noopener\">http:\/\/dl.cubieboard.org<\/a>\u00a0and usr office fitting from<a title=\"http:\/\/docs.cubieboard.org\/addons\" href=\"http:\/\/docs.cubieboard.org\/addons\" target=\"_blank\" rel=\"nofollow noopener\">http:\/\/docs.cubieboard.org\/addons<\/a>\uff0cwhich can find the problem quickly you met. Of course ,you should save the data before reinstall firmware.<\/strong>\n\n<\/div>\n<h3 id=\"leds_on_cubieboaed\">LEDs On Cubieboaed<\/h3>\n<div>\n\nThese are blue LED1 meaning heartbeat and green LED2 on cb1 and cb2. LED1 &#8211; GPIO port PH21, LED2 &#8211; GPIO port PH20.\nThese are LED1~4 on cb3(cubietruck). LED1 &#8211; PH21, LED2 &#8211; PH20,LED3 &#8211; PH11,LED4 &#8211; PH07.Refer to\u00a0<a title=\"http:\/\/docs.cubieboard.org\/faq\/faqs\" href=\"http:\/\/docs.cubieboard.org\/faq\/faqs\" target=\"_blank\" rel=\"nofollow noopener\">FAQ about cubietruck\u00a0<\/a>\n<strong>For cb1 and cb2:<\/strong>\n<pre>  $echo 1 > \/sys\/class\/gpio\/export   \/\/open the PH20\n  $echo 2 > \/sys\/class\/gpio\/export   \/\/open the PH21<\/pre>\nThe directories \/sys\/class\/gpio\/gpio1_PH20 and\/sys\/class\/gpio\/gpio2_PH21 had been create .\n<pre>  $cd \/sys\/class\/gpio \/gpio1_PH20\n  $echo out > direction    \/\/set PH20 as output\n  $echo 1 > value          \/\/set PH20 as high ,grenn LED is light\n  $echo 0 > value          \/\/set PH20 as low,turn off the LED<\/pre>\n<\/div>\n<h3 id=\"hdmi\">HDMI<\/h3>\n<div>\n\nIt would be best way connect the HDMI cable before power on the cubieboard,becuse some cable maybe appear the promble of sequence in time.\nIf your have not full screen display, you can try the following commands\n<pre>$fbset -left 10<\/pre>\n1.If you are using lubuntu, try the following commands\n<pre>$wget http:\/\/dl.cubieboard.org\/software\/tools\/armhf\/cb-display-tool\n$chmod 777 cb-display-tool\n$cb-display-tool -o 8 -m 11  \/\/switch to VGA type\n$cb-display-tool -o 4 -m 4  \/\/switch to HDMI type<\/pre>\nIf you switch to other resolution, you need to restart your X after the modification\n\n2.The default display configuration in script.bin of uboot partition of official desktop-firmware as :\n<pre>;disp init configuration\n;\n;disp_mode            (0:screen0<screen0,fb0> 1:screen1<screen1,fb0> 2:two_diff_screen_diff_contents<screen0,screen1,fb0,fb1>\n;                      3:two_same_screen_diff_contets<screen0,screen1,fb0> 4:two_diff_screen_same_contents<screen0,screen1,fb0>)\n;screenx_output_type  (0:none; 1:lcd; 2:tv; 3:hdmi; 4:vga)\n;screenx_output_mode  (used for tv\/hdmi output, 0:480i 1:576i 2:480p 3:576p 4:720p50 5:720p60 6:1080i50 7:1080i60 8:1080p24 9:1080p50 10:1080p60 11:pal 14:ntsc)\n;screenx_output_mode  (used for vga output, 0:1680*1050 1:1440*900 2:1360*768 3:1280*1024 4:1024*768 5:800*600 6:640*480 10:1920*1080 11:1280*720)\n;fbx format           (4:RGB655 5:RGB565 6:RGB556 7:ARGB1555 8:RGBA5551 9:RGB888 10:ARGB8888 12:ARGB4444)\n;fbx pixel sequence   (0:ARGB 1:BGRA 2:ABGR 3:RGBA) --- 0 for linux, 2 for android\n;lcd0_bright          (lcd0 init bright,the range:[0,256],default:197\n;lcd1_bright          (lcd1 init bright,the range:[0,256],default:197\n\n[disp_init]\ndisp_init_enable = 1\ndisp_mode = 0\nscreen0_output_type = 3\nscreen0_output_mode = 4\nscreen1_output_type = 0\nscreen1_output_mode = 4\nfb0_width = 1024\nfb0_height = 768\nfb0_framebuffer_num = 2\nfb0_format = 10\nfb0_pixel_sequence = 0\nfb0_scaler_mode_enable = 0\nfb1_width = 1024\nfb1_height = 768\nfb1_framebuffer_num = 2\nfb1_format = 10\nfb1_pixel_sequence = 0\nfb1_scaler_mode_enable = 0<\/pre>\nModify the parameter according to the using HDMI displayer . You can get more information about display from\u00a0<a title=\"http:\/\/linux-sunxi.org\/Display\" href=\"http:\/\/linux-sunxi.org\/Display\" target=\"_blank\" rel=\"nofollow noopener\">Display<\/a>\u00a0and modify script.bin from\u00a0<a title=\"http:\/\/docs.cubieboard.org\/tutorials\/common\/edit_the_system_configuration\" href=\"http:\/\/docs.cubieboard.org\/tutorials\/common\/edit_the_system_configuration\" target=\"_blank\" rel=\"nofollow noopener\">edit_the_system_configuration<\/a>\n\n<\/div>\n<h3 id=\"vga\">VGA<\/h3>\n<div>\n\nRefer to HDMI section.\n\n<\/div>\n<h3 id=\"usb_host\">USB Host<\/h3>\n<div>\n\nThe quickly way to test the interface of USB is plug the U disk . The system will identify the U disk .Use\u00a0<code>fdisk -l<\/code>\u00a0can see its information which meaning the interface of USB is working.\n\n<\/div>\n<h3 id=\"ir\">IR<\/h3>\n<div>\n\nIR had beed add into the kernel .If not, use command to load the moudle:\n<pre>  $insmnod \/lib\/modules\/3.4.X\/kernel\/drivers\/input\/keyboard\/sun4i-ir.ko<\/pre>\n<pre>  $sudo cat \/dev\/input\/event0 | hexdump<\/pre>\nPress the key of IR remote control,the terminal will print the message as:\n<pre>0000000 8415 525f 50cf 0003 0001 0094 0001 0000\n0000010 8415 525f 50db 0003 0000 0000 0000 0000\n0000020 8415 525f 22f7 0007 0001 0094 0000 0000\n0000030 8415 525f 22ff 0007 0000 0000 0000 0000<\/pre>\nThe digital &#8216;0094&#8217; is keycode of the remote control .\n\n<\/div>\n<h3 id=\"headphone_jack\">Headphone Jack<\/h3>\n<div>\n\nThere are two audio devices HDMI and headphone in the cubieboard.\n<pre>  $sudo  alsamixer<\/pre>\nThere are two audio devices named sunxi-sndhdmi and sunxi-CODEC in the system. The sound output is send out from HDMI by default . You can adjust volume and other configuration ,use Ctrl + z to save it.\n<a title=\"tutorials:alsamixer.png\" href=\"http:\/\/docs.cubieboard.org\/_detail\/tutorials\/alsamixer.png?id=tutorials%3Acommon%3Abegining_on_lubuntu\" target=\"_blank\" rel=\"noopener\"><img decoding=\"async\" title=\"alsamixer GUI\" src=\"http:\/\/nick.txtcc.com\/wp-content\/uploads\/remote_image\/2014\/05\/102057wS2.jpg\" alt=\"alsamixer GUI\"><\/a>\n\nTo set sound care being sunxi-CODEC modify\u00a0<code>\/etc\/asound.conf<\/code>\u00a0to turn on the headphone.\n<pre>  pcm.!default {\n    type hw\n    card 0    \/\/If you want to set HDMI as output ,turn 0 to 1.\n    device 0\n  }\n  ctl.!default {\n    type hw\n    card 0   \/\/If you want to set HDMI as output ,turn 0 to 1.\n  }<\/pre>\nIf Plug in the headphone and type:\n<pre>  $speaker-test -twav -c2<\/pre>\nThe sound &#8220;sound left\uff0csound right\uff0csound left&#8221; will output from headphone.\n\nLet cubieboard speak by package named espeak :\n<pre>  $sudo apt-get install espeak\n  $espeak \"hello\"\u3000\u3000          \/\/say: hello\n  $espeak \"hello_cubieboar\"\u3000\u3000\/\/say: hello cubieboard<\/pre>\n<\/div>\n<h3 id=\"camera\">Camera<\/h3>\n<div>\n\nMost of the camera driver has integrated in the kernel\uff0cso it is available insert usb-camera into the cubieboard.\n<pre>$sudo apt-get install luvcview\n$luvcview -s 1080x720 (can modify the resolution)<\/pre>\n<\/div>\n<\/div>","protected":false},"excerpt":{"rendered":"<p>\u7cfb\u7edf\u4e0b\u8f7d\u5730\u5740:\u00a0<a href=\"http:\/\/dl.cubieboard.org\/software\/a20-cubietruck\/lubuntu\/\">http:\/\/dl.cubieboard.org\/software\/a20-cubietruck\/lubuntu\/<\/a> \u5176\u5b83\u4e0b\u8f7d\u5730\u5740:\u00a0<a href=\"http:\/\/cubieboard.org\/down&#46;&#46;&#038;#46\">http:\/\/cubieboard.org\/down&#46;&#46;&#038;#46<\/a>;<\/p>","protected":false},"author":1,"featured_media":1194,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[4,39],"tags":[375,376],"class_list":["post-1172","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-linux","category-scm","tag-cubietruck","tag-lubuntu"],"_links":{"self":[{"href":"http:\/\/nick.txtcc.com\/index.php\/wp-json\/wp\/v2\/posts\/1172","targetHints":{"allow":["GET"]}}],"collection":[{"href":"http:\/\/nick.txtcc.com\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/nick.txtcc.com\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/nick.txtcc.com\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/nick.txtcc.com\/index.php\/wp-json\/wp\/v2\/comments?post=1172"}],"version-history":[{"count":10,"href":"http:\/\/nick.txtcc.com\/index.php\/wp-json\/wp\/v2\/posts\/1172\/revisions"}],"predecessor-version":[{"id":2211,"href":"http:\/\/nick.txtcc.com\/index.php\/wp-json\/wp\/v2\/posts\/1172\/revisions\/2211"}],"wp:featuredmedia":[{"embeddable":true,"href":"http:\/\/nick.txtcc.com\/index.php\/wp-json\/wp\/v2\/media\/1194"}],"wp:attachment":[{"href":"http:\/\/nick.txtcc.com\/index.php\/wp-json\/wp\/v2\/media?parent=1172"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/nick.txtcc.com\/index.php\/wp-json\/wp\/v2\/categories?post=1172"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/nick.txtcc.com\/index.php\/wp-json\/wp\/v2\/tags?post=1172"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}