Difference between revisions of "EBC Exercise 35 Blynk"

From eLinux.org
Jump to: navigation, search
m (Installing Blynk: Fixed npm)
m (Installing Blynk: Added python)
Line 4: Line 4:
 
[https://www.blynk.cc Blynk] is a simple way to control your BeagleBone from a device such as a cellphone.
 
[https://www.blynk.cc Blynk] is a simple way to control your BeagleBone from a device such as a cellphone.
  
== Installing Blynk ==
+
== Installing Blynk - python ==
 
To install Blynk, got to [https://www.blynk.cc/getting-started/ Getting Started with Blynk] and follow the first
 
To install Blynk, got to [https://www.blynk.cc/getting-started/ Getting Started with Blynk] and follow the first
 
two instructions for installing Blynk on your device and getting the Auth token.
 
two instructions for installing Blynk on your device and getting the Auth token.
  
 
Then on your Bone
 
Then on your Bone
  bone$ '''sudo npm install -g --unsafe-perm onoff blynk-library'''
+
  bone$ '''sudo pip3 install blynklib'''
 
 
(If that doesn't work try: <code>sudo npm install onoff blynk-library</code>)
 
 
 
'''npm''' is a JavaScript package manager.  Once loaded you can run the Blynk example.
 
 
  bone$ '''cd exercises/iot/blynk'''
 
  bone$ '''cd exercises/iot/blynk'''
  bone$ '''./leds.js'''
+
  bone$ '''./leds.py'''
  
 
=== Set up the Project ===
 
=== Set up the Project ===
Line 37: Line 33:
  
 
Now when you click a button attached to P9_25, the virtual LED should toggle.
 
Now when you click a button attached to P9_25, the virtual LED should toggle.
 +
 +
== Installing Blynk - JavaScript ==
 +
To install Blynk, got to [https://www.blynk.cc/getting-started/ Getting Started with Blynk] and follow the first
 +
two instructions for installing Blynk on your device and getting the Auth token.
 +
 +
Then on your Bone
 +
bone$ '''sudo npm install -g --unsafe-perm onoff blynk-library'''
 +
 +
(If that doesn't work try: <code>sudo npm install onoff blynk-library</code>)
 +
 +
'''npm''' is a JavaScript package manager.  Once loaded you can run the Blynk example.
 +
bone$ '''cd exercises/iot/blynk'''
 +
bone$ '''./leds.js'''
  
 
{{YoderFoot}}
 
{{YoderFoot}}

Revision as of 05:43, 14 October 2020

thumb‎ Embedded Linux Class by Mark A. Yoder


Blynk is a simple way to control your BeagleBone from a device such as a cellphone.

Installing Blynk - python

To install Blynk, got to Getting Started with Blynk and follow the first two instructions for installing Blynk on your device and getting the Auth token.

Then on your Bone

bone$ sudo pip3 install blynklib
bone$ cd exercises/iot/blynk
bone$ ./leds.py

Set up the Project

Now you need to build a project to talk to your Bone. Go to Getting Started With The Blynk App and follow the steps.

On step 3 (Choose Your Hardware) select Generic Board.

On Step 5 (Add a Widget) make your button attach to Virtual 0.

Run the project and when you tap the virtual button on your device, the USR3 LED should respond.

Add a Virtual LED

Add a virtual LED by doing the following.

  1. Stop your project by tapping the square in the upper right.
  2. Get a new Widget by tapping the + in the upper right.
  3. Scroll down to DISPLAYS and selecting LED.
  4. Tap the LED and connect it to Virtual pin V10.
  5. Hit the back arrow on the upper left.
  6. Hit the play triangle on the upper right.

Now when you click a button attached to P9_25, the virtual LED should toggle.

Installing Blynk - JavaScript

To install Blynk, got to Getting Started with Blynk and follow the first two instructions for installing Blynk on your device and getting the Auth token.

Then on your Bone

bone$ sudo npm install -g --unsafe-perm onoff blynk-library

(If that doesn't work try: sudo npm install onoff blynk-library)

npm is a JavaScript package manager. Once loaded you can run the Blynk example.

bone$ cd exercises/iot/blynk
bone$ ./leds.js




thumb‎ Embedded Linux Class by Mark A. Yoder