https://github.com/vshymanskyy/blynk-library-openwrt
OpenWRT packages for Blynk C++ library
https://github.com/vshymanskyy/blynk-library-openwrt
framework iot openwrt openwrt-feed openwrt-package platform smartphone smartphone-interaction
Last synced: about 1 year ago
JSON representation
OpenWRT packages for Blynk C++ library
- Host: GitHub
- URL: https://github.com/vshymanskyy/blynk-library-openwrt
- Owner: vshymanskyy
- License: mit
- Created: 2016-10-23T17:26:23.000Z (over 9 years ago)
- Default Branch: master
- Last Pushed: 2018-04-02T20:03:00.000Z (almost 8 years ago)
- Last Synced: 2025-03-15T06:51:58.971Z (about 1 year ago)
- Topics: framework, iot, openwrt, openwrt-feed, openwrt-package, platform, smartphone, smartphone-interaction
- Language: Makefile
- Size: 12.7 KB
- Stars: 18
- Watchers: 6
- Forks: 4
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Blynk OpenWRT package
Build from source:
```bash
echo "src-git blynk git://github.com/vshymanskyy/blynk-library-openwrt.git" >> ./feeds.conf
./scripts/feeds update -a
./scripts/feeds install -p blynk -a
make menuconfig
```
### Node.js client
You need [nxhack openwrt-node](https://github.com/nxhack/openwrt-node-packages) for this.
Select in menuconfig: ```Languages -> Node.js -> node-blynk-library```
**Node.js** example:
```js
const Blynk = require('blynk-library');
// Initialize Blynk
let AUTH = 'YourAuthToken';
let blynk = new Blynk.Blynk(AUTH);
let v1 = new blynk.VirtualPin(1);
// Register virtual pin handler
v1.on('write', function(param) {
console.log('Got a value:', param);
});
```
### Python 2.7 client
Select in menuconfig: ```Languages -> Python -> python-blynk-library```
**Python** example:
```python
import BlynkLib
# Initialize Blynk
AUTH = 'YourAuthToken'
blynk = BlynkLib.Blynk(AUTH)
# Register virtual pin handler
@blynk.VIRTUAL_WRITE(1)
def v1_write_handler(value):
print('Got a value: {}'.format(value))
# Start Blynk (this call should never return)
blynk.run()
```
### C++ client
Select in menuconfig: ```Network -> Blynk -> blynk```
**C++** example:
```cpp
#include
static BlynkTransportSocket blynkTransport;
BlynkSocket Blynk(blynkTransport);
const char* AUTH = "YourAuthToken";
BLYNK_WRITE(V1) {
printf("Got a value: %s\n", param[0].asStr());
}
int main(int argc, char* argv[]) {
Blynk.begin(AUTH);
while (true) {
Blynk.run();
}
return 0;
}
```
## Build OpenWRT image:
```bash
make -j 5
```
## Build just Blynk:
```
make package/blynk/compile V=s
make package/node-blynk-library/compile V=s
make package/python-blynk-library/compile V=s
```
For a rebuild:
```
make package/blynk/{clean,compile,install} V=s
```