查看串口:
pi@raspberrypi:~ $ python -m serial.tools.list_ports
提升权限:
sudo -s
获取文件权限:
chmod +x xxx
安装vim
sudo apt-get install vim
.net core运行
dotnet xxx.dll
查看设备:
ls /dev/tty*
无法接收串口数据
https://blog.csdn.net/zgrjkflmkyc/article/details/85068418
装系统工具
https://shumeipai.nxez.com/2013/08/31/usb-image-tool.html
开启ssh
sudo raspi-config -->Interfacing Options -->选择SSH
树莓派串口console
sudo nano /boot/cmdline.txt
console=serial0,115200 console=tty1 root=PARTUUID=ea7d04d6-02 rootfstype=ext4 elevator=deadline fsck.repair=yes rootwait quiet splash plymouth.ignore-serial-consoles
下载Teamviewer
wget http://download.teamviewer.com/download/linux/version_11x/teamviewer-host_armhf.deb
sudo dpkg -i teamviewer-host_armhf.deb
sudo apt-get -f install
--------------安装.net core 运行库 3.1.2----------------------------------
wget https://download.visualstudio.microsoft.com/download/pr/30ed47bb-c25b-431c-9cfd-7b942b07314f/5c92af345a5475ca58b6878dd974e1dc/dotnet-runtime-3.1.2-linux-arm.tar.gz
mkdir -p $HOME/dotnet && tar zxf dotnet-runtime-3.1.2-linux-arm.tar.gz -C $HOME/dotnet
sudo nano .profile
将下列语句拷贝到.profile文件中
export DOTNET_ROOT=$HOME/dotnet
export PATH=$PATH:$HOME/dotnet
打包成一个文件后
chmod 777 ./FX.Run
./FX.Run
chmod 777 /home/pi/test6/FX.Run
/home/pi/test6/FX.Run
或者直接
sudo ./IHR.Hardware
.net core编译时设置不自动生成“netcoreapp3.0”目录
<PropertyGroup>
<AppendTargetFrameworkToOutputPath>false</AppendTargetFrameworkToOutputPath>
<AppendRuntimeIdentifierToOutputPath>false</AppendRuntimeIdentifierToOutputPath>
</PropertyGroup>
--------------------------------------------------------------------------
----------------------linux 任务控制--------------------------------------
允许command后台运行
nohup command &
将后台进程切换成前端进程
fg %jobsID
将前端进程切换成后台进程并暂停
ctrl+z
启动一个后台暂停的进程
bg %jobsID
---------------------------关于守护进程-----------------------------------
https://blog.csdn.net/diaohui9485/article/details/102151948
//安装supervisor
sudo apt-get install supervisor
//创建项目启动配置文件
sudo nano /etc/supervisor/conf.d/FX.Run.dll.conf
//编写文件内容
[program:FX.Run]
command=/home/pi/dotnet/dotnet FX.Run.dll -ip any
directory=/home/pi/test6
environment=ASPNETCORE__ENVIRONMENT=Production
user=pi
stopsignal=INT
autostart=true
autorestart=true
startsecs=1
stderr_logfile=/var/log/FX.Run.err.log
stdout_logfile=/var/log/FX.Run.out.log
//修改supervisord.conf文件打开网页管理
sudo nano /etc/supervisor/supervisord.conf
[inet_http_server]
port=:9003
//启动程序
sudo supervisorctl shutdown && sudo supervisord -c /etc/supervisor/supervisord.conf
//或者
sudo service supervisor stop
sudo service supervisor start
------------------------------------------------------------------------------------