@kidswong999 已经贴了demo代码了哈,谢谢
2
21xg_1649472218 发布的帖子
-
RE: openmv rpc接口访问卡死
使用的rpc协议
wlan = network.WINC(mode=network.WINC.MODE_AP) wlan.start_ap(SSID, key=KEY, security=wlan.WEP, channel=2) print("AP mode started. SSID: {} IP: {}".format(SSID, wlan.ifconfig()[0])) interface = rpc.rpc_network_slave(wlan)
方法1:当code_str 字段内容较大时 接口卡死
def upload_code_str(data): """upload_code_str Args: data (_type_): _description_ Returns: _type_: _description_ """ try: input_args = json.loads(bytes(data).decode()) file_name = input_args["file_name"] code_str = input_args["code_str"] with open("/codes/"+file_name, "w") as f: f.write(code_str) f.close() except Exception as e: print(repr(e)) return memoryview('success')
方法2:返回图片数据后,再调用其他接口卡死
def start_snapshoot(data): """start snapshoot Args: data (_type_): _description_ Returns: _type_: _description_ """ try: album_name = bytes(data).decode() file_path = "/images/%s/%s.jpg" % (album_name, str(time.time_ns())[0:13]) print(album_name, file_path) sensor.snapshot().save(file_path) with open(file_path, 'rb') as f: return bytearray(f.read()) except Exception as e: print(repr(e)) return bytes()
-
openmv rpc接口访问卡死
openmv摄像头启动rpc服务,数据量大的接口访问后,再次访问其他接口就会hang住,一直没有返回。
数据量大的接口主要是传图片内容、上传文件等
请问这是啥原因?谢谢