先前openmv中有WiFi代码,并且可以使用,经过一段时间重新上电,需要更新固件,未擦除原代码。发现有报错,使用推荐的历程mgpeg_streamer_ap.py,发现仍然报错。按照指示打开更新文件历程fw_update.py,运行发现仍然错,显示无法找到文件。完全使用历程,这个问题如何解决?
1
19805185968
@19805185968
0
声望
18
楼层
1009
资料浏览
0
粉丝
0
关注
19805185968 发布的帖子
-
WiFi模块无法更新
-
不显示连接,无法烧录
使用的多个例程代码,按照视频教程更新过固件,插上OPENMV后仍然不显示U盘插入,资源管理器无信息,无法烧录,但可以在IDE打开openmv,不脱机、不烧录的情况下运行正常。急求解决方案。
-
RE: 脱机运行为何串口无法发送?
import sensor, image, time, math, network, usocket, sys from pyb import UART uart = UART(3, 9600, timeout_char=1000) SSID ='OPENMV_AP' KEY ='1234567890' HOST = '' PORT = 8080 threshold_index = 0 thresholds = [(20, 93, -59, -22, -5, 32)] sensor.reset() sensor.set_pixformat(sensor.RGB565) sensor.set_framesize(sensor.QVGA) sensor.skip_frames(time = 2000) sensor.set_auto_gain(False) sensor.set_auto_whitebal(False) sensor.set_contrast(1) sensor.set_brightness(1) sensor.set_saturation(1) sensor.set_gainceiling(16) wlan = network.WINC(mode=network.WINC.MODE_AP) wlan.start_ap(SSID, key=KEY, security=wlan.WEP, channel=2) def start_streaming(s): print ('Waiting for connections..') client, addr = s.accept() client.settimeout(2.0) print ('Connected to ' + addr[0] + ':' + str(addr[1])) data = client.recv(1024) 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") clock = time.clock() while (True): clock.tick() 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) img = sensor.snapshot() clock.tick() for blob in img.find_blobs([thresholds[threshold_index]], pixels_threshold=200, area_threshold=200, merge=True): img.draw_rectangle(blob.rect()) middle = blob.cx() print(middle) if middle>=0 and middle<=70: feedback = '0x02' id = int('0x02',16) uart.writechar(id) elif middle>=90 and middle<=160: id = int('0x00',16) uart.writechar(id) else : id = int('0x06',16) uart.writechar(id) while (True): s = usocket.socket(usocket.AF_INET, usocket.SOCK_STREAM) try: s.bind([HOST, PORT]) s.listen(5) s.settimeout(3) start_streaming(s) except OSError as e: s.close() print("socket error: ", e)
-
脱机运行为何串口无法发送?
本问题不涉及代码,我使用了WIFI扩展板,OPENMV直接插在电脑上供电可以在串口上打印值,但是接在充电宝上虽然仍可连接WIFI,仍可看到图像,但是串口无法打印数值。同样的代码同样的操作重复多次仍是如此,是因为电压问题吗?该如何解决呢?
-
RE: 请问为何在电脑上可以运行,脱机运行就无法连接wifi?
@kidswong999 并没有,电脑端并没有连接OPENMV的热点,还有就是使用5V电源直接供电OPENMV灯明显闪烁的不对,手机上也搜不到热点,我是使用充电宝供电才出现热点,但无法连接!