OSError: [Errno 1] EPERM #15680
Vikashkushwaha70
started this conversation in
General
Replies: 2 comments 1 reply
-
You can use GitHub Flavoured Markdown to format your posts. In particular use |
Beta Was this translation helpful? Give feedback.
0 replies
-
Which board are you using to run your program? Are you sure that your board supports WiFi? |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
import time
import network
from machine import Pin
import BlynkLib
Define pins
led1 = Pin(5, Pin.OUT)
led2 = Pin(2, Pin.OUT) # Uncommented for proper setup
Wi-Fi credentials
ssid = 'Vikash'
password = '123123178'
Connect to Wi-Fi
sta_if = network.WLAN(network.STA_IF)
sta_if.active(True)
if not sta_if.isconnected():
print('Connecting to network...')
sta_if.connect(ssid, password)
while not sta_if.isconnected():
time.sleep(1)
print('Network config:', sta_if.ifconfig())
Blynk authentication token
BLYNK_AUTH = 'fhMTP8zz6x1Oc6cf3kENlUDmkC8b6E2D'
Initialize Blynk
blynk = BlynkLib.Blynk(BLYNK_AUTH)
Register virtual pin handler for V0
@blynk.on("V0")
def v0_write_handler(value):
if int(value[0]) == 1:
led1.value(1) # Turn the LED on
else:
led1.value(0) # Turn the LED off
Register virtual pin handler for V1
@blynk.on("V1")
def v1_write_handler(value):
if int(value[0]) == 1:
led2.value(1) # Turn the LED on
else:
led2.value(0) # Turn the LED off
Main loop
while True:
blynk.run()
Connecting to network...
Traceback (most recent call last):
File "", line 19, in
OSError: [Errno 1] EPERM
Beta Was this translation helpful? Give feedback.
All reactions