跳到主要內容

Intel® Joule™ 550x 安裝ubuntu

前言

Intel 已經沒有維護了才拿出來玩...
物盡其用就把它當作小PC使用吧!

BIOS

joule-firmware-2017-06-02-1H3-public

[註]:千萬不要用最新的版本1J2,我當初刷下去後開機會卡在BIOS無法使用

OS

內存:
eMMC 8GB
內建Yocto作業系統
不建議刷掉此作業系統,
作業系統已經設好serial consle,
可以只接serial line直接連進機器
[註]:shutdown -r 0 //Yocto重開機指令


SDCard:
安裝ubuntu-18.04.3-server

安裝過程:
CPU是x86架構沒什麼困難
只要想辦法把OS塞進SDCard插進板子就沒問題了

我下載ubuntu-18.04.3-live-server-amd64.iso
直接使用PC將ubuntu安裝至SDCard
安裝完成順便安裝套件wireless-tools、wpa_supplicant、firmware-iwlwifi
機器插入SDCard,接上HDMI、鍵盤開機

為了方便使用serial line直接Debug,
設定serial consle,Grub及Ubuntu的sericl consle參照下方設定

設定完成後開機過程包含BIOS都可以透過serial去做操作
[註]:baud rate 115200



Serial Consle

GRUB

https://c4691294.coding.me/Linux/Ubuntu-18-04配置serial-console/
我這邊找到serial port是掛在ttyS6
使用dmesg | grep tty
Yocto跟Ubuntu比對查找
/etc/default/grub
mowei@mowei:/etc/default$ vim grub
# If you change this file, run 'update-grub' afterwards to update
# /boot/grub/grub.cfg.
# For full documentation of the options in this file, see:
#   info -f grub -n 'Simple configuration'

GRUB_DEFAULT=0
#GRUB_TIMEOUT_STYLE=hidden
GRUB_TIMEOUT=5
GRUB_DISTRIBUTOR=`lsb_release -i -s 2> /dev/null || echo Debian`
#GRUB_CMDLINE_LINUX_DEFAULT="quiet splash"
GRUB_CMDLINE_LINUX_DEFAULT=""
GRUB_CMDLINE_LINUX="console=tty1 console=ttyS6,115200n8"

# Uncomment to enable BadRAM filtering, modify to suit your needs
# This works with Linux (no patch required) and with any kernel that obtains
# the memory map information from GRUB (GNU Mach, kernel of FreeBSD ...)
#GRUB_BADRAM="0x01234567,0xfefefefe,0x89abcdef,0xefefefef"

# Uncomment to disable graphical terminal (grub-pc only)
#GRUB_TERMINAL=console
GRUB_TERMINAL=serial
GRUB_SERIAL_COMMAND="serial --speed=115200 --unit=0 --word=8 --parity=no --stop=1"

# The resolution used on graphical terminal
# note that you can use only modes which your graphic card supports via VBE
# you can see them in real GRUB with the command `vbeinfo'
#GRUB_GFXMODE=640x480

# Uncomment if you don't want GRUB to pass "root=UUID=xxx" parameter to Linux
#GRUB_DISABLE_LINUX_UUID=true

# Uncomment to disable generation of recovery mode menu entries
#GRUB_DISABLE_RECOVERY="true"

# Uncomment to get a beep at grub start
#GRUB_INIT_TUNE="480 440 1"


sudo update-grub




\boot\grub\grub.cfg
#
# DO NOT EDIT THIS FILE
#
# It is automatically generated by grub-mkconfig using templates
# from /etc/grub.d and settings from /etc/default/grub
#

### BEGIN /etc/grub.d/00_header ###
if [ -s $prefix/grubenv ]; then
  set have_grubenv=true
  load_env
fi
if [ "${next_entry}" ] ; then
   set default="${next_entry}"
   set next_entry=
   save_env next_entry
   set boot_once=true
else
   set default="0"
fi

if [ x"${feature_menuentry_id}" = xy ]; then
  menuentry_id_option="--id"
else
  menuentry_id_option=""
fi

export menuentry_id_option

if [ "${prev_saved_entry}" ]; then
  set saved_entry="${prev_saved_entry}"
  save_env saved_entry
  set prev_saved_entry=
  save_env prev_saved_entry
  set boot_once=true
fi

function savedefault {
  if [ -z "${boot_once}" ]; then
    saved_entry="${chosen}"
    save_env saved_entry
  fi
}
function load_video {
  if [ x$feature_all_video_module = xy ]; then
    insmod all_video
  else
    insmod efi_gop
    insmod efi_uga
    insmod ieee1275_fb
    insmod vbe
    insmod vga
    insmod video_bochs
    insmod video_cirrus
  fi
}

