วันจันทร์ที่ 13 มีนาคม พ.ศ. 2560

Machine Learning Tensorflow Android App Demo


Machine Learning TensorFlow Android App Demo

What is TensorFlow?
TensorFlow is open source machine learning library from Google. Computation code is written in C++, but programmers can write their TensorFlow software in either C++ or Python and implemented for CPUs ,GPUs or both.


In November 2015, Google announced and open sourced TensorFlow, its latest and greatest machine learning library. This is a big deal for three reasons:
  1. Machine Learning expertise: Google is a dominant force in machine learning. Its prominence in search owes a lot to the strides it achieved in machine learning.
  2. Scalable : the announcement noted that TensorFlow was initially designed for internal use and that it’s already in production for some live product features.
  3. Ability to run on Mobile.
This last reason is the operating reason for this post since we’ll be focusing on Android. If you examine the tensorflow repo on GitHub, you’ll find a little tensorflow/examples/android directory. I’ll try to shed some light on the Android TensorFlow example and some of the things going on under the hood.



Install TensorFlow on your System ( PC or Notebook , Windows or mac )

It has many method to install

  • virtualenv
  • pip
  • Docker
  • installing from sources

We use pip method first.



Installing with native pip


Python
In order to install TensorFlow, your system must contain one of the following Python versions:

  • Python 2.7
  • Python 3.3+

Pip installs and manages software packages written in Python. If you intend to install with native pip, then one of the following flavors of pip must be installed on your system:
  • pip, for Python 2.7
  • pip3, for Python 3.n.
pip or pip3 was probably installed on your system when you installed Python. To determine whether pip or pip3 is actually installed on your system, issue one of the following commands:
$ pip -V  # for Python 2.7
$ pip3 -V # for Python 3.n 

We strongly recommend pip or pip3 version 8.1 or higher in order to install TensorFlow. If pip or pip3 8.1 or later is not installed, issue the following commands to install or upgrade:
$ sudo easy_install --upgrade pip
$ sudo easy_install --upgrade six 

Install Bazel
https://bazel.build/versions/master/docs/install.html

Building the Demo from Source

git clone --recurse-submodules https://github.com/tensorflow/tensorflow.git


Build the Android APK 
$ cd ~/tensorflow
$ bazel build //tensorflow/examples/android:tensorflow_demo

Install the APK to Android devices
$ adb install -r -g bazel-bin/tensorflow/examples/android/tensorflow_demo.apk

Reference



วันอาทิตย์ที่ 8 มกราคม พ.ศ. 2560

Android Gauge View Example Code


Android Gauge View Example Code

We have  test 3 example source code.
1.GaugeView
2.CustomGauge
3.SC-widgets


 

GaugeView


An Android library for drawing gauges on Canvas.
https://github.com/CodeAndMagic/GaugeView


 

CustomGauge



update some code in build.gradle

