如何在Linux terminal中运行已经在OpenMV IDE中调试好的脚本?
-
我已经在Openmv IDE 中调试出我所需要的脚本,用来识别LED 灯的颜色和闪烁频率并打印出这些信息.现在我想在Linux环境中,用别的自动化程序来调用这个openmv的脚本所能实现的功能,抓取脚本的打印信息,以实现其他自动化测试和这个摄像头自动识别的功能整合.
现在遇到的问题是,Linux (ubuntu 22.04)环境中使用python3命令来执行这个脚本会出现pyb模组不能安装, 调用最基本的helloworld 脚本也会报错. 网上查到使用 openmv ****.py 命令执行,安装不了openmv 这个命令。AI 提示从GitHub 上下载安装,但是链接没有任何响应。
请帮忙告知正确的调用方法。以拜托这个openmv IDE 这个图形界面,执行脚本让脚本直接输出我要的打印。
-
可以使用OpenMV的RPC的例子,这与IDE无关。
添加你的rpc程序,就是检测LED的程序。
注意要脱机运行。注意要使用interface = rpc.rpc_usb_vcp_slave()而不是interface = rpc.rpc_uart_slave(baudrate=115200)。
这样可以直接用USB的虚拟串口。2,电脑上使用python脚本远程调用OpenMV的程序,步骤:https://github.com/openmv/openmv/blob/master/tools/rpc/README.md
-
python3 -u controller.py
Traceback (most recent call last):
File "/home/paulzhang/remotescript/controller.py", line 4, in
interface = rpc.rpc_usb_vcp_master("/dev/ttyACM0")
NameError: name 'rpc' is not definedI had installed the pyserial module, it seems rpc module can not be run in linux python3 environment. can you give a simple sample script such as helloworld let the ubuntu server running the python3 script to remote control the openmv print the fps data ,then print this data in python3 script output. thanks.
-
你应该把rpc.py复制到你要运行的代码旁边。也就是controller.py旁边。
-
@kidswong999 python3 -u controller.py
Traceback (most recent call last):
File "/home/paulzhang/Desktop/openmv-master/scripts/libraries/controller.py", line 1, in
import json, struct, serial, rpc
File "/home/paulzhang/Desktop/openmv-master/scripts/libraries/rpc.py", line 9, in
import omv
ModuleNotFoundError: No module named 'omv'find / -name omv
/home/paulzhang/Desktop/openmv-master/src/omv
find: ‘/run/user/1000/doc’: Permission denied
find: ‘/run/user/1000/gvfs’: Permission denied
how to fix this issue.
-
I installed the omv-source, had found the omv module ,but now error report no pyb module found , but I can't find and install the pyb module, how to fix this issue ?
python3 controller.py
Traceback (most recent call last):
File "/home/paulzhang/Desktop/omv-source/openmediavault-master/deb/openmediavault/srv/salt/_grains/controller.py", line 1, in
import json, struct, serial, rpc
File "/home/paulzhang/Desktop/omv-source/openmediavault-master/deb/openmediavault/srv/salt/_grains/rpc.py", line 10, in
import pyb
ModuleNotFoundError: No module named 'pyb'
-
此回复已被删除!