if [ x$feature_default_font_path = xy ] ; then
   font=unicode
else
insmod part_msdos
insmod ext2
set root='hd3,msdos5'
if [ x$feature_platform_search_hint = xy ]; then
  search --no-floppy --fs-uuid --set=root --hint-bios=hd3,msdos5 --hint-efi=hd3,msdos5 --hint-baremetal=ahci3,msdos5  2efeb6e4-c104-4fcb-a3f1-1b3c74a8867b
else
  search --no-floppy --fs-uuid --set=root 2efeb6e4-c104-4fcb-a3f1-1b3c74a8867b
fi
    font="/usr/share/grub/unicode.pf2"
fi

if loadfont $font ; then
  set gfxmode=auto
  load_video
  insmod gfxterm
  set locale_dir=$prefix/locale
  set lang=en_US
  insmod gettext
fi
terminal_output gfxterm
if [ "${recordfail}" = 1 ] ; then
  set timeout=30
else
  if [ x$feature_timeout_style = xy ] ; then
    set timeout_style=menu
    set timeout=5
  # Fallback normal timeout code in case the timeout_style feature is
  # unavailable.
  else
    set timeout=5
  fi
fi
play 480 440 1
### END /etc/grub.d/00_header ###

### BEGIN /etc/grub.d/05_debian_theme ###
set menu_color_normal=cyan/blue
set menu_color_highlight=white/blue
### END /etc/grub.d/05_debian_theme ###

### BEGIN /etc/grub.d/10_linux ###
function gfxmode {
	set gfxpayload="${1}"
}
set linux_gfx_mode=
export linux_gfx_mode
menuentry 'Debian GNU/Linux' --class debian --class gnu-linux --class gnu --class os $menuentry_id_option 'gnulinux-simple-2efeb6e4-c104-4fcb-a3f1-1b3c74a8867b' {
	load_video
	insmod gzio
	if [ x$grub_platform = xxen ]; then insmod xzio; insmod lzopio; fi
	insmod part_msdos
	insmod ext2
	set root='hd3,msdos5'
	if [ x$feature_platform_search_hint = xy ]; then
	  search --no-floppy --fs-uuid --set=root --hint-bios=hd3,msdos5 --hint-efi=hd3,msdos5 --hint-baremetal=ahci3,msdos5  2efeb6e4-c104-4fcb-a3f1-1b3c74a8867b
	else
	  search --no-floppy --fs-uuid --set=root 2efeb6e4-c104-4fcb-a3f1-1b3c74a8867b
	fi
	echo	'Loading Linux 4.19.0-14-amd64 ...'
	linux	/boot/vmlinuz-4.19.0-14-amd64 root=UUID=2efeb6e4-c104-4fcb-a3f1-1b3c74a8867b ro  quiet
	echo	'Loading initial ramdisk ...'
	initrd	/boot/initrd.img-4.19.0-14-amd64
}
submenu 'Advanced options for Debian GNU/Linux' $menuentry_id_option 'gnulinux-advanced-2efeb6e4-c104-4fcb-a3f1-1b3c74a8867b' {
	menuentry 'Debian GNU/Linux, with Linux 4.19.0-14-amd64' --class debian --class gnu-linux --class gnu --class os $menuentry_id_option 'gnulinux-4.19.0-14-amd64-advanced-2efeb6e4-c104-4fcb-a3f1-1b3c74a8867b' {
		load_video
		insmod gzio
		if [ x$grub_platform = xxen ]; then insmod xzio; insmod lzopio; fi
		insmod part_msdos
		insmod ext2
		set root='hd3,msdos5'
		if [ x$feature_platform_search_hint = xy ]; then
		  search --no-floppy --fs-uuid --set=root --hint-bios=hd3,msdos5 --hint-efi=hd3,msdos5 --hint-baremetal=ahci3,msdos5  2efeb6e4-c104-4fcb-a3f1-1b3c74a8867b
		else
		  search --no-floppy --fs-uuid --set=root 2efeb6e4-c104-4fcb-a3f1-1b3c74a8867b
		fi
		echo	'Loading Linux 4.19.0-14-amd64 ...'
		linux	/boot/vmlinuz-4.19.0-14-amd64 root=UUID=2efeb6e4-c104-4fcb-a3f1-1b3c74a8867b ro  quiet
		echo	'Loading initial ramdisk ...'
		initrd	/boot/initrd.img-4.19.0-14-amd64
	}
	menuentry 'Debian GNU/Linux, with Linux 4.19.0-14-amd64 (recovery mode)' --class debian --class gnu-linux --class gnu --class os $menuentry_id_option 'gnulinux-4.19.0-14-amd64-recovery-2efeb6e4-c104-4fcb-a3f1-1b3c74a8867b' {
		load_video
		insmod gzio
		if [ x$grub_platform = xxen ]; then insmod xzio; insmod lzopio; fi
		insmod part_msdos
		insmod ext2
		set root='hd3,msdos5'
		if [ x$feature_platform_search_hint = xy ]; then
		  search --no-floppy --fs-uuid --set=root --hint-bios=hd3,msdos5 --hint-efi=hd3,msdos5 --hint-baremetal=ahci3,msdos5  2efeb6e4-c104-4fcb-a3f1-1b3c74a8867b
		else
		  search --no-floppy --fs-uuid --set=root 2efeb6e4-c104-4fcb-a3f1-1b3c74a8867b
		fi
		echo	'Loading Linux 4.19.0-14-amd64 ...'
		linux	/boot/vmlinuz-4.19.0-14-amd64 root=UUID=2efeb6e4-c104-4fcb-a3f1-1b3c74a8867b ro single 
		echo	'Loading initial ramdisk ...'
		initrd	/boot/initrd.img-4.19.0-14-amd64
	}
}