buildscript {
    repositories {
        jcenter()
    }
    dependencies {
        classpath 'com.android.tools.build:gradle:2.2.3'        classpath 'com.jfrog.bintray.gradle:gradle-bintray-plugin:1.4'        classpath 'com.github.dcendents:android-maven-gradle-plugin:1.4.1'

        // NOTE: Do not place your application dependencies here; they belong        // in the individual module build.gradle files    }
}


SC-widgets


This is a library of widgets.
The 2.x version change completely the way to draw using the ScDrawer as base for create the ScGauge and all classes inherited from it. This using a path to follow and applying some features to draw extra on the path. This way to think leaves a lot of freedom to the users to create particular components limited only by his imagination.
https://github.com/Paroca72/sc-widgets


My Website
email : info@softpowergroup.net   Tel .081-6452400

วันพฤหัสบดีที่ 15 ธันวาคม พ.ศ. 2559

Android Things with Raspberry Pi Board


Android Things with Raspberry Pi Board

What is Android Things?

On 13 December 2016,
Google launched a version of Android called Android Things.
Android Things (formerly known as Brillo)

Android Things are IoT Platform for Android Developer.Use Development tools and ecosystem the same Android App Development. So you can use Android Studio to develop Android Things.
and without previous knowledge of embedded system design.


Understand the Android Things Platform
Android Things has a few key differences compared to the core Android OS, read the Overview to understand key concepts that you'll need to understand.



Hardware Supported

Intel Edison
NXP Pico
Raspberry Pi 3

Software

Android Things SDK Preview!  https://developer.android.com/things/preview/index.html

Google has released the SDK preview of Android Things.
You can learn more about that (and key Android Things concepts)
Unfortunately,
we’re not entirely sure when the full version will go live just yet.

Getting Started with Android Things


Make your IoT Hardware

Download Flash image Android Things.
For Raspberry Pi image

Then copy image to SD card
use SDCardFormatter tools or other tools ( Raspberry Pi Tools )


Connect the Hardware
How to connect to your Development Board. ( we use raspberry pi 3 board )
We use Ethernet or LAN cable first. ( If you want to use WiFi, it's more complicate than Ethernet )

Raspberry Pi wiring diagram






Set Up Your Development Environment

Download Android Studio ( if you don't have yet )
and if Android Studio is old version then update to new.

( SDK tools version 24 or higher )

Connect your board and verify you can access the device via adb command

use Ethernet or LAN Cable First.

$ adb connect <ip-address>:5555
connected to <ip-address>:5555

Open Android Studio

Open Sample Code Download Example Code

Then Run Code

see on VDO



My Website
email : info@softpowergroup.net   Tel .081-6452400

วันพุธที่ 7 ธันวาคม พ.ศ. 2559

Android IoT MQTT Client for Test MQTT Broker



Android IoT MQTT Client for Test MQTT Broker


What is MQTT?

MQTT (aka MQ Telemetry Transport) is a machine-to-machine or “Internet of Things” connectivity protocol on top of TCP/IP. It allows extremely lightweight publish/subscribe messaging transport.


Broker , Publisher , Subscriber




Android App on Google Play




How to Use

Setting Broker First

Example for CloudMQTT.com


Then setting



Then Test Subscribe and publish meassage



My Website
email : info@softpowergroup.net   Tel .081-6452400





วันอาทิตย์ที่ 13 พฤศจิกายน พ.ศ. 2559

RGBLED IoT ESP8266 with NetPie


RGBLED IoT ESP8266 with NetPie 



This Project you can control RGBLED Lights on the internet we call Internet of Things ( IoT ).

What is NETPIE ?

NETPIE platform is a cloud-based platform-as-a-service that facilitates interconnecting IoT devices (“things”) together in a most seamless and transparent manner possible by pushing the complexity of connecting IoT devices from the hands of application developers or device manufacturers to the cloud.
https://netpie.io/


System Diagram


Hardware


1.ESP8266 WiFi Module ( or NodeMCU )

2.RGB LED ( common anode (A) ) if you to use common cathode ( K ) must edit some code.

3.OLED Display ( Option )




Wiring Diagram



Software


Your need to sign-in NETPIE account. https://netpie.io/sign_up

ESP8266 Source code 
https://github.com/amphancm/ESP8266RGBLED_IOT_NETPIE

Need some edit your network and NETPIE ID and KEY




APP Setting with NETPIE

You need to sign up NETPIE First. ==>  https://netpie.io/sign_up


Setting your APP ID and your KEY ( REST API auth )


Save and restart your App


Android Library use in this app.

This app makes use of the ColorPicker view from Piotr Adamushttps://github.com/chiralcode/Android-Color-Picker

compile 'com.squareup.retrofit:retrofit:1.9.0'compile 'com.jakewharton:butterknife:6.1.0'compile 'com.squareup.picasso:picasso:2.5.2'compile 'de.keyboardsurfer.android.widget:crouton:1.8.5'compile 'org.parceler:parceler:0.2.16'compile 'com.crittercism:crittercism-android-agent:+'





My Website
email : info@softpowergroup.net   Tel .081-6452400

วันอาทิตย์ที่ 30 ตุลาคม พ.ศ. 2559

ESP8266 WiFi Control RGBLED with Android



ESP8266 WiFi control RGBLED with Android
This project we use ESP8266 WiFi Module to control RGB LED via WiFi Network with Android device.
Control in Local WiFi Network only. see diagram.

System Diagram


Hardware


1.ESP8266 WiFi Module ( or NodeMCU )

2.RGB LED ( common anode (A) ) if you to use common cathode ( K ) must edit some code.

3.OLED Display ( Option )



more info about Hardware and ESP8266 Source code


Wiring Diagram

 OLED for Option use I2C port.


Android App on Google Play 




App Manual


Set your ESP8266 device IP Address

Attribution:*
This app makes use of the ColorPicker view from Piotr Adamus* https://github.com/chiralcode/Android-Color-Picker


My Website
email : info@softpowergroup.net   Tel .081-6452400

วันพฤหัสบดีที่ 12 พฤษภาคม พ.ศ. 2559

ESP8266 IoT ThingSpeak Control Relay


ESP8266 IoT ThingSpeak Control Relay

ESP8266 WiFi Module and Android devices make Internet of Things Application to control devices ( Relay ) with ThingSpeak.com.

This project upgrade for this one.

System Diagram

Hardware
1.ESP8266 WiFi Module ( or NodeMCU )
2.Two Channel Relay Board. ( Active High )
3.OLED Display (Option )

Wiring Diagram

ESP8266 Pin GPIO_13 to Relay 1
ESP8266 Pin GPIO_15 to Relay 2

Option OLED Display
 ESP8266 Pin GPIO_05  ( SCL )  to  OLED pin SCL
 ESP8266 Pin GPIO_04  ( SDA )  to  OLED pin SDA






Android App on Google Play





App Manual

Open App


Two Channel Control


You must register ThingSpeak.com for your own Channel ID and Key.
In this App we set Channel ID and Key for Test only.

Sign up to start using ThingSpeak
https://thingspeak.com/users/sign_up






My Website
email : info@softpowergroup.net   Tel .081-6452400