1. 程式人生 > >項目開發環境搭建

項目開發環境搭建

download 默認 ams file https ava roo wlan android

raspbian pi文檔 https://www.raspberrypi.org/documentation/configuration/raspi-config.mdhttps://www.raspberrypi.org/documentation/linux/software/apt.md1. install go env on aliyun centos server參考https://golang.org/dl/https://golang.org/doc/install/source#environment
cd /home/wget https://storage.googleapis.com/golang/go1.8.3.linux-amd64.tar.gztar zxvf go1.8.3.linux-amd64.tar.gz
vim /etc/profileexport GOROOT=/home/goexport GOPATH=/home/goproexport PATH=$PATH:/$GOROOT/bin:/$GOPATH/bin
source /etc/profile

1.1 install go subversion on raspbian
/home/pi/go
vim /etc/profileexport GOROOT=/home/pi/goexport GOPATH=/home/pi/goproexport PATH=$PATH:/$GOROOT/bin:/$GOPATH/bin
source /etc/profile
sudo apt-get install subversion


2. 下載樹莓派系統
http://www.raspberrypi.org/downloads
2017-04-10-raspbian-jessie-lite.zip解壓得到 2017-04-10-raspbian-jessie-lite.img
SDFormatter.exe 軟件格式化 SD 卡。
Win32DiskImager.exe 燒寫系統 2017-04-10-raspbian-jessie-lite.img
燒寫完成後,需要在SDcard根目錄下 創建ssh目錄 否則無法啟動ssh服務,無法通過ssh登錄設備
插上SD卡 插上網線 上電即可
3.Fing Android IP軟件查看局域網內IP 然後通過SSH協議登錄192.168.0.107樹莓派 raspbian 系統 pi 用戶密碼默認為 raspberry ;root 權限密碼為 raspberry
passwd 修改用戶名和密碼 loraserver
參考:http://shaocheng.li/post/blog/2017-05-09#toc_64.配置語言 時區在 I1 Change Locale 中設置本地語言,取消 en_GB.UTF-8 UTF-8 ,選中 en_US.UTF-8 UTF-8 。在 I2 Change Timezone 中設置時區為 Asia 下的 Shanghai 。在 I3 Change Keyboard Layout 設置鍵盤布局,依次選擇 Generic 104-key PC > Other > English (US) > English (US) > The default for the keyboard layout > No compose key 。在 I4 Change Wi-fi Country 中設置CN China完成配置後,選擇 Finish ,根據提示重啟系統,如果沒有提示,可以執行 sudo reboot 重啟系統。
5.Install vim/rzsz[email protected]
/* */:~ $ sudo apt-get update[email protected]:~ $ sudo apt-get remove vim-common[email protected]:~ $ sudo apt-get install vim
cat /proc/versionLinux version 4.4.50-v7+ ([email protected]) (gcc version 4.9.3 (crosstool-NG crosstool-ng-1.22.0-88-g8460611) ) #970 SMP Mon Feb 20 19:18:29 GMT 2017
lsb_release -aNo LSB modules are available.Distributor ID: RaspbianDescription: Raspbian GNU/Linux 8.0 (jessie)Release: 8.0Codename: jessie
6.配置wifi
請參考:https://i.cmgine.net/archives/11053.htmlsudo vim /etc/network/interfaces修改iface wlan0 inet manual 為 iface wlan0 inet dhcp
sudo vim /etc/wpa_supplicant/wpa_supplicant.conf修改# 最常用的配置。WPA-PSK 加密方式。添加下面的行(原來的行務必不要刪除),該方式支持多個wifi
network={ssid="michaelapp"psk="11111111"priority=4}
network={ssid="2404"psk="googlepyy"priority=4}
sudo ifup wlan0 即可
7. install rzszsudo apt-get install lrzsz
8. update and upgradesudo apt-get updatesudo apt-get upgrade
9.溫度傳感器配置dtoverlay=w1-gpio,gpiopin=4
可參考文獻:File: w1-gpio-overlay.dtbInfo: Configures the w1-gpio Onewire interface module.Use this overlay if you *don‘t* need a pin to drive an external pullup.Load: dtoverlay=w1-gpio,<param>=<val>Params: gpiopin GPIO pin for I/O (default "4")
pullup Non-zero, "on", or "y" to enable the parasiticpower (2-wire, power-on-data) feature

File: w1-gpio-pullup-overlay.dtbInfo: Configures the w1-gpio Onewire interface module.Use this overlay if you *do* need a pin to drive an external pullup.Load: dtoverlay=w1-gpio-pullup,<param>=<val>,...Params: gpiopin GPIO pin for I/O (default "4")
pullup Non-zero, "on", or "y" to enable the parasiticpower (2-wire, power-on-data) feature
extpullup GPIO pin for external pullup (default "5")

項目開發環境搭建