$ lsusb
Bus 007 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 011 Device 004: ID 046d:c21d Logitech, Inc. F310 Gamepad
Bus 005 Device 005: ID 0951:1666 Kingston Technology DataTraveler G4
Bus 005 Device 004: ID 05e3:0608 Genesys Logic, Inc. Hub
Bus 004 Device 001: ID 18d1:4ee6 Google Inc. Nexus/Pixel Device (PTP + debug)
Bus 003 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 002 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
$ adb shell ip route | awk '{print $9}'
To connect to your device over WiFi, you must enable TCP/IP connections. This, you must do through the adb command:
$ adb tcpip 5555
Now you can disconnect your mobile from USB.
Whenever you want to connect over WiFi, first connect to the mobile with the command adb connect. For instance, assuming my mobile's IP address is 10.1.1.22, the command is:
$ adb connect 10.1.1.22:5555
去年,我写了关于使用 Cockpit 管理我的 Linux 服务器的文章。它是一个基于 Web 的工具,为管理多个服务器及其相关的服务和应用提供了一个简洁、强大的界面。它还简化了日常的管理任务。
在这篇文章中,我将会介绍如何在树莓派基金会提供的标准操作系统树莓派 OS 上安装用于 Linux 服务器的 Cockpit Web 控制台。我还会简要介绍它的特性。
在树莓派 OS 上安装 Cockpit
在 sudo 权限下使用一个账户通过 SSH 登录你的树莓派系统。如果你还没有建立一个账户:
$ ssh pibox
alan@pibox's password:
Linux pibox.someplace.org 5.10.17-v7+ #1403 SMP Mon Feb 22 11:29:51 GMT 2021 armv7l
The programs included with the Debian GNU/Linux system are free software;
the exact distribution terms for each program are described in the
individual files in /usr/share/doc/*/copyright.
Debian GNU/Linux comes with ABSOLUTELY NO WARRANTY, to the extent
permitted by applicable law.
Last login: Tue May 4 09:55:57 2021 from 172.1.4.5
alan@pibox:~ $
Cockpit 在树莓派上的表现就像它在其他 Linux 系统上一样。你可以将它添加到仪表盘上进行集中控制。它允许企业在 Cockpit 作为管理仪表盘解决方案的任何地方,将基于树莓派的服务和系统整合到他们的整体 Linux 基础设施中。因为树莓派经常在高密度机架数据中心以无外接控制headless方式运行,而这些数据中心通常会缺乏 KVM 访问方式,这是非常方便的。
# check that we want heat
if self.target_state.value == 1:
# if heat relay is already on, check if above threshold
# if above, turn off .. if still below keep on
if GPIO.input(self.relay_pin):
if self.current_temp.value - self.target_temp.value >= 0.5:
status = 'HEAT ON - TEMP IS ABOVE TOP THRESHOLD, TURNING OFF'
GPIO.output(self.relay_pin, GPIO.LOW)
else:
status = 'HEAT ON - TEMP IS BELOW TOP THRESHOLD, KEEPING ON'
GPIO.output(self.relay_pin, GPIO.HIGH)
# if heat relay is not already on, check if below threshold
elif not GPIO.input(self.relay_pin):
if self.current_temp.value - self.target_temp.value <= -0.5:
status = 'HEAT OFF - TEMP IS BELOW BOTTOM THRESHOLD, TURNING ON'
GPIO.output(self.relay_pin, GPIO.HIGH)
else:
status = 'HEAT OFF - KEEPING OFF'
deb http://mirrors.aliyun.com/raspbian/raspbian/ bullseye main non-free contrib deb-src http://mirrors.aliyun.com/raspbian/raspbian/ bullseye main non-free contrib