### END /etc/grub.d/10_linux ###

### BEGIN /etc/grub.d/20_linux_xen ###

### END /etc/grub.d/20_linux_xen ###

### BEGIN /etc/grub.d/30_os-prober ###
### END /etc/grub.d/30_os-prober ###

### BEGIN /etc/grub.d/30_uefi-firmware ###
menuentry 'System setup' $menuentry_id_option 'uefi-firmware' {
	fwsetup
}
### END /etc/grub.d/30_uefi-firmware ###

### BEGIN /etc/grub.d/40_custom ###
# This file provides an easy way to add custom menu entries.  Simply type the
# menu entries you want to add after this comment.  Be careful not to change
# the 'exec tail' line above.
### END /etc/grub.d/40_custom ###

### BEGIN /etc/grub.d/41_custom ###
if [ -f  ${config_directory}/custom.cfg ]; then
  source ${config_directory}/custom.cfg
elif [ -z "${config_directory}" -a -f  $prefix/custom.cfg ]; then
  source $prefix/custom.cfg;
fi
### END /etc/grub.d/41_custom ###

Systemd

下面似乎無效改用getty@.service


vim /etc/init.d/ttyS6.conf
# ttyS6 - getty
#
# This service maintains a getty on ttyS0 from the point the system is
# started until it is shut down again.

start on stopped rc RUNLEVEL=[2345]
stop on runlevel [!2345]

respawn
exec /sbin/getty -L 115200 ttyS6 vt100

getty@.service

sudo nano /lib/systemd/system/serial-getty@.service
First we need to edit the serial-getty service to set the correct bard rate.

# Edit this line
ExecStart=-/sbin/agetty --keep-baud 115200,38400,9600 %I $TERM

# To This
ExecStart=-/sbin/agetty 115200 %I $TERM
Set this to the bard rate that you wish to use. This should be the same at the computer is using at the other end.

systemctl daemon-reload

# For a USB serial adaptor
systemctl enable serial-getty@ttyUSB0.service

# For a built in serial port /dev/ttyS6
systemctl enable serial-getty@ttyS6.service

NetWork

抓取iwlwifi-8000C 至/lib/firmware
modprobe -r iwlwifi; modprobe iwlwifi
安裝wpa_supplicant
sudo ifconfig wlp1s0 up
sudo iwlist wlp1s0 scan
sudo wpa_passphrase EssidName Pass  | sudo cat >> /etc/wpa_supplicant/wpa_supplicant.conf
sudo wpa_supplicant -c /etc/wpa_supplicant/wpa_supplicant.conf  -i wls1p0
sudo dhclient wlp1s0
Network設定
# ifupdown has been replaced by netplan(5) on this system.  See
# /etc/netplan for current configuration.
# To re-enable ifupdown on this system, you can run:
#    sudo apt install ifupdown

allow-hotplug wlp1s0
    iface wlp1s0 inet dhcp
    wireless-essid EssidName
    wpa-conf /etc/wpa_supplicant/wpa_supplicant.conf
Bluetooth 設定
https://chenhh.gitbooks.io/ubuntu-linux/content/bluetooth.html

