导航

    • 登录
    • 搜索
    • 版块
    • 产品
    • 教程
    • 论坛
    • 淘宝
    1. 主页
    2. dtvb
    D
    • 举报资料
    • 资料
    • 关注
    • 粉丝
    • 屏蔽
    • 帖子
    • 楼层
    • 最佳
    • 群组

    dtvb

    @dtvb

    0
    声望
    16
    楼层
    1048
    资料浏览
    0
    粉丝
    0
    关注
    注册时间 最后登录

    dtvb 关注

    dtvb 发布的帖子

    • linux主机对存储的挂载控制,脚本会自动停止?

      openmv 接的Linux 主机,因为应用需要,不能使用IDE, 需要脱机使用。我需要让linux 主机能主动控制存储的挂载,默认不会自动挂载到主机上,main.py程序能自动运行。运行完后,linux 主机用命令将存储挂载到主机上,更换main.py脚本,然后使用继电器短接reset和GNDpin ,reset 后会自动跑更新后的脚本。跑完再次挂载到主机上,在更换脚本,如此反复。
      现在遇到的问题是,虽然Linux 关闭了自动挂载,但是reset后还是会出现问题,程序跑不到1秒或2,3秒救自动停止了。reset后,又是跑1,2秒就停止了。

      发布在 OpenMV Cam
      D
      dtvb
    • RE: linux主机用最低的成本完成对openMV板的reset(不能用IDE).

      linux电脑主机运行自动化测试脚本(robot 框架),使用openmv测试产品的LED 灯状态只是其中一小部分测试内容,linux主机通过自动测试脚本(标准python)切换产品的状态灯的状态,然后通过替换不同的main.py脚本(已经在IDE里面调试确认过的)后reset来识别LED的不同状态,通过uart抓取测试结果做判断。如果IDE 能够被测试脚本通过终端命令行直接调用,就不会找这么麻烦的方法了。可能我对openMV的认知不够,也请你帮忙找到合适的方案。非常感谢。之前也弄过rpc,后来发现只适用于两个openmv之间使用。

      发布在 OpenMV Cam
      D
      dtvb
    • linux主机用最低的成本完成对openMV板的reset(不能用IDE).

      我的openMV板和UART板都是用USB线连接到linux电脑上使用。使用逻辑中,需要反复替换main.py的内容,然后reset openmv,
      已知可以OPENMV IDE 或reset pin 接地可以reset.
      我的需求是不能在linux中使用openmv IDE.那么有什么办法可以最低的成本通过linux主机完成对reset pin接地。或是是否其他简易方法?

      发布在 OpenMV Cam
      D
      dtvb
    • RE: how to show the rpc return data in python3 output print.

      我重新插拔了模块,还是和以前一样。
      “我建议你先用uart作rpc,电脑端加一个ttl转usb模块。否则代码报错了你都不知道。”你的意思是我需要加一个串口调试扩展板 uart 转usb 的板子来调试程序是么?

      还有我现在的IDE 环境直接调用popular features as the remote device 示例脚本,会报错"no module named serial",我看是import rpc 时需要import serial .但是IDE 没有找到serial。

      发布在 OpenMV Cam
      D
      dtvb
    • RE: how to show the rpc return data in python3 output print.

      脱机运行,不就是把上面openmv 端的脚本放在mian.py 里面,就会自动运行么

      发布在 OpenMV Cam
      D
      dtvb
    • RE: how to show the rpc return data in python3 output print.

      @kidswong999 已经按照你的脚本修改了main.py 的内容。但是server 端python3 执行如下脚本,还是没有任何输出. 是哪里出错了么
      import json, struct, serial, rpc
      interface = rpc.rpc_usb_vcp_master("/dev/ttyACM0")
      def receive_and_print_fps():
      result = interface.call("get_fps")
      if result is not None and len(result):
      fps = struct.unpack("<f", result)[0]
      print("FPS received from OpenMV device:", fps)
      while True:
      receive_and_print_fps()

      发布在 OpenMV Cam
      D
      dtvb
    • RE: how to show the rpc return data in python3 output print.

      不好意思, 我linux server 中没有安装中文输入法,为了贴脚本方便,用英语写的帖子
      我想通过helloworld 脚本来学习rpc 的用法,实验是否能满足我的需求. 通过openmv 端运行helloworld 脚本,产生一个fps 的数据.然后通过rpc 模块让linux server 端的python3 打印出fps数据.
        main.py 如下:
      so main.py as below:

      import sensor, time, rpc
      interface = rpc.rpc_usb_vcp_slave()
      sensor.reset()
      sensor.set_pixformat(sensor.RGB565)
      sensor.set_framesize(sensor.QVGA)
      sensor.skip_frames(time=2000)
      clock = time.clock()
      def get_fps():
      clock.tick()
      return struct.pack("<f", clock.fps())
      interface.register_method("get_fps", get_fps)
      while True:
      interface.loop()

      linux 服务器端运行的程序如下;

      import json, struct, serial, rpc
      interface = rpc.rpc_usb_vcp_master("/dev/ttyACM0")
      def receive_and_print_fps():
      result = interface.call("get_fps")
      if result is not None and len(result):
      fps = struct.unpack("<f", result)[0]
      print("FPS received from OpenMV device:", fps)
      while True:
      receive_and_print_fps()

      linux 端运行上面的程序后,并不能得到任何输出, 通过minicom工具读取 /dev/ttyACM0 的打印信息如下:
      Welcome to minicom 2.8
      OPTIONS: I18n
      Port /dev/ttyACM0, 17:05:52
      Press CTRL-A Z for help on special keys
      )CfC)CfC)CfC)CfC)CfC)CfC)CfC)CfC)CfC)CfC)CfC)CfC)CfC)CfC)CfC)CfC)CfC)CfC)CfC)CfC)CfC)CfC)CfC)CfC)
      如果Linux 服务器端的程序在运行,这个 CfC) 就会一直重复下去.如果中断这个程序,这个CfC) 就会停止.
      我的问题是,有啥办法,让fps数据在linux 服务器端 python3 -u controller.py 执行后,直接打印出来.谢谢

      发布在 OpenMV Cam
      D
      dtvb
    • how to show the rpc return data in python3 output print.

      I want to use Linux server side print the openmv device fps information directly by rpc module. in order to learn the rpc module usage method , then use it for my script . so I just modify the hello.py for learn the rpc.
      so main.py as below:

      import sensor, time, rpc
      interface = rpc.rpc_usb_vcp_slave()
      sensor.reset()
      sensor.set_pixformat(sensor.RGB565)
      sensor.set_framesize(sensor.QVGA)
      sensor.skip_frames(time=2000)
      clock = time.clock()
      def get_fps():
      clock.tick()
      return struct.pack("<f", clock.fps())

      Register the method to fetch FPS

      interface.register_method("get_fps", get_fps)
      while True:
      interface.loop()

      and linux server execute the controller.py as below:

      import json, struct, serial, rpc
      interface = rpc.rpc_usb_vcp_master("/dev/ttyACM0")
      def receive_and_print_fps():
      result = interface.call("get_fps")
      if result is not None and len(result):
      fps = struct.unpack("<f", result)[0]
      print("FPS received from OpenMV device:", fps)
      while True:
      receive_and_print_fps()

      after Linux server side run the python3 -u controller.py , there is no output print. I use the minicom -D /dev/ttyACM0 , I can see below output , CfC) repeat.

      Welcome to minicom 2.8
      OPTIONS: I18n
      Port /dev/ttyACM0, 17:05:52
      Press CTRL-A Z for help on special keys
      )CfC)CfC)CfC)CfC)CfC)CfC)CfC)CfC)CfC)CfC)CfC)CfC)CfC)CfC)CfC)CfC)CfC)CfC)CfC)CfC)CfC)CfC)CfC)CfC)

      I want to know how to modify the script in order to print the fps information after execute the python3 -u controller.py in Linux server terminal. and why CfC) showed, not the true fps data ? thank you very much !!!

      发布在 OpenMV Cam
      D
      dtvb
    • RE: 如何设置Linux电脑端的USB VCP 端口

      which port should I use ? /dev/ttyS0 ?
      interface = rpc.rpc_usb_vcp_master() should modify to master(/dev/ttyS0) ?

      Available Ports:

      /dev/ttyS4 : n/a [n/a]
      /dev/ttyS0 : ttyS0 [PNP0501]
      /dev/ttyACM0 : OpenMV Virtual Comm Port in FS Mode [USB VID:PID=1209:ABD1 SER=377B33613033 LOCATION=3-3:1.0]

      Please enter a port name:

      发布在 OpenMV Cam
      D
      dtvb
    • 如何设置Linux电脑端的USB VCP 端口

      已经知道在openMV 端设置使用interface = rpc.rpc_usb_vcp_slave()而不是interface = rpc.rpc_uart_slave(baudrate=115200)。
      但是不知道如何设置电脑端的端口,我用的时Ubuntu 22.04,连接openmv 后,会新增ttyACM0 端口,不知道这个interface = rpc.rpc_usb_vcp_master() 改如何设置。我尝试了几个,都被报错。

      发布在 OpenMV Cam
      D
      dtvb