6 releases (3 breaking)
0.3.0 | Apr 11, 2022 |
---|---|
0.2.0 | Feb 24, 2022 |
0.1.2 | Feb 14, 2022 |
0.0.1 | Feb 10, 2022 |
#1325 in Embedded development
24 downloads per month
65KB
1.5K
SLoC
blynk.io@rust
Blynk.io Integration in Rust
Explore the docs »
Rust Crate
·
Report Bug
·
Request Feature
Table of Contents
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.
Built With
Getting Started
Make sure you have your rust
environment configurated
Installation
-
Add library to your
Cargo.toml
... [dependencies] blynk_io = "0.3.0"
-
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)); } }
-
Have fun! 😌
Usage
- Get an AUTH_TOKEN Key with https://blynk.io app
- Install cargo binary crate to be able to test easily on your computer
$ cargo install blynk_io
- Run the provided binary example with provided
AUTH_TOKEN
(Optional) if you want to run the client in async mode, start the folllowing example$ blynk_io --features build-binary AUTH_TOKEN
$ blynk_io --features build-binary,async AUTH_TOKEN
- 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: [] }
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).
License
Distributed under the MIT License. See LICENSE
for more information.
Contact
Bernard Kobos - @bkobos - bkobos@gmail.com
Project Link: https://github.com/bernii/blynk_io
Acknowledgments
- great Ivan Markov work and help
- extremely helpful esp-rs community
- Ivan's demo which is a great starting point
- ESP-RS book
- Blynk Python Library
Dependencies
~3–16MB
~177K SLoC