合肥哪家做网站好,wordpress标签球形,wordpress 主题 minty,小程序开发平台哪家服务好1、写在前面
前面用的一直是Ubuntu系统#xff0c;但是遇到一个奇葩的问题#xff1a;
北通手柄在终端可以正常使用#xff0c;接收到数据
但在python程序中使用pygame库初始化时总是报错#xff1a;Invalid device number#xff0c;检测不到手柄
经过n次重装系统但是遇到一个奇葩的问题
北通手柄在终端可以正常使用接收到数据
但在python程序中使用pygame库初始化时总是报错Invalid device number检测不到手柄
经过n次重装系统发现是修改系统关于串口的配置增加了下面的两行导致的报错
enable_uart1
deoverlaydisable-bt
重装过的系统每次只要在配置中加了上面的内容配置串口python程序就检测不到手柄了但终端能正常检测手柄
然而我身边同用树莓派的朋友也对串口做了同样的配置却能在python程序中正常用手柄但他们都是raspbian系统
由于找不到别的解决办法就考虑装一个raspbian系统
2、装系统记录
raspberry pi imager软件 3、旋转屏幕
装完系统后SD卡插到树莓派4B上初次进入系统完成那些用户、时区等的设置就正常进入桌面了我接的是一个竖屏HDMI所以需要旋转屏幕
网上大部分方法是修改配置文件
在config.txt文件中添加内容display_rotate3
我试了失败了。
解决办法 4、打开SSH远程
树莓派端打开ssh windows端
使用putty 使用mobaxterm 5、给树莓派安装vscode
用的mobaxterm远程的 6、使用vscode远程 点击连接就可以了如果连不上检查
1报错里面如果提到了known_hosts去config的同一目录下把known_hosts删除这是因为我重装系统用户变了但是ip没变就出问题了
2如果报错里面提到了bad owner or permission on xxxxxxxx参考这个VSCode远程连接服务器报错Could not establish connection to “xxxxxx”【已解决】_could not establish connection to 172.28.197.114-CSDN博客
7、多版本python解释器安装使用
如果是raspbian系统执行下面
已解决RNING: pip is configured with locations that require TLS/SSL, however the ssl module in Python_凝思系统出现pip is configured with locatio-CSDN博客 一次执行
sudo apt-get update
sudo apt-get upgrade
sudo apt-get install build-essential libsqlite3-dev sqlite3 bzip2 libbz2-dev
wget https://www.python.org/ftp/python/3.8.19/Python-3.8.19.tgz #下载到当前目录,自行修改
tar zxvf Python-3.8.19.tgz
cd Python-3.8.19
sudo ./configure
sudo make
sudo make install按照上述过程完了后pip报错如下
WARNING: pip is configured with locations that require TLS/SSL, however the ssl module in Python is not available. 找到了上文链接博主的文章
重新按照下面的步骤安装了一遍
sudo apt-get install openssl libssl-devwget https://www.python.org/ftp/python/3.x.x/Python-3.x.x.tar.xz #下载所需版本
tar -xf Python-3.x.x.tar.xz #解压
cd Python-3.x.x #进入目录
sudo ./configure --with-ssl # 配置编译环境确保包含 SSL 支持
sudo make # 构建和安装
sudo make install # 构建和安装
在第一次安装完后pip报错WARNING: pip is configured with locations that require TLS/SSL, however the ssl module in Python is not available.
还参考这个链接解决pip is configured with locations that require TLS/SSL-CSDN博客进行了下面的修改pip配置的操作
mkdir -p ~/.pip #自动创建在根目录不是当前目录
sudo nano ~/.pip/pip.conf
然后输入内容
[global]
index-url http://mirrors.aliyun.com/pypi/simple/[install]
trusted-host mirrors.aliyun.com
这样操作完这个问题并没有解决但按照7最开始的那个链接重新装python38解决后发现pip的配置文件起作用了变成阿里云的源了
如果是ubuntu系统执行下面
sudo add-apt-repository ppa:deadsnakes/ppa
sudo apt-get update
sudo apt-get install python3.8
python3.8 --version
sudo apt install python3.8-venv 8、can通讯
硬件微雪电子RS485 CAN HAT
sudo nano /boot/firmware/config.txt
增加如下内容
dtparamspion
dtoverlaymcp2515-can0,oscillator12000000,interrupt25,spimaxfrequency2000000
重启查看是否成功加载can
ifconfig -a 9、串口通讯更改串口映射
sudo nano /boot/firmware/config.txt
enable_uart1
dtoverlaypi3-miniuart-bt