BLYNK
HOME       📲 GETTING STARTED       📗 DOCS       ❓HELP CENTER       👉 SKETCH BUILDER

Error setting up Blynk in microPython on ESP8266

Hi
I am using an ESP8266 Wemos D1 mini which runs microPython and use the Blynk server.
I have downloaded the library from GitHub: “Blynk-Library-Python” by Vshymanskyy (Aug 18.2019) and saved the file BlynkLib.py to the root of the ESP8266 (I have also tried to move it to \lib but result is the same)

Running my sketch the ESP8266 connects to the router and obtains an IP address - I have a server running on the ESP which works fine (I have also tried to run the program without the Server)

I have found BlynkLib_mp on GitHub (lib-python] and tried that library as well with no luck.

When I run the program I keep getting the following messages
Connecting to WiFi…
IP: 192.168.1.114
Connecting to Blynk…
Traceback (most recent call last):
File “”, line 38, in
AttributeError: ‘module’ object has no attribute 'Blynk’

Line 38 is the line “blynk = BlynkLib.Blynk(BLYNK_AUTH)

Here" my" program (the Auth has been modified in this copy):

import BlynkLib
import network
import machine

WIFI_SSID = 'Linksysxxxxx'
WIFI_PASS = 'my PW'

BLYNK_AUTH = 'kTFRmx7VgEtXb2xyzMyAoi4dNHqSsFG6'

print("Connecting to WiFi...")
wifi = network.WLAN(network.STA_IF)
wifi.active(True)
wifi.connect(WIFI_SSID, WIFI_PASS)
while not wifi.isconnected():
    pass

print('IP:', wifi.ifconfig()[0])

print("Connecting to Blynk...")
blynk = BlynkLib.Blynk(BLYNK_AUTH)

@blynk.on("connected")
def blynk_connected(ping):
    print('Blynk ready. Ping:', ping, 'ms')

def runLoop():
    while True:
        blynk.run()
        machine.idle()

# Run blynk in the main thread:
runLoop()