Important
This project is still available for exploration, but is no longer actively maintained or updated.
We recommend switching to the Blynk MQTT API for a robust and future-proof experience.
Support for this project will be phased out over time.
You can explore some useful MQTT examples here.
Note: The library has been updated for Blynk 2.0.
Please remain on v0.2.0 for legacy Blynk.
If you like Blynk - give it a star, or fork it and contribute!
Blynk provides iOS and Android apps to control any hardware over the Internet or directly using Bluetooth. You can easily build graphic interfaces for all your projects by simply dragging and dropping widgets, right on your smartphone. Blynk is the most popular IoT platform used by design studios, makers, educators, and equipment vendors all over the world.
Blynk Mobile App:
Google Play |
App Store
Social: Webpage / Facebook / Twitter / Kickstarter
Documentation: https://docs.blynk.io
Community Forum: http://community.blynk.cc
Blynk for Business: http://www.blynk.io
import BlynkLib
# Initialize Blynk
blynk = BlynkLib.Blynk('YourAuthToken')
# Register Virtual Pins
@blynk.VIRTUAL_WRITE(1)
def my_write_handler(value):
print('Current V1 value: {}'.format(value))
@blynk.VIRTUAL_READ(2)
def my_read_handler():
# this widget will show some time in seconds..
blynk.virtual_write(2, int(time.time()))
while True:
blynk.run()- Python 2, Python 3, MicroPython support
Linux,
Windows,
MacOS support
virtual_writesync_virtualset_propertylog_event- events:
Vn,connected,disconnected,invalid_auth TCPand secureTLS/SSLconnection support- can run on embedded hardware, like
ESP8266,ESP32,W600orOpenWrt
pip install blynk-library-pythonFor Blynk.Edgent Dynamic Provisioning, please see examples/Edgent_Linux_RPi
- Get the latest MicroPython firmware and flash it to your board
- Edit ESP8266_ESP32.py example (put your
auth tokenand wifi credentials) - Use
ampyor any other method to transfer files to the deviceNote: LoBo firmware stores files uderexport AMPY_PORT=/dev/ttyUSB0 ampy mkdir /lib ampy put BlynkLib.py /lib/BlynkLib.py ampy put ./examples/hardware/ESP8266_ESP32.py main.py/flashdirectory, useampy mkdir /flash/liband so on - Open device terminal and reboot the board (or type
execfile('main.py')) - For ESP8266, you may need to disable secure connection using:
blynk = BlynkLib.Blynk('YourAuthToken', insecure=True)
- This should work with WiPy 1.0, 2.0, 3.0, LoPy, SiPy, GPy, FiPy
- Instructions are the same as for ESP32, just use PyCom_WiPy.py example
- Arduino
- Particle
- Lua, OpenWrt, NodeMCU
- Node.js, Espruino, Browsers
- OpenWrt packages
- MBED
- Node-RED for Blynk IoT
- LabVIEW
- C#
This project is released under The MIT License (MIT)
