现在我得到了我的Raspberry Pi.我是一位经验丰富的应用软件开发人员,但我以前从未做过硬件或低级编程.我想构建一个最小的Linux,包括我的Pi上所有硬件的驱动程序.出于学习目的,我不想在我的Pi上安装任何预先构建的Linux发行版.我应该从哪里开始?
如何配置我的Raspberry Pi 3(运行Raspbian)连接到隐藏网络?我知道它涉及编辑/ etc/network/interfaces文件和wpa_supplicant.conf文件.我已经遵循了一些其他指南,但是当我更改这些文件并重新启动时,我甚至无法检测到可见网络,因为它们从我的wifi菜单中消失了.我想我只是用不正确的配置编辑这些文件.
sudo apt install awscli安装当前版本 1.16.113-1
官方网站(https://docs.aws.amazon.com/cli/latest/userguide/install-cliv2-linux.html)支持aarch64但不支持 armhf。还有其他方法或我缺少的东西吗?v1 和 v2 之间的差异不是很大,但例如 v1 不支持--storage-class DEEP_ARCHIVE
amazon-s3 amazon-web-services raspberry-pi amazon-glacier aws-cli
我正在尝试在树莓派 4 中使用 flask_socketio、socketIO_client 和 SOCKET.IO 在 python 中运行客户端和服务器,但出现以下错误:
The client is using an unsupported version of the Socket.IO or Engine.IO protocols (further occurrences of this error will be logged with level INFO)
192.168.1.80 - - [05/Feb/2021 18:30:41] "GET /socket.io/?EIO=3&transport=polling&t=NTpTT-L HTTP/1.1" 400 219 0.000618
Run Code Online (Sandbox Code Playgroud)
这些是我当前的版本:
pi@raspberrypi:~/Desktop/EDAdataLogger $ npm list socket.io EDAdataLogger@ /home/pi/Desktop/EDAdataLogger ??? socket.io@3.1.1
pi@raspberrypi:~/Desktop/EDAdataLogger $ npm list socket.io-client EDAdataLogger@ /home/pi/Desktop/EDAdataLogger ??? socket.io-client@3.1.1
python-engineio==4.0.0
python-socketio==5.0.4
Flask==1.1.2
Flask-Session==0.3.2
Flask-SocketIO==5.0.1
Run Code Online (Sandbox Code Playgroud)
如何定义 JavaScript Socket.IO 版本和 Socket.IO 协议修订版,以便根据 ( https://pypi.org/project/python-socketio/ )匹配所有内容?
我怎样才能解决这个问题?谢谢
我正在尝试将运行 Raspberry Pi OS Lite 的 Raspberry Pi Zero W 连接到 Raspberry Pi NoIR 相机模块 V2。运行这些命令后:
sudo apt update
sudo apt upgrade
Run Code Online (Sandbox Code Playgroud)
并在菜单中启用相机raspi-config并根据 Raspberry Pi 文档重新启动,当我raspistill -v -o test.jpg根据 Raspbery {Pi 文档运行命令时,出现以下错误。
-bash: raspistill: command not found
Run Code Online (Sandbox Code Playgroud)
文档说:
这可能意味着您的更新/升级在某种程度上失败了。
我又试了一次。我多次运行更新、升级命令、重新启动并在 raspi-config 中启用相机,结果没有任何变化。
camera video-streaming raspberry-pi raspberry-pi-zero raspberry-pi-os
我有Raspberry Pi和Raspbian OS.安装VNC后,我试图启动服务器并返回:
~ $ vncserver :0
Warning: raspberrypi:0 is taken because of /tmp/.X0-lock
Remove this file if there is no X server raspberrypi:0
A VNC server is already running as :0
Run Code Online (Sandbox Code Playgroud)
如果我删除该临时文件,请返回:
~ $ vncserver :0
Warning: raspberrypi:0 is taken because of /tmp/.X11-unix/X0
Remove this file if there is no X server raspberrypi:0
A VNC server is already running as :0
Run Code Online (Sandbox Code Playgroud)
如果我再次删除,服务器启动,但通过VNC客户端显示一个普通的灰色屏幕.总之,之后:
~ $ sudo rm /tmp/.X11-unix/X0
~ $ sudo rm /tmp/.X0-lock
~ $ vncserver :0
New 'X' desktop …Run Code Online (Sandbox Code Playgroud) 我的覆盆子pi上有一个PHP网页,带有2个按钮(打开和关闭)按钮按钮重定向到On.php关闭按钮重定向到Off.php在"/ usr/lib/cgi-bin"我有一个python脚本我想执行(script.py)我可以通过键入从终端完美地执行它
cd /usr/lib/cgi-bin
sudo python script.py
Run Code Online (Sandbox Code Playgroud)
如果我从终端这样做,它的工作原理.
问题是我的"/ var/www"文件夹中的PHP文件(On.php).这就是我写的:
<?php
exec('cd /usr/lib/cgi-bin');
exec('sudo python script.py');
?>
Run Code Online (Sandbox Code Playgroud)
为什么脚本从终端执行,而不是从我的PHP执行?
我正在尝试连接到Raspberry Pi 2上的BLE设备(心率传感器,Polar H7).我使用的是上一版本的bluez(5.35):http://www.bluez.org/download/
但是,当我尝试连接使用时gatttool,我总是有"连接被拒绝"错误.
这是我做的:
pi@raspberrypi ~ $ sudo su
root@raspberrypi:/home/pi# hciconfig dev
hci0: Type: BR/EDR Bus: USB
BD Address: 5C:F3:70:69:54:3D ACL MTU: 1021:8 SCO MTU: 64:1
DOWN
RX bytes:616 acl:0 sco:0 events:34 errors:0
TX bytes:380 acl:0 sco:0 commands:34 errors:0
root@raspberrypi:/home/pi# hciconfig dev up
root@raspberrypi:/home/pi# hcitool lescan
LE Scan ...
00:22:D0:6D:E0:E6 (unknown)
00:22:D0:6D:E0:E6 Polar H7 6DE0E61C
^Croot@raspberrypi:/home/pi# hcitool lecc 00:22:D0:6D:E0:E6
Connection handle 64
root@raspberrypi:/home/pi# gatttool -b 00:22:D0:6D:E0:E6 -I
[00:22:D0:6D:E0:E6][LE]> connect
Attempting to connect to …Run Code Online (Sandbox Code Playgroud) 我目前有两个连接到我的Raspberry Pi的按钮(这些是带有环形LED的那些)并且我正在尝试执行此代码
#!/usr/bin/env python
import RPi.GPIO as GPIO
import time
GPIO.setmode(GPIO.BCM)
GPIO.setwarnings(False)
GPIO.setup(17, GPIO.OUT) #green LED
GPIO.setup(18, GPIO.OUT) #red LED
GPIO.setup(4, GPIO.IN, GPIO.PUD_UP) #green button
GPIO.setup(27, GPIO.IN, GPIO.PUD_UP) #red button
def remove_events():
GPIO.remove_event_detect(4)
GPIO.remove_event_detect(27)
def add_events():
GPIO.add_event_detect(4, GPIO.FALLING, callback=green, bouncetime=800)
GPIO.add_event_detect(27, GPIO.FALLING, callback=red, bouncetime=800)
def red(pin):
remove_events()
GPIO.output(17, GPIO.LOW)
print "red pushed"
time.sleep(2)
GPIO.output(17, GPIO.HIGH)
add_events()
def green(pin):
remove_events()
GPIO.output(18, GPIO.LOW)
print "green pushed"
time.sleep(2)
GPIO.output(18, GPIO.HIGH)
add_events()
def main():
while True:
print "waiting"
time.sleep(0.5)
GPIO.output(17, GPIO.HIGH)
GPIO.output(18, GPIO.HIGH)
GPIO.add_event_detect(4, …Run Code Online (Sandbox Code Playgroud) 我在raspberry-pi上安装了docker(通过ssh连接)安装成功。
但是运行docker run hello-world不会产生任何输出。
请注意,我第一次收到有关安装映像的其他消息
Unable to find image 'hello-world:latest' locally
latest: Pulling from library/hello-world
ad0f38092cf2: Pull complete
Digest: sha256:e366bc07db5e8a50dbabadd94c2a95d212bc103e3557e47df8a2eebd8bb46309
Status: Downloaded newer image for hello-world:latest
但是hello world脚本没有实际输出
注意我使用命令安装了docker curl -sSL https://get.docker.com | sh
我也尝试了以下命令
sudo usermod -aG docker pi
sudo systemctl start docker
sudo docker run hello-world
Run Code Online (Sandbox Code Playgroud)
尝试了以下命令docker ps -a
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
734dd8f733d7 hello-world "/hello" About a minute ago Exited (139) 59 seconds ago thirsty_bhaskara
Run Code Online (Sandbox Code Playgroud)