wget http://ftp.tw.debian.org/debian/pool/non-free/f/firmware-nonfree/firmware-iwlwifi_20190114-2_all.deb
dpkg -i firmware-iwlwifi_20190114-2_all.deb

sudo apt-get install bluez* bluetooth rfkill

hciconfig -a
sudo hciconfig info
sudo hciconfig hci0 up
sudo hcitool scan

留言

這個網誌中的熱門文章

小蟻智慧攝影機支援RTSP

來源: http://en.miui.com/thread-196713-1-1.html 小蟻智慧攝影機版本: 1.8.5.1l_201511061661(台灣版) 下載檔案 https://drive.google.com/file/d/0ByjBix7wpeJJY0ZWZXlvWl9Za1E/view?usp=sharing 把攝影機SD卡拿讀卡機讀取 把壓縮檔內的test資料夾放進SD根目錄 插回SD卡至攝影機 重開 攝影機會呈現橘燈並執行更新 等恢復至藍燈或是用app確認攝影機開啟 用VLC或相關程式讀取串流 Main stream:rtsp:// <CameraIP> :554/ch0_0.h264 Minor stream:rtsp:// <CameraIP> :554/ch0_1.h264 Audio stream:rtsp:// <CameraIP> :554/ch0_3.h264 Telnet與FTP開啟加上 # Telnet if [ ! -f "/etc/init.d/S88telnet" ]; then     echo "#!/bin/sh" > /etc/init.d/S88telnet     echo "telnetd &" >> /etc/init.d/S88telnet     chmod 755 /etc/init.d/S88telnet fi # FTP echo "#!/bin/sh" > /etc/init.d/S89ftp echo "tcpsvd -vE 0.0.0.0 21 ftpd -w / &" >> /etc/init.d/S89ftp chmod 755 /etc/init.d/S89ftp User:  root Password:  1234qwer 使用passwd改密碼 參考: http://en.miui.com/thread-224653-1-1.html

Arduino 滑鼠滾輪編碼器/旋轉編碼器

滑鼠拆下來的滾輪編碼器 時序為                      → CW A  -----------          -------------    HIGH                ----------                  LOW                      ← CCW B  --------          ----------------    HIGH             ----------                     LOW A B 1  1↓CW 1  0 0  0 0  1 1  1 1  0 0  0 0  1↑CCW 程式碼參考底下網址來源修改而來 #define ENCODER_A_PIN 2 #define ENCODER_B_PIN 3 unsigned long time = 0; long position = 0; long num = 0; void setup() { pinMode(ENCODER_A_PIN,INPUT); pinMode(ENCODER_B_PIN,INPUT); attachInterrupt(0, RotaryEncoder, LOW); Serial.begin(9600); time = millis(); } void loop() { while (num != position) { num = position; Serial.println(num); } } void RotaryEncoder(){ int temp =digitalRead(ENCODER_B_PIN); if ((millis() - time) > 3) { if ( temp == LOW) { position++; }else{ if ( temp == HIGH) position--; } } time = millis(); } 沒中斷版本 int trigger=0; void Rotar

Voip SPA3000/9000 設定

架設Voip 1.Analog Telephone Adaptor (ATA) 一個類比電話轉換到基於數位VoIP電話網路 An ATA contains the following components: FXS Ports – Used for interfacing with analog telephones. RJ45 Ports – Used for interfacing with the LAN/WAN FXO Ports – Used for interfacing with the PSTN 2.網絡電話交換機(IPPBX) 能通過IP網提供語音、視頻以及即時消息通信。這些通信不僅可以在企業內部網上進行,也可以通過Internet與外網甚至PSTN(Public Switched Telephone Network)電話間進行。 3.網路電話(IPPHONE) SPA921、支援SIP應用程式或電話 SPA3000設定 參照: 安德森技術備忘板 參照 OSSLab 的設定設完發現會PSTN接到來電時 等到 PSTN Answer Delay 秒數過後將會自動接起外線 仍然等待Voip分機接起話筒可能會造成撥打者不必要的電話費 可能原因是 Off Hook While Calling VoIP  被設為Yes SPA9000設定 Wan Setup Internet Connection Settings Connection Type: DHCP Static IP PPPOE PPPOE,DHCP DHCP,PPPOE SIP Hunt Groups: 設定群組獵線 群組號碼為500,分機100-102, 響鈴300秒 回到SPA3000 PSTN Line Dial Plan 2: 來電時將轉接至群組 發現的問題: 剛開機使用SPA3000 LINE1 撥打至PSTN Line 分機 在打外線會導致所有分機都將無法在外線 開完機後先用其他分機撥打測試後就可正常使用