Giter VIP home page Giter VIP logo

blynk_io's Introduction

Contributors Forks Stargazers Issues Build Status MIT License LinkedIn


rust logo

blynk.io@rust

Blynk.io Integration in Rust
Explore the docs »

Rust Crate · Report Bug · Request Feature

Table of Contents
  1. About The Project
  2. Getting Started
  3. Usage
  4. Roadmap
  5. License
  6. Contact
  7. Acknowledgments

About The Project

This library was created with intent to support Rust usage and prototpying on ESP32 boards with help of esp-rs project that enables use of Rust on various SoCs.

The project was mainly based on the official python implementation since there are no extensive docs of the API.

(back to top)

Built With

(back to top)

Getting Started

Make sure you have your rust environment configurated

Installation

  1. Add library to your Cargo.toml

    ...
    [dependencies]
    blynk_io = "0.3.0"
  2. Use the library in you code

    use blynk_io::*;
    ...
    let mut blynk = <Blynk>::new("AUTH_TOKEN".to_string());
    
    fn main() {
        loop {
            blynk.run();
            thread::sleep(Duration::from_millis(50));
        }
    }
  3. Have fun! 😌

(back to top)

Usage

  1. Get an AUTH_TOKEN Key with https://blynk.io app
  2. Install cargo binary crate to be able to test easily on your computer
    $ cargo install blynk_io
  3. Run the provided binary example with provided AUTH_TOKEN
    $ blynk_io --features build-binary AUTH_TOKEN
    (Optional) if you want to run the client in async mode, start the folllowing example
    $ blynk_io --features build-binary,async AUTH_TOKEN
  4. You should see an output similar to the followig one
    2022-02-10T16:24:27.352Z INFO [blynk_io::config] No server name provided, using default (blynk-cloud.com)
    2022-02-10T16:24:27.353Z INFO [blynk_io::config] No server name provided, using default (80)
    Using auth token for G7HDmT7fraqB5A6WOautoTCQ0XvRplCv
    Connecting to blynk-cloud.com:80
    2022-02-10T16:24:27.353Z ERROR [blynk_io] Not connected, trying reconnect
    2022-02-10T16:24:27.419Z INFO [blynk_io] Successfully connected to blynk server
    2022-02-10T16:24:27.419Z INFO [blynk_io] Authenticating device...
    Sent message, awaiting reply...!!
    2022-02-10T16:24:27.449Z DEBUG [blynk_io::client] size (5) vs consumed (5)
    2022-02-10T16:24:27.449Z DEBUG [blynk_io::client] Got response message: Message { mtype: Rsp, id: 1, size: None, status: Some(StatusOk), body: [] }
    2022-02-10T16:24:27.449Z INFO [blynk_io] Access granted
    2022-02-10T16:24:27.449Z INFO [blynk_io] Setting heartbeat
    Sent message, awaiting reply...!!
    2022-02-10T16:24:27.479Z DEBUG [blynk_io::client] size (5) vs consumed (5)
    2022-02-10T16:24:27.479Z DEBUG [blynk_io::client] Got response message: Message { mtype: Rsp, id: 2, size: None, status: Some(StatusOk), body: [] }
    

(back to top)

Roadmap

  • add tests
  • add rustdocs
  • CI integration with GithHub Actions
  • better error generation & handling
  • add async support once it's stable in esp-rs
  • better test coverage
  • ssl implementation

See the open issues for a full list of proposed features (and known issues).

(back to top)

License

Distributed under the MIT License. See LICENSE for more information.

(back to top)

Contact

Bernard Kobos - @bkobos - [email protected]

Project Link: https://github.com/bernii/blynk_io

(back to top)

Acknowledgments

(back to top)

blynk_io's People

Contributors

bernii avatar

Watchers

 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.