esp32 报错 ERRNO 104
服务端
import requests, json
from flask import Flask, session, make_response, redirect, url_for, request, jsonify
#实例化FLASK模块
app = Flask(__name__)
@app.route('/', methods=['GET', 'POST'])
#定义函数方便其他路由进行跳转
def data_handler() :
global traceback
#traceback为返回字典results键键值中正序第一项即置信度的值
traceback = '0.8'
d = {"confidence":traceback}
data = json.dumps(d, indent=4)
r = make_response(jsonify({'confidence': traceback}))
#将置信度传递至浏览器cookie中
r.set_cookie('confidence', traceback)
e = request.cookies.get('confidence')
print(data)
return r
app.run(port=24401, debug=True)
#port端口号 默认于127.0.0.1运行,host设置ip进行运行(default: 127.0.0.1:80)
ESP32(micropython)
import urequests, networks
r = urequests.get("http://127.0.0.1:24401")
print(r.text)
报错信息:
"", line5 , in
"urequests.py", line116, in get
"urequests.py", line 60, in request
Error: [Errno 104] ECONNRESET