同样的代码,我有两个摄像头,一个是openmv4 H7 plus新买的,一个是openmv4 H7 R2旧的。plus摄像头昨天开始能联网,后来就不行了,不知是否IDE更新了摄像头配置, 驱动和网卡匹配反而有问题了?。我开始以为是网卡问题,测试后发现不是。因为旧摄像头能联网。新的plus连ip都找不到了,也不报错,IDE就那样blocking无限期。。。。。。
gu45
@gu45
gu45 发布的帖子
-
新买的plus摄像头昨天开始能联网,后来就不行了,不知是否更新了摄像头配置驱动和网卡匹配反而有问题了??
-
RE: 按“WIFI编程对OpenMV远程调试”指导运行的时候没有WiFi标志出现在IDE左下角?
@kidswong999 变砖问题按提示运行就解决了。可是还是没有WiFi连接
-
RE: 按“WIFI编程对OpenMV远程调试”指导运行的时候没有WiFi标志出现在IDE左下角?
@kidswong999 而且因为找不到openMV,我的openMV就此变砖了
-
RE: 按“WIFI编程对OpenMV远程调试”指导运行的时候没有WiFi标志出现在IDE左下角?
@kidswong999 wifi卡没有问题,我运行相关例子在手机和相关浏览器都能成功传输视频。我就是因为要作为client传给指定rstp指定port视频,而不是用openMV做controller才想用这个remote control例子试试拓展。
-
按“WIFI编程对OpenMV远程调试”指导运行的时候没有WiFi标志出现在IDE左下角?
openMV4 R2摄像头+WiFi模块。配置和重置都有执行,而且重置完确实红灯亮了又灭了,串口标志闪了一下,wifi标志没有出现过。我再连接的时候告诉我找不到摄像头了
-
要上传视频流到服务器RTSP,通过浏览器浏览,JPEG不支持
# RTSP Video Server # # This example shows off how to stream video over RTSP with your OpenMV Cam. # # You can use a program like VLC to view the video stream by connecting to the # OpenMV Cam's IP address. import network, omv, rtsp, sensor, time # RTP MJPEG streaming works using JPEG images produced by the OV2640/OV5640 camera modules. # Not all programs (e.g. VLC) implement the full JPEG standard for decoding any JPEG image # in RTP packets. Images JPEG compressed by the OpenMV Cam internally may not display. # FFPLAY will correctly handle JPEGs produced by OpenMV software. sensor.reset() sensor.set_pixformat(sensor.JPEG) # Only supported by the OV2640/OV5640. sensor.set_framesize(sensor.UXGA) print("sensor set done") # Turn off the frame buffer connection to the IDE from the OpenMV Cam side. # # This needs to be done when manually compressing jpeg images at higher quality # so that the OpenMV Cam does not try to stream them to the IDE using a fall back # mechanism if the JPEG image is too large to fit in the IDE JPEG frame buffer on the OpenMV Cam. omv.disable_fb(True) # Setup Network Interface network_if = network.WLAN(network.STA_IF) network_if.active(True) #network_if.connect('your-ssid', 'your-password') # Setup RTSP Server server = rtsp.rtsp_server(network_if) # For the call back functions below: # # `pathname` is the name of the stream resource the client wants. You can ignore this if it's not # needed. Otherwise, you can use it to determine what image object to return. By default the path # name will be "/". # # `session` is random number that will change when a new connection is established. You can use # session with a dictionary to differentiate different accesses to the same file name. def setup_callback(pathname, session): print("Opening \"%s\" in session %d" % (pathname, session)) def play_callback(pathname, session): print("Playing \"%s\" in session %d" % (pathname, session)) def pause_callback(pathname, session): # VLC only pauses locally. This is never called. print("Pausing \"%s\" in session %d" % (pathname, session)) def teardown_callback(pathname, session): print("Closing \"%s\" in session %d" % (pathname, session)) server.register_setup_cb(setup_callback) server.register_play_cb(play_callback) server.register_pause_cb(pause_callback) server.register_teardown_cb(teardown_callback) # Track the current FPS. clock = time.clock() # Called each time a new frame is needed. def image_callback(pathname, session): clock.tick() img = sensor.snapshot() # Markup image and/or do various things. print(clock.fps()) return img # Stream does not return. It will call `image_callback` when it needs to get an image object to send # to the remote rtsp client connecting to the server. server.stream(image_callback)
-
RE: mjpeg_streamer.py运行不成功
我把print(wlan.ifconfig())注释掉了后,程序能运行到print ('Waiting for connections..') 串口打印出了信息,然后又block了
-
mjpeg_streamer.py运行不成功
显示Type "help()" for more information.
Trying to connect... (may take a while)...
Traceback (most recent call last):
File "", line 22, in
Exception: IDE interrupt
MicroPython: v1.18-omv-r13 OpenMV: v4.3.2 HAL: v1.9.0 BOARD: OPENMV4-STM32H743
Type "help()" for more information.Trying to connect... (may take a while)...
然后就阻塞没有反应了。相应代码如下:
# 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 SSID ='xyzbalabala' # Network SSID KEY ='12345678' # Network key HOST ='' # Use first available interface PORT = 8080 # Arbitrary non-privileged port # Reset sensor sensor.reset() sensor.set_framesize(sensor.QQVGA) sensor.set_pixformat(sensor.GRAYSCALE) # Init wlan module and connect to network print("Trying to connect... (may take a while)...") wlan = network.WINC() 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]) s.listen(5) # Set server socket to blocking s.setblocking(True) def start_streaming(s): print ('Waiting for connections..') client, addr = s.accept() # set client socket timeout to 2s client.settimeout(2.0) print ('Connected to ' + addr[0] + ':' + str(addr[1])) # Read request from client data = client.recv(1024) # Should parse client request here # Send multipart header client.send("HTTP/1.1 200 OK\r\n" \ "Server: OpenMV\r\n" \ "Content-Type: multipart/x-mixed-replace;boundary=openmv\r\n" \ "Cache-Control: no-cache\r\n" \ "Pragma: no-cache\r\n\r\n") # FPS clock clock = time.clock() # Start streaming images # NOTE: Disable IDE preview to increase streaming FPS. while (True): clock.tick() # Track elapsed milliseconds between snapshots(). frame = sensor.snapshot() cframe = frame.compressed(quality=35) header = "\r\n--openmv\r\n" \ "Content-Type: image/jpeg\r\n"\ "Content-Length:"+str(cframe.size())+"\r\n\r\n" client.send(header) client.send(cframe) print(clock.fps()) while (True): try: start_streaming(s) except OSError as e: print("socket error: ", e) #sys.print_exception(e
)
-
192.168.1.1:8080总是不让连接
openMV的热点代码运行起来了,但是看不见结果。似乎这个连接总是被connection refuse。Android手机也是一次就遭拒。求解决