小编Sam*_*Sam的帖子

从 micropy 运行 urequests.get 时出现 OSError -202

你好,我的代码有错误,但它在 python shell 中运行,任何人都可以帮助我吗

from machine import Pin
import time
import network
import urequests
p0 = Pin(0,Pin.OUT)
wlan = network.WLAN(network.STA_IF)
wlan.active(True)
wlan.connect('ssid', 'pass')
response = urequests.get('http://jsonplaceholder.typicode.com/albums/1')
while True:
    ans = response.json()['userId']
    p0.value(1)
    time.sleep(1)
    p0.off()
    time.sleep(1)
    print('ok')
Run Code Online (Sandbox Code Playgroud)

这是错误:

Traceback (most recent call last):
  File "<stdin>", line 9, in <module>
  File "urequests.py", line 108, in get
  File "urequests.py", line 53, in request
OSError: -202
Run Code Online (Sandbox Code Playgroud)

python micropython esp32

6
推荐指数
1
解决办法
3574
查看次数

标签 统计

esp32 ×1

micropython ×1

python ×1