Run APK Blynk or Other Android App As HMI on Raspberry Pi

by elecflo in Circuits > Raspberry Pi

2413 Views, 2 Favorites, 0 Comments

Run APK Blynk or Other Android App As HMI on Raspberry Pi

eae04a44b36995cbc3598fd0dc72e556031278a6.jpeg
RASPBERRY_PI_7TD_01.jpg
LD0004825484_2.jpg
R9064665-02.jpg

Hello makers !

This is my first instructable...

This is within the reach of the raspberry novice.

I spent a lot of time finding the right combinations for a good reliability and speed of commissioning. Having found little information to implement this I think it would be interesting to share this with you !

For a personal project with an ESP32 I wanted to use the Blynk application as an HMI control screen. The use of a mobile phone was not ideal, a touch pad gave too many openings of diverted uses with other apps.

So I opted for the use of a raspberry PI 3b + with a touch screen. For this project I used an official 7 "screen.

For information all other android applications can work in the same way.

Supplies

To make this instructable you will need:

  • Rasperry Pi 3 or higher
  • Official or other touch screen (HDMI screen / mouse keyboard also possible)
  • 7 inch screen box
  • Micro SD card 16GB ultraSpeed recommended for raspberry
  • android things setup utility
  • ADB.exe
  • Blynk.APK
  • AutoStart - No root.APK
  • laptop for config

Assemble the Screen With the Raspberry

RASPBERRY_PI_7TD_04.png

I do not dwell on this point because a lot of tutorial already exists on this subject.

An official image tutorial can be found on this Element14 page

--> https://www.element14.com/community/docs/DOC-78156/l/raspberry-pi-7-touchscreen-display

Insert the Micro SD Card Into Your Laptop and Upload Android Things

Capture1.PNG
  1. Download the "android-things-setup-utility" at this link https://partner.android.com/things/console/#/tools
  2. Extract files on your desktop
  3. Launch android-things-setup-utility-windows.exe
  4. What do you want to do?
    1 - Install Android Things and optionally set up Wi-Fi
  5. What hardware are you using?
    1 - Raspberry Pi 3
  6. Do you want to use the default image or a custom image?
    1 - Default image: Used for development purposes. No access to the Android
  7. Wait few minutes for downlaoding
  8. Plug the SD card into your computer. Press [Enter] when ready
  9. Select drive "PHYSICALDRIVE1 (15.8 GB)" and Press [Enter] when ready
  10. Press key [y] and [Enter] for confirm erasing
  11. Wait few minutes for format and flashing
  12. Don't worry if Unmount failed. Remove the card

  13. Close the setup utility.

Insert the Micro SD Card Into the Slot Provided.

sdcard.jpg

Pay attention to the correct direction of the SD card.

Statup Raspberry

2016-09-01-pi-with-power-pack.jpg
android_things_toolkit_home_screen-650x333.jpg
1_qQ_VUo-TOICd8oLHyQoVAw.png

  1. Plug the power and wait for the first display
  2. Select "No thanks" and yes skip setup
  3. Click on "Connect to network" enter your WiFi informartion and connect or plug ethernet wire

Install Apk

Capture2.PNG
  1. Download Adb tools https://developer.android.com/studio/releases/platform-tools Direct link https://dl.google.com/android/repository/platform-tools_r29.0.6-windows.zip
  2. Unzip "platform-tools" folder on your desktop
  3. Find CMD in windows startup and run it
  4. Change Directory with "cd" command. Enter >cd c:\Users\YourPersonnalName\Desktop\platform-tools
  5. Connect to raspberry with adb command. Enter >adb connect 192.168.1.xx (replace with the address displayed on the raspberry)
  6. Download "AutoStart - No root.apk" https://apk.tools/details-autostart-no-root-apk/
  7. Download your App "Blynk.apk" https://apk.gold/download?file_id=1085500/blynk-arduino-esp8266-rpi
  8. Copy two files on your desktop
  9. Install "AutoStart - No root.apk" with adb command. >adb install c:\Users\YourPersonnalName\Desktop\com.autostart_222.apk
  10. Install "Blynk.apk" with adb command. >adb install c:\Users\YourPersonnalName\Desktop\Blynk-2.27.5.apk

  11. Launch app" AutoStart" with adb command. >adb shell am start -n com.autostart/com.autostart.AutoStartActivity

Select Your App for Autostart

screen-0.jpg
  1. Auto startup : select ON
  2. Applications : select ADD for chose your app "Blynk"
  3. Start delay : 0
  4. Next app delay : 3
  5. Show notification at boot-up : Uncheck
  6. Goto home screen after autostart : Uncheck

Test It !

0.png
  1. Return in adb cmd window and enter adb command >adb shell input keyevent 3
  2. Reboot your display with adb command > adb reboot

Wait reboot and wait for autostartup your app "Blynk" after few second.

If you followed and carried out with success or difficulty this tutorial do not hesitate to leave a productive comment to thank or improve it.

Thanks for reading, Florent to elecflo belgium