Pi Pico W "OSError: -2" hatası

morue

Decapat
Katılım
14 Nisan 2023
Mesajlar
325
Çözümler
1
Daha fazla  
Cinsiyet
Erkek
Python:
import network
import time
import urequests

wlan=network.WLAN(network.STA_IF)
wlan.active(True)
wlan.connect('wifi_ad','wifi_sifre')

while wlan.isconnected==False:
    print('... Connecting')
print('Congratulations, You are connected')
astronauts =urequests.get("http://api.open-notify.org/astros.json").json()
print(astronauts)

Traceback (most recent call last):
File "<stdin>", line 12, in <module>
File "requests/init.py", line 182, in get
File "requests/init.py", line 76, in request
OSError: -2


Bu hatayı alıyorum yardımcı olur musunuz?
 
Bu kodu deneyin bi hocam.

Python:
import network
import time
import urequests

wlan = network.WLAN(network.STA_IF)
wlan.active(True)
wlan.connect('wifi_ssid', 'wifi_password')

while not wlan.isconnected():
    print('... Connecting')
    time.sleep(1)

print('Congratulations, You are connected')
print('Your IP address:', wlan.ifconfig()[0])

try:
    astronauts = urequests.get("http://api.open-notify.org/astros.json").json()
    print("Astronauts:", astronauts)
except OSError as e:
    print("Connection error:", e)
 
Hocam sizin yazdığınızda benim yazdığımda şimdi çalışıyor .Ben 5Ghz ye bağlamaya çalıştığım için olmamış bu cihaz 2.4Ghz destekliyor. Yine de yardımınız için teşekkürler.
 

Technopat Haberler

Yeni konular

Geri
Yukarı