Control lattepanda with your smart smartphone

A place to showcase LattePanda creations!
Post Reply
User avatar
Kellman616
Posts: 42
Joined: Fri Feb 24, 2017 7:11 am

Fri Feb 24, 2017 8:19 am

Controlling Lattepanda with Blynk!

Image

Here I am taking the advantage of the Blynk app and Lattepanda to build a simple but cool IOT control unit.

In this article, I will show you how to light up the LED remotely with Lattepanda. You can use your mobile phone to control your LED remotely if the network of your cell phone and lattepanda is in good condition. Then you can broaden your mind and create a lot of awesome stuff with the combination of Blynk and Lattepanda.

Blynk was designed for the Internet of Things. It can control hardware remotely, it can display sensor data, it can store data, vizualize it and do many other cool things.We use it to demonstrate how to setup a simple connected IOT control hub.

System Environments

Hardware list:

- Lattepanda
- 7-inch 1024x600 IPS Display for LattePanda
- Mouse
- Keyboard

Hardware setup

Connect with 7-inch 1024x600 IPS Display,mouse and keyboard

1.Lift up the actuator. Use thumb or index finger might be easier.

2.Insert display FPC in.

Place Golden Finger side down!

3.Rotate down the actuator until firmly closed.

Image

Connect to Wi-Fi

1.Install the Wi-Fi antenna by plugging the round shaped end into the socket labelled “ANT” located next to the GPIO pins on the board.

Image

2.In Windows select a Wi-Fi connection by clicking the Wi-Fi icon in the system tray at the bottom right of the screen. Follow the wizard to setup a connection.

Power on your LattePanda

1.When plugged in, you should see the red LED indicator lights up on the underside of the board. Wait patiently for a few seconds until the LED goes out.

2.When the LED turns off, press and hold the power button for one second to turn the LattePanda on.

Now, the computer is running!

Image

Software setup

Install Arduino Software (IDE)

I recommend you use the latest version of the Arduino IDE.

Mine is ARDUINO 1.8.1.

Install Blynk app and BLYNK LIBRARY

Please follow the official documentation from Blynk.

Build your app on your smartphone

1. Open Blynk App and create new project. 

2. Choose the hardware and communication type you are going to use.

Image

3. Add Button widget. You can hold and drag it to reposition. Tap once to get to Widget Settings.

4. In Widget Settings set the PIN you want to control. (My LED is connected to pin 9)

Image

5. Check your e-mail. You will find your Auth Token in the letter.You will use it when in your code.

Image

Upload the program

You can open the example sketch or copy the following code.

Image

#include <SoftwareSerial.h>
SoftwareSerial DebugSerial(2, 3);
#define BLYNK_PRINT DebugSerial
#include <BlynkSimpleStream.h>
char auth[] = "YourAuthToken";//Put your Auth Token here
void setup()
{
DebugSerial.begin(9600);
Blynk.begin(Serial, auth);
}
void loop()
{
Blynk.run();
}



Note: If your Arduino Software (IDE) is in lower version, the following problem may occur when you using the library: 'Blynk' was not declared in this scope.

So I recommend you use the latest version of the Arduino IDE.

Run cmd.exe

Press windows+x→run→enter cmd to open cmd.exe

Image

Copy the location of scripts which is usually located in Program Files\Arduino\libraries\Blynk\scripts folder, type cd space and then paste the location of scripts so that it will look like this.

Image

Press enter. Type blynk-ser.bat -c COM5(where COM5 is port with your Arduino) then hit enter two times so that it will look like this.

Image

Test

Press PLAY  in the Blynk App. Showtime!

Image

Control the LED with the button! Hello IOT world ! !

How It Works

According to Blynk documentation, every time you press a Button in the Blynk app, the message travels to space the Blynk Cloud, where it magically finds its way to your hardware. It works the same in the opposite direction and everything happens in a blynk of an eye.

Image

I really wish you had fun using Blynk and Lattepanda. It is a great way to communicate with the board, and Blynk surely is a fast way to build IOT control layer. All you need is let your smartphone and lattepanda in good network condition.

User avatar
LattePanda
Site Admin
Posts: 2467
Joined: Wed Jan 20, 2016 9:09 am

Fri Mar 03, 2017 10:26 am

awesome!
Enjoy Tinkering with LattePanda ! :lol:

User avatar
JamarSoync
Posts: 14
Joined: Mon Sep 11, 2017 6:10 pm

Fri Sep 15, 2017 12:22 pm

You have a nice view there. I am really amazed with what I am seeing on your photo. Driving is nice but looking at the view while driving is really fantastic.

User avatar
Kellman616
Posts: 42
Joined: Fri Feb 24, 2017 7:11 am

Wed Sep 27, 2017 2:15 am

JamarSoync wrote:
Fri Sep 15, 2017 12:22 pm
You have a nice view there. I am really amazed with what I am seeing on your photo. Driving is nice but looking at the view while driving is really fantastic.
;) Thanks~

User avatar
GTC
Posts: 32
Joined: Fri Sep 22, 2017 7:26 pm

Thu Sep 28, 2017 10:32 pm

That is some pretty cool dev.

I'd drool at the idea of having this same but safe & secured running barebone DNS > IIS > C# > Arduino. I believe you've already demonstrated how easy it was to manipulate the co-processor over COM port in another tut. Just missing a web interface? That'd be brilliant and possibly 2x faster, who knows.

Keep up sharing, I like your posts

User avatar
ED209
Posts: 222
Joined: Tue Apr 19, 2016 3:31 pm

Fri Sep 29, 2017 5:03 am

GTC wrote:
Thu Sep 28, 2017 10:32 pm
That is some pretty cool dev.

I'd drool at the idea of having this same but safe & secured running barebone DNS > IIS > C# > Arduino. I believe you've already demonstrated how easy it was to manipulate the co-processor over COM port in another tut. Just missing a web interface? That'd be brilliant and possibly 2x faster, who knows.

Keep up sharing, I like your posts
Oh. Would you please introduce a right direction for me to build this prototype via the web interface?

User avatar
GTC
Posts: 32
Joined: Fri Sep 22, 2017 7:26 pm

Fri Sep 29, 2017 6:34 pm

ED209 wrote:
Fri Sep 29, 2017 5:03 am
Oh. Would you please introduce a right direction for me to build this prototype via the web interface?
Not the easiest question ever my friend, I personally wouldn't know where to begin with this these days. Try searching for keywords "IoT web server" and "DynDNS" (Managed dns; for device discoveries) and that should give you plenty of ideas to get things rolling.

Recommend IIS as this is the easiest possible solution that plugs right in VS2017 (I think?). Also easy to implement onto Win10

Post Reply