导航

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

    yibc

    @yibc

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

    yibc 关注

    yibc 发布的帖子

    • WiFi模块发布图象网页,可以用非阻塞链接吗?

      买了WiFi模块,用IDE自带例程没问题,根据文档可以用非阻塞链接,并推荐用select的Poll类,我的代码:

      # MJPEG Streaming
      #
      # This example shows off how to do MJPEG streaming to a FIREFOX webrowser
      # Chrome, Firefox and MJpegViewer App on Android have been tested.
      # Connect to the IP address/port printed out from ifconfig to view the stream.
      
      import sensor, image, time, network, usocket, sys
      import select
      
      SSID ='ZhaoBao'     # Network SSID
      KEY  ='19431121'     # Network key
      HOST ='192.168.1.30'     # Use first available interface
      PORT = 8080  # Arbitrary non-privileged port
      
      # Reset sensor
      sensor.reset()
      sensor.set_framesize(sensor.QQVGA)
      sensor.set_pixformat(sensor.RGB565)
      
      gs = []
      
      # Init wlan module and connect to network
      print("Trying to connect... (may take a while)...")
      wlan = network.WINC()
      wlan.ifconfig(('192.168.1.30', '255.255.255.0', '192.168.1.1', '192.168.1.1'))
      wlan.connect(SSID, key=KEY, security=wlan.WPA_PSK)
      
      # We should have a valid IP now via DHCP
      print(wlan.ifconfig())
      
      # Create server socket
      s = usocket.socket(usocket.AF_INET, usocket.SOCK_STREAM)
      
      # Bind and listen
      s.bind([HOST, PORT])
      gs.append(s)
      s.listen(5)
      
      # Set server socket to blocking
      s.setblocking(False)
      p = select.poll()
      p.register(s)
      
      while (True):
          try:
              events = p.poll(900)
              if (len(events) > 0):
                  print(events)
                  for fd,event in events:
                      if fd in gs:
                          c,addr = s.accept()
                          print('got connection from',addr)
                          p.register(c,select.POLLIN)
                          gs[0] = c
                      elif event & select.POLLIN:
                          data = c.recv[1024]
                          if not data:
                              print(c.getpeername,'disconnected')
                              p.unregister(c)
                              del gs[0]
                          else:
                              print (data)
          except OSError as e:
              print("poll error:",e)
              continue
      

      但是执行到”events = p.poll(900)“都出错[Error 5] EIO,是不是系统不支持呀?
      请教哪位老师帮助检查一下问题出错在哪里呢?谢谢了!

      发布在 OpenMV Cam
      Y
      yibc
    • 樹莓派IDE不能啓動,請專家幫忙解決

      樹莓派安裝IDE后,桌面上已經出現圖標,雙擊圖標啓動不起來,用命令行啓動:
      ./bin/openmvide后報錯:
      The X11 connection broke:Maximum allowed requested length exceeded (code 4)
      XIO: fatal IO error 2 on X server “:1.0”
      After 230 requests
      不知爲森麽,特請教,謝謝了!

      发布在 OpenMV Cam
      Y
      yibc
    • 樹莓派IDE安裝不成功,請專家幫忙解決:
      请在这里粘贴代码
      

      樹莓派安裝IDE:
      下載安裝包:openmv-ide-linux-arm-2.8.1.tar
      解壓:tar –xf openmv-ide-linux-arm-2.8.1.tar
      到目錄:openmvide
      ./setup.sh
      報錯,我發下載…libpq5_11.12…..armhf.deb (備注:我的數據源是清華的)
      執行source ~/.profile
      報錯:Could not find libts library
      執行:./bin/openmvide
      報錯:error while loading shared libraries: libGLESv2.so….

      发布在 OpenMV Cam
      Y
      yibc