Giter Site home page Giter Site logo

jfperusse / blynk-library-python Goto Github PK

View Code? Open in Web Editor NEW

This project forked from vshymanskyy/blynk-library-python

0.0 0.0 0.0 87 KB

Blynk library for Python. Works with Python 2, Python 3, MicroPython.

Home Page: https://blynk.io/

License: MIT License

Python 100.00%

blynk-library-python's Introduction

Python client for Blynk IoT

Note: The library has been updated for Blynk 2.0.
Please remain on v0.2.0 for legacy Blynk.

GitHub version GitHub download GitHub stars GitHub issues License

If you like Blynk - give it a star, or fork it and contribute! GitHub stars GitHub forks


What is Blynk?

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 Banner

Download

Blynk Mobile App: Google Play | App Store

Documentation

Social: Webpage / Facebook / Twitter / Kickstarter
Documentation: https://docs.blynk.io
Community Forum: http://community.blynk.cc
Blynk for Business: http://www.blynk.io

Usage example

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()

Features

  • Python 2, Python 3, MicroPython support
  • Linux, Windows, MacOS support
  • virtual_write
  • sync_virtual
  • set_property
  • log_event
  • events: Vn, connected, disconnected, invalid_auth
  • TCP and secure TLS/SSL connection support
  • can run on embedded hardware, like ESP8266, ESP32, W600 or OpenWrt

Ubuntu/Linux/Raspberry Pi installation

pip install blynk-library-python

For Blynk.Edgent Dynamic Provisioning, please see examples/Edgent_Linux_RPi

ESP32/ESP8266 installation

  • Get the latest MicroPython firmware and flash it to your board
  • Edit ESP8266_ESP32.py example (put your auth token and wifi credentials)
  • Use ampy or any other method to transfer files to the device
    export AMPY_PORT=/dev/ttyUSB0
    ampy mkdir /lib
    ampy put BlynkLib.py /lib/BlynkLib.py
    ampy put ./examples/hardware/ESP8266_ESP32.py main.py
    Note: LoBo firmware stores files uder /flash directory, use ampy mkdir /flash/lib and 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)

PyCom installation

  • 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

Implementations for other platforms

License

This project is released under The MIT License (MIT)

blynk-library-python's People

Contributors

bradenm avatar jfperusse avatar jsikorsky avatar vshymanskyy avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.