ubuntu@arm:~$ sudo connmanctl
[sudo] password for ubuntu:
Error getting VPN connections: The name net.connman.vpn was not provided by any
connmanctl> enable wifi
Error wifi: Already enabled
connmanctl> scan wifi
Scan completed for wifi
connmanctl> services
WIFIEB6EC7 wifi_38d269d11b40_57494649454236454337_managed_psk
Divya 213 2.4G wifi_38d269d11b40_44697679612032313320322e3447_managed_psk
Beatles wifi_38d269d11b40_426561746c6573_managed_psk
DIRECT-cR[TV]Time killer wifi_38d269d11b40_4449524543542d63525b54565d54696d65206b696c6c6572_managed_psk
MySpectrumWiFi30-2G wifi_38d269d11b40_4d79537065637472756d5769466933302d3247_managed_psk
ATTipFFrCI wifi_38d269d11b40_41545469704646724349_managed_psk
connmanctl> agent on
Agent registered
// Connect to your Wi-Fi hotspot
connmanctl> connect wifi_38d269d11b40_44697679612032313320322e3447_managed_psk
Passphrase? xxxxxxxx
connected wifi_38d269d11b40_44697679612032313320322e3447_managed_psk
connmanctl> quit
// Find out IP address of BeagleBone Black Wireless
ubuntu@arm:~$ ifconfig
wlan0: flags=-28605<UP,BROADCAST,RUNNING,MULTICAST,DYNAMIC> mtu 1500
inet *192.168.1.16* netmask 255.255.255.0 broadcast 192.168.1.255
inet6 fe80::3ad2:69ff:fed1:1b40 prefixlen 64 scopeid 0x20<link>
ether 38:d2:69:d1:1b:40 txqueuelen 1000 (Ethernet)
RX packets 38 bytes 4684 (4.6 KB)
RX errors 0 dropped 6 overruns 0 frame 0
TX packets 56 bytes 8886 (8.8 KB)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
// Ping Google to confirm connection
ubuntu@arm:~$ ping www.google.com
PING www.google.com (216.58.219.4) 56(84) bytes of data.
64 bytes from lax17s03-in-f4.1e100.net (216.58.219.4): icmp_seq=1 ttl=53 time=26.5 ms
64 bytes from lax17s03-in-f4.1e100.net (216.58.219.4): icmp_seq=2 ttl=53 time=37.2 ms
64 bytes from lax17s03-in-f4.1e100.net (216.58.219.4): icmp_seq=3 ttl=53 time=25.2 ms
--- www.google.com ping statistics ---
3 packets transmitted, 3 received, 0% packet loss, time 2002ms
rtt min/avg/max/mdev = 25.218/29.658/37.205/5.365 ms
重新開機會自動連接到wifi
為了方便beaglebone開發板調試,採用NAT的網路設定,將window電腦作為VMware與beagelbone網路收發的中間者,再透過NFS掛載,beaglebone開發版可以直接與VMware裡的資料夾同步
但這個前提是windows電腦需與beaglebone開發板在同一網域下
請參考 https://home.gamer.com.tw/creationDetail.php?sn=3249988
開發板上輸入以下指令
sudo apt-get update
sudo apt-get install nfs-kernel-server nfs-common
開發板連上wifi與外往互通(ping www.google.com 成功)
sudo mount -t nfs -o nolock,vers=3,port=2049,mountport=9999 192.168.0.118:/home/book/nfs_rootfs /mnt
上面設定的IP為windows IP
或是接上USB線與電腦透過usb互通(只要開發板與windows互相pin成功即代表互通)
sudo mount -t nfs -o nolock,vers=3,port=2049,mountport=9999 192.168.7.1:/home/book/nfs_rootfs /mnt
export ARCH=arm
export CROSS_COMPILE=arm-linux-gnueabihf-
export PATH=$PATH:/home/book/gcc-linaro-6.5.0-2018.12-x86_64_arm-linux-gnueabihf/bin/arm-linux-gnueabihf-
在研究linux過程中,會常常看到變數或函式前會加上static進行修飾,然而什麼時候應該要用到static? 若想要變數或函式只能在一個.c檔內部使用,就可以在變數或函式前加上static,以防止外部程式碼修改之。 例: test.c static int i = 0; static void function(int parameter){….}
Feb 17, 2021本文以Beaglebone版子為例,linux 4.19.142 系統移植請參閱 beaglebone black wireless開發板系統移植 spidev驅動、spidev_test測試,則可參閱如何使用linux內核提供SPI設備驅動Spidev 確定驅動檔案 為了找到內核與SPI相關的程式碼,利用以下步驟 1. 進入kernal資料夾,使用make menuconfig 選擇Device Drivers
Feb 9, 2021在單晶片中常常需要操作硬體寄存器,也就是對寄存器的地址進行讀取或寫入等操作,因此要如何定義已知寄存器的位址以方便程序員操作呢? 一般變數宣告 int a = 5; // 變數a會由編譯器自行產生地址,其內容為5 int *b; 若要指定指標的位置,則int *b = 0x20000000; 但此時編譯器會編譯錯誤,錯誤類型為型態錯誤。 因此需將整數強制轉成指標 int *b = (int *)0x20000000;
Feb 8, 2021Linux系統中有許多輸入設備:鍵盤、滑鼠、觸摸屏幕…等,而若是針對每一個輸入設備撰寫相對應的驅動程序,則應用層就必須知道每個設備節點的名稱,根據不同的設備開啟不同的設備節點,只要其中一個設備修改,就必須修改應用層,對整個系統產生不小的影響。 因此Linux系統發展出一套能夠兼容所有輸入設備的系統:輸入子系統(Input subsystem),將所有輸入設備進行統一管理,抽象出三部分:軟件處理、硬件處理、連接軟件與硬件處理。由此框架得知,若新增一輸入設備,程序員只需要根據輸入子系統的框架撰寫硬件處理驅動即可,應用程序仍可以依照輸入子系統定義的API去操作硬件。 Linux 4.19.x 內核解析 drivers/input/input.c: 1. 入口函數:input_init 2. 註冊 加載evdev.c時入口函數會註冊handler,加載gpio_keys.c入口函數會註冊device
Feb 7, 2021or
By clicking below, you agree to our terms of service.
New to HackMD? Sign up