Difference between revisions of "EBC Exercise 35 Blynk"

From eLinux.org
Jump to: navigation, search
m (Installing Blynk - python)
m (Out of date)
 
(5 intermediate revisions by the same user not shown)
Line 1: Line 1:
 
[[Category:ECE497]]
 
[[Category:ECE497]]
 
{{YoderHead}}
 
{{YoderHead}}
 +
 +
= This is out of date.  See the Blynk site =
  
 
[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.
Line 8: Line 10:
 
  bone$ '''sudo pip3 install blynklib'''
 
  bone$ '''sudo pip3 install blynklib'''
 
  bone$ '''cd exercises/iot/blynk'''
 
  bone$ '''cd exercises/iot/blynk'''
bone$ '''./leds.py'''
 
  
 
=== Set up the Project ===
 
=== Set up the Project ===
Now you need to build a project to talk to your Bone.  Go to [http://docs.blynk.cc/#getting-started-getting-started-with-the-blynk-app Getting Started With The Blynk App] and follow the steps.
+
Now you need to build a project to talk to your Bone.   
  
On step 3 (Choose Your Hardware) select '''Generic Board'''.
+
Go to [http://docs.blynk.cc/#getting-started-getting-started-with-the-blynk-app Getting Started With The Blynk App]
 
+
and follow the steps there, with these additional instructions:
On Step 5 (Add a Widget) make your button attach to '''Virtual 0'''.
+
* 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.
+
* Edit '''setup.sh''' to have your AUTH key.
 +
bone$ '''./leds.py'''
 +
* Run the project on your phone and when you tap the virtual button on your device, the '''USR3''' LED should respond.
 +
Note: I was running ssh on a port other than 22 and Blynk didn't work.  Switching back to port 22 fixed it.
  
 
=== Add a Virtual LED ===
 
=== Add a Virtual LED ===
Line 23: Line 27:
 
Add a virtual LED by doing the following.
 
Add a virtual LED by doing the following.
 
# Stop your project by tapping the square in the upper right.
 
# Stop your project by tapping the square in the upper right.
# Get a new Widget by tapping the '''+''' in the upper right.
+
# Get a new Widget by swiping from right to left.
 
# Scroll down to ''DISPLAYS'' and selecting '''LED'''.
 
# Scroll down to ''DISPLAYS'' and selecting '''LED'''.
 
# Tap the LED and connect it to Virtual pin '''V10'''.
 
# Tap the LED and connect it to Virtual pin '''V10'''.
# Hit the back arrow on the upper left.
+
# Tap '''OK''' on the upper right.
 
# Hit the play triangle on the upper right.
 
# Hit the play triangle on the upper right.
  
Now when you click a button attached to P9_25, the virtual LED should toggle.
+
Now when you click a button attached to P9_11, the virtual LED should toggle.
  
 
== Installing Blynk - JavaScript ==
 
== Installing Blynk - JavaScript ==

Latest revision as of 11:46, 17 January 2023

thumb‎ Embedded Linux Class by Mark A. Yoder


This is out of date. See the Blynk site

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

Installing Blynk - python

On your Bone

bone$ sudo pip3 install blynklib
bone$ cd exercises/iot/blynk

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 there, with these additional instructions:

  • On step 3 (Choose Your Hardware) select Generic Board.
  • On Step 5 (Add a Widget) make your button attach to Virtual 0.
  • Edit setup.sh to have your AUTH key.
bone$ ./leds.py
  • Run the project on your phone and when you tap the virtual button on your device, the USR3 LED should respond.

Note: I was running ssh on a port other than 22 and Blynk didn't work. Switching back to port 22 fixed it.

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 swiping from right to left.
  3. Scroll down to DISPLAYS and selecting LED.
  4. Tap the LED and connect it to Virtual pin V10.
  5. Tap OK on the upper right.
  6. Hit the play triangle on the upper right.

Now when you click a button attached to P9_11, 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