如何将urequests.get()连接到picoweb服务器

时间:2019-10-20 18:37:40

标签: python microcontroller esp32 micropython pybricks-micropython

当我尝试使用

连接到picoweb服务器时

urequests.get('http://192.168.4.1:8081/stop')

我收到此错误

Traceback (most recent call last):   File "<stdin>", line 1, in <module>   File "<string>", line 60, in <module>   File "urequests.py", line 112, in get   File "urequests.py", line 100, in request   File "urequests.py", line 58, in request OSError: [Errno 103] ECONNABORTED

代码:

app = picoweb.WebApp(__name__)


@app.route("/stop")  
def rev(req, resp):
  led.value(1)
  LM.rev(speed)
  RM.rev(speed-100)
  yield from picoweb.start_response(resp)
  yield from resp.awrite(html)


app.run(host='192.168.4.1', port=8081)


0 个答案:

没有答案