Things used in this project

Hardware components:
Nodemcu
NodeMCU ESP8266 Breakout Board
×1
Software apps and online services:
Zpm toolbar 1
Zerynth Studio

Code

Test.pyPython
import streams

# import the wifi interface
from wireless import wifi

# import wifi support !!! IMPORT ESP WIFI DRIVER
from espressif.esp8266wifi import esp8266wifi as wifi_driver

pinMode(D0,OUTPUT)
streams.serial()

sleep(5000)
state = HIGH

# init the wifi driver!
# The driver automatically registers itself to the wifi interface
# with the correct configuration for the selected device

wifi_driver.auto_init()


# use the wifi interface to link to the Access Point
# change network name, security and password as needed
print("Establishing Link...")
try:
    # FOR THIS EXAMPLE TO WORK, "Network-Name" AND "Wifi-Password" MUST BE SET
    # TO MATCH YOUR ACTUAL NETWORK CONFIGURATION
    wifi.link("Network-Name",wifi.WIFI_WPA2,"Wifi-Password")
    while True:
        if state == HIGH:
            state = LOW
        else:
            state = HIGH
        print("Link Active")
        digitalWrite(D0,state)
        sleep(3000)
except Exception as e:
    print("ooops, something wrong while linking :(", e)
    while True:
        sleep(1000)

Credits

600 450752059
Zoran Roncevic
18 projects • 104 followers
Hackster Live ambassador in Serbia. Organizer of Maker NS community.
Contact

Replications

Did you replicate this project? Share it!

I made one

Love this project? Think it could be improved? Tell us what you think!

Give feedback

Comments

Sign up / LoginProjectsPlatformsTopicsContestsLiveAppsBetaBlog