手记鲁班猫树莓派部署python服务
在开发智能厨房设备,产品包括:炒菜机、油炸机、煮面机、饺子机、泡馍机,我们产品方向做无人餐厅、自动化餐厅,
使用机器人,机械臂、AGV等自动化智能设备,业务流程是这样的:客户通过小程序或者语音点餐,确定之后将订单信息传送到调度系统,调度系统根据订单内容和类别进行拆分封装成烹饪任务作业分配到具体的烹饪设备,有AGV或者机械臂负责获取传送食材,烹饪完成有送餐机器人送到餐桌。
在项目中使用AGV+灵巧手 实现液体料自动投放开发中,在AGV集成灵巧手的动作, 视频如下:

在AGV集成灵巧手
lebai@192.168.9.62’s password:
┌──────────────────────────────────────────────────────────────────────┐
│ • MobaXterm Personal Edition v25.2 • │
│ (SSH client, X server and network tools) │
│ │
│ ⮞ SSH session to lebai@192.168.9.62 │
│ • Direct SSH : ✓ │
│ • SSH compression : ✓ │
│ • SSH-browser : ✓ │
│ • X11-forwarding : ✓ (remote display is forwarded through SSH) │
│ │
│ ⮞ For more info, ctrl+click on help or visit our website. │
└──────────────────────────────────────────────────────────────────────┘
OO OOOOOO OOOOOOOOO OOOOOOOOOOOOO .OOOOOOOOOOOOOOOO OOOOOOOOOOOOOOOOOOOO OOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOO\ OOOOOOOOOOOO /OOOOOOOOOOOOOO OOOOOO OOOOOOOOOOOOO/ OOOOOOOOOOOOO \OOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOO\ ̄/OOOOOOOOOOOOOOOOOOOOOOOOOOOOO\/OOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOO
| | _ _ | |__ ____ _____ / | ____ | |
| | | | | || ’ \ / _ || _ || | / _ || |
| || || || |) || (| || | | || || (| || |
||_.||_./ _'||| || _|_'| __|
Welcome to Ubuntu 20.04.6 LTS (GNU/Linux 5.10.160 aarch64)
- Documentation: http://doc.embedfire.com
- Management: http://www.embedfire.com
- lubancat-rk3588-ubuntu20.04-lite-20240620
System information as of Sat Oct 11 18:15:36 CST 2025
System load: 0.90 0.89 0.76 Up time: 25 min
Memory usage: 6 % of 3897MB IP: 192.168.9.62
CPU temp: 35°C GPU temp: 35°C
Usage of /: 8% of 29G
Last login: Sat Oct 11 17:29:55 2025 from 192.168.10.99
lebai@lubancat:~$ ping telnet 192.168.9.62:9000
ping: unknown host
lebai@lubancat:~$ netstat -tuln | grep :90000
lebai@lubancat:~$ netstat -tuln | grep :9000
lebai@lubancat:~$ netstat -tuln -p
(Not all processes could be identified, non-owned process info
will not be shown, you would have to be root to see it all.)
Active Internet connections (only servers)
Proto Recv-Q Send-Q Local Address Foreign Address State PID/Program name
tcp 0 0 0.0.0.0:80 0.0.0.0:* LISTEN -
tcp 0 0 0.0.0.0:8081 0.0.0.0:* LISTEN -
tcp 0 0 0.0.0.0:5170 0.0.0.0:* LISTEN -
tcp 0 0 0.0.0.0:5171 0.0.0.0:* LISTEN -
tcp 0 0 127.0.0.53:53 0.0.0.0:* LISTEN -
tcp 0 0 0.0.0.0:3030 0.0.0.0:* LISTEN -
tcp 0 0 0.0.0.0:22 0.0.0.0:* LISTEN -
tcp 0 0 0.0.0.0:3000 0.0.0.0:* LISTEN -
tcp 0 0 0.0.0.0:25 0.0.0.0:* LISTEN -
tcp 0 0 127.0.0.1:6010 0.0.0.0:* LISTEN -
tcp 0 0 0.0.0.0:5180 0.0.0.0:* LISTEN -
tcp 0 0 0.0.0.0:5181 0.0.0.0:* LISTEN -
tcp 0 0 0.0.0.0:5182 0.0.0.0:* LISTEN -
tcp 0 0 0.0.0.0:5183 0.0.0.0:* LISTEN -
tcp 0 0 0.0.0.0:5184 0.0.0.0:* LISTEN -
tcp 0 0 0.0.0.0:3010 0.0.0.0:* LISTEN -
tcp 0 0 0.0.0.0:3050 0.0.0.0:* LISTEN -
tcp 0 0 0.0.0.0:3020 0.0.0.0:* LISTEN -
tcp6 0 0 :::8080 ::😗 LISTEN -
tcp6 0 0 :::21 ::😗 LISTEN -
tcp6 0 0 :::22 ::😗 LISTEN -
tcp6 0 0 :::25 ::😗 LISTEN -
tcp6 0 0 ::1:6010 ::😗 LISTEN -
tcp6 0 0 :::6060 ::😗 LISTEN -
udp 0 0 127.0.0.53:53 0.0.0.0:* -
udp 0 0 0.0.0.0:5353 0.0.0.0:* -
udp 0 0 0.0.0.0:5353 0.0.0.0:* -
udp6 0 0 :::5353 ::😗 -
udp6 0 0 :::5353 ::😗 -
lebai@lubancat:~$ cd
lebai@lubancat:~$ cd hand
lebai@lubancat:~/hand$ python3.8 install
python3.8: can’t open file ‘install’: [Errno 2] No such file or directory
lebai@lubancat:~/hand$ ls
pycache flask-3.0.0-py3-none-any.whl flask-3.0.3-py3-none-any.whl inspire_hand.py inspire_http.py pyserial-3.5-py2.py3-none-any.whl
lebai@lubancat:~/hand$ python3.8 inspire_http.py
- Serving Flask app ‘inspire_http’
- Debug mode: on
WARNING: This is a development server. Do not use it in a production deployment. Use a production WSGI server instead. - Running on all addresses (0.0.0.0)
- Running on http://127.0.0.1:9000
- Running on http://192.168.9.62:9000
Press CTRL+C to quit - Restarting with stat
- Debugger is active!
- Debugger PIN: 128-479-045
^Clebai@lubancat:~/handpython3.8 inspire_http.py ^C
lebai@lubancat:~/hand$ netstat -tuln -p
(Not all processes could be identified, non-owned process info
will not be shown, you would have to be root to see it all.)
Active Internet connections (only servers)
Proto Recv-Q Send-Q Local Address Foreign Address State PID/Program name
tcp 0 0 0.0.0.0:80 0.0.0.0:* LISTEN -
tcp 0 0 0.0.0.0:8081 0.0.0.0:* LISTEN -
tcp 0 0 0.0.0.0:5170 0.0.0.0:* LISTEN -
tcp 0 0 0.0.0.0:5171 0.0.0.0:* LISTEN -
tcp 0 0 127.0.0.53:53 0.0.0.0:* LISTEN -
tcp 0 0 0.0.0.0:3030 0.0.0.0:* LISTEN -
tcp 0 0 0.0.0.0:22 0.0.0.0:* LISTEN -
tcp 0 0 0.0.0.0:3000 0.0.0.0:* LISTEN -
tcp 0 0 0.0.0.0:25 0.0.0.0:* LISTEN -
tcp 0 0 127.0.0.1:6010 0.0.0.0:* LISTEN -
tcp 0 0 0.0.0.0:5180 0.0.0.0:* LISTEN -
tcp 0 0 0.0.0.0:5181 0.0.0.0:* LISTEN -
tcp 0 0 0.0.0.0:5182 0.0.0.0:* LISTEN -
tcp 0 0 0.0.0.0:5183 0.0.0.0:* LISTEN -
tcp 0 0 0.0.0.0:5184 0.0.0.0:* LISTEN -
tcp 0 0 0.0.0.0:3010 0.0.0.0:* LISTEN -
tcp 0 0 0.0.0.0:3050 0.0.0.0:* LISTEN -
tcp 0 0 0.0.0.0:3020 0.0.0.0:* LISTEN -
tcp6 0 0 :::8080 ::😗 LISTEN -
tcp6 0 0 :::21 ::😗 LISTEN -
tcp6 0 0 :::22 ::😗 LISTEN -
tcp6 0 0 :::25 ::😗 LISTEN -
tcp6 0 0 ::1:6010 ::😗 LISTEN -
tcp6 0 0 :::6060 ::😗 LISTEN -
udp 0 0 127.0.0.53:53 0.0.0.0:* -
udp 0 0 0.0.0.0:5353 0.0.0.0:* -
udp 0 0 0.0.0.0:5353 0.0.0.0:* -
udp6 0 0 :::5353 ::😗 -
udp6 0 0 :::5353 ::😗 -
lebai@lubancat:~/hand$ python3.8 inspire_http.py - Serving Flask app ‘inspire_http’
- Debug mode: on
WARNING: This is a development server. Do not use it in a production deployment. Use a production WSGI server instead. - Running on all addresses (0.0.0.0)
- Running on http://127.0.0.1:9000
- Running on http://192.168.9.62:9000
Press CTRL+C to quit - Restarting with stat
- Debugger is active!
- Debugger PIN: 128-479-045
192.168.9.33 - - [11/Oct/2025 18:23:04] “POST /setangle HTTP/1.1” 200 -
192.168.9.33 - - [11/Oct/2025 18:23:26] “POST /setangle HTTP/1.1” 200 -
192.168.9.33 - - [11/Oct/2025 18:24:06] “POST /setangle HTTP/1.1” 200 -
^Clebai@lubancat:~/hand$
System load: 1.09 1.27 1.16 Up time: 1:03 hour
Memory usage: 6 % of 3897MB IP: 192.168.9.62
CPU temp: 36°C GPU temp: 36°C
Usage of /: 8% of 29G
Last login: Sat Oct 11 18:15:43 2025 from 192.168.9.33
lebai@lubancat:~$ ls
hand
lebai@lubancat:~$ cd hand
lebai@lubancat:~/hand$ ls
pycache flask-3.0.0-py3-none-any.whl flask-3.0.3-py3-none-any.whl inspire_hand.py inspire_http.py pyserial-3.5-py2.py3-none-any.whl
lebai@lubancat:~/hand$ sudo vim sshand.service
lebai@lubancat:~/hand$ ls
pycache flask-3.0.0-py3-none-any.whl flask-3.0.3-py3-none-any.whl inspire_hand.py inspire_http.py pyserial-3.5-py2.py3-none-any.whl sshand.service
lebai@lubancat:~/hand$ sudo systemctl start my_script.service^C
lebai@lubancat:~/hand$ sudo systemctl start sshand.service
Failed to start sshand.service: Unit sshand.service is masked.
lebai@lubancat:~/hand$ sudo systemctl status sshand.service
● sshand.service
Loaded: masked (Reason: Unit sshand.service is masked.)
Active: inactive (dead)
lebai@lubancat:~/hand$ sudo systemctl enable sshand.service
Failed to enable unit: Unit file /etc/systemd/system/sshand.service is masked.
lebai@lubancat:~/hand$ sudo systemctl unmask sshand.service
Removed /etc/systemd/system/sshand.service.
lebai@lubancat:~/hand$ sudo systemctl daemon-reload
lebai@lubancat:~/hand$ sudo systemctl start sshand.service
Failed to start sshand.service: Unit sshand.service not found.
lebai@lubancat:~/hand$ ls
pycache flask-3.0.0-py3-none-any.whl flask-3.0.3-py3-none-any.whl inspire_hand.py inspire_http.py pyserial-3.5-py2.py3-none-any.whl sshand.service
lebai@lubancat:~/hand$ sudo systemctl start sshand.service
Failed to start sshand.service: Unit sshand.service not found.
lebai@lubancat:~/hand$ ^C
lebai@lubancat:~/hand$ ^C
lebai@lubancat:~/hand$ sudo systemctl start sshand.service
Failed to start sshand.service: Unit sshand.service not found.
lebai@lubancat:~/hand$ sudo systemctl start sshand.service
Failed to start sshand.service: Unit sshand.service not found.
lebai@lubancat:~/hand$ sudo systemctl start sshand.service
Failed to start sshand.service: Unit sshand.service not found.
lebai@lubancat:~/hand$ ^C
lebai@lubancat:~/hand$ sudo ln -s /home/lebai/hand/sshand.service /etc/systemd/system/sshand.service
lebai@lubancat:~/hand$ sudo systemctl daemon-reload
lebai@lubancat:~/hand$ sudo systemctl start my_script.service
Failed to start my_script.service: Unit my_script.service not found.
lebai@lubancat:~/hand$ sudo systemctl start sshand.service
lebai@lubancat:~/hand$ sudo systemctl enable sshand.service
Created symlink /etc/systemd/system/multi-user.target.wants/sshand.service → /home/lebai/hand/sshand.service.
lebai@lubancat:~/hand$ sudo systemctl status sshand.service
● sshand.service - My Python Script
Loaded: loaded (/etc/systemd/system/sshand.service; enabled; vendor preset: enabled)
Active: failed (Result: exit-code) since Sat 2025-10-11 19:14:50 CST; 44s ago
Main PID: 285435 (code=exited, status=2)
Oct 11 19:14:50 lubancat systemd[1]: sshand.service: Start request repeated too quickly.
Oct 11 19:14:50 lubancat systemd[1]: sshand.service: Failed with result ‘exit-code’.
Oct 11 19:14:50 lubancat systemd[1]: Failed to start My Python Script.
lebai@lubancat:~/hand$ sudo systemctl status sshand.service
● sshand.service - My Python Script
Loaded: loaded (/etc/systemd/system/sshand.service; enabled; vendor preset: enabled)
Active: failed (Result: exit-code) since Sat 2025-10-11 19:14:50 CST; 1min 56s ago
Main PID: 285435 (code=exited, status=2)
Oct 11 19:14:50 lubancat systemd[1]: sshand.service: Start request repeated too quickly.
Oct 11 19:14:50 lubancat systemd[1]: sshand.service: Failed with result ‘exit-code’.
Oct 11 19:14:50 lubancat systemd[1]: Failed to start My Python Script.
lebai@lubancat:~/hand$ sudo systemctl enable sshand.service
lebai@lubancat:~/hand$ sudo systemctl status sshand.service
● sshand.service - My Python Script
Loaded: loaded (/etc/systemd/system/sshand.service; enabled; vendor preset: enabled)
Active: failed (Result: exit-code) since Sat 2025-10-11 19:14:50 CST; 2min 35s ago
Main PID: 285435 (code=exited, status=2)
Oct 11 19:14:50 lubancat systemd[1]: sshand.service: Start request repeated too quickly.
Oct 11 19:14:50 lubancat systemd[1]: sshand.service: Failed with result ‘exit-code’.
Oct 11 19:14:50 lubancat systemd[1]: Failed to start My Python Script.
lebai@lubancat:~/hand$ sudo systemctl status sshand.service
● sshand.service - My Python Script
Loaded: loaded (/etc/systemd/system/sshand.service; enabled; vendor preset: enabled)
Active: failed (Result: exit-code) since Sat 2025-10-11 19:14:50 CST; 2min 44s ago
Main PID: 285435 (code=exited, status=2)
Oct 11 19:14:50 lubancat systemd[1]: sshand.service: Start request repeated too quickly.
Oct 11 19:14:50 lubancat systemd[1]: sshand.service: Failed with result ‘exit-code’.
Oct 11 19:14:50 lubancat systemd[1]: Failed to start My Python Script.
[Unit]
Description=My Python Script
After=network.target
[Service]
ExecStart=/usr/bin/python3.8 /home/lebai/hand/inspire_http.py
Restart=always
User=lebai
[Install]
WantedBy=multi-user.target
Oct 11 19:32:10 lubancat python3.8[47201]: WARNING: This is a development server. Do not use it in a production deployment. Use a production WSGI server instead.
Oct 11 19:32:10 lubancat python3.8[47201]: * Running on all addresses (0.0.0.0)
Oct 11 19:32:10 lubancat python3.8[47201]: * Running on http://127.0.0.1:9000
Oct 11 19:32:10 lubancat python3.8[47201]: * Running on http://192.168.9.62:9000
Oct 11 19:32:10 lubancat python3.8[47201]: Press CTRL+C to quit
Oct 11 19:32:10 lubancat python3.8[47201]: * Restarting with stat
Oct 11 19:32:11 lubancat python3.8[47260]: * Debugger is active!
Oct 11 19:32:11 lubancat python3.8[47260]: * Debugger PIN: 137-556-910
Oct 11 19:32:17 lubancat python3.8[47260]: 192.168.9.33 - - [11/Oct/2025 19:32:17] “POST /setangle HTTP/1.1” 200 -
Oct 11 19:32:45 lubancat python3.8[47260]: 192.168.9.33 - - [11/Oct/2025 19:32:45] “POST /setangle HTTP/1.1” 200 -
lebai@lubancat:~/hand$ CD /etc/network
-bash: CD: command not found
lebai@lubancat:~/hand$ cd /etc/network
lebai@lubancat:/etc/network$ ls
if-down.d if-post-down.d if-pre-up.d if-up.d interfaces interfaces.d
lebai@lubancat:/etc/network$ ll
total 32
drwxr-xr-x 7 root root 4096 Jun 20 2024 ./
drwxrwxr-x 95 cat cat 4096 Sep 9 18:06 …/
drwxr-xr-x 2 root root 4096 Oct 15 2024 if-down.d/
drwxr-xr-x 2 root root 4096 Jun 20 2024 if-post-down.d/
drwxr-xr-x 2 root root 4096 Jun 20 2024 if-pre-up.d/
drwxr-xr-x 2 root root 4096 Oct 15 2024 if-up.d/
-rw-r–r-- 1 root root 142 Jun 20 2024 interfaces
drwxr-xr-x 2 root root 4096 May 3 2019 interfaces.d/
lebai@lubancat:/etc/network$ vm interface.d
-bash: vm: command not found
lebai@lubancat:/etc/network$ vi interface.d
lebai@lubancat:/etc/network$ vi interfaces.d
lebai@lubancat:/etc/network$ vi interfaces
lebai@lubancat:/etc/network$ cd/
-bash: cd/: No such file or directory
lebai@lubancat:/etc/network$ cd.
-bash: cd.: command not found
lebai@lubancat:/etc/network$ cd…
-bash: cd…: command not found
lebai@lubancat:/etc/network$ cd/
-bash: cd/: No such file or directory
lebai@lubancat:/etc/network$ cd /etc/netplan
lebai@lubancat:/etc/netplan$ ls
01-network-manager-all.yaml
lebai@lubancat:/etc/netplan$ vim 01-network-manager-all.yaml
lebai@lubancat:/etc/netplan$ sudo vim 01-network-manager-all.yaml
lebai@lubancat:/etc/netplan$ sudo vim 01-network-manager-all.yaml
lebai@lubancat:/etc/netplan$ sudo netplan apply
