Building Your Android Apps for monitoring IoT devices using REST API

Instructables: Featured content!

http://www.instructables.com/id/Building-Your-Android-Apps-for-Monitoring-IoT-Devi/

 

A few weeks ago, I’ve implemented REST web service library for WIZwiki-W7500ECO board. I’ve posted on Instructables,http://www.instructables.com/id/Adding-REST-based-Web-Services-to-IoT-Device-for-I/ (Featured content!)

wizwiki-w7500eco3dtop_edit

I decided to create my own Apps for monitoring my board using REST APIs. My Apps created using ‘MIT App Inventor 2’. You can find my apps at App inventor gallery. (WIZwiki RESTAPI I/O Monitor)

wizwiki_restapi_app_inventor_gallery

Users can create a variety of application by reference to this app. you can freely modify and build your own Apps(.apk file). For more details about ‘MIT App Inventor’, refer to the following link. http://appinventor.mit.edu/

logo_app_inventor

For more information about ‘REST API for WIZwiki-W7500ECO’, please see the previous post and GitHub repository.

Step 1: Apps Features

  • Example Apps for testing REST APIs for WIZwiki-W7500ECO platform
  • Can be monitored 4-configurable I/Os on board (ain / din / dout)
  • Each Pins assumed to be connected as follows
    • User IO A (P30): This pin is connected to the temperature sensor (analog input, Grove temp. sensor v1.1)
    • User IO B (P29): This pin is connected to the temperature potentiometer (analog input)
    • User IO C (P28): This pin is connected to the Push button1 (digital input)
    • User IO D (P27): This pin is connected to the Push button2 (digital input)
  • Can be monitored network settings and uptime of board
  • Free to use

* This post will be update continuously

Step 2: Parts

For this project, you’ll need next things.

  • Android Mobile Phone or Tablet
    • App Inventor is a visual, blocks language for building Android Apps
  • WIZnet WIZwiki-W7500ECO Platform board
    • WIZwiki-W7500ECO is a compact platform board based on W7500, which is a SOC chip that integrates an ARM Cortex-M0, 128KB Flash memory and hardwired TCP/IP core. W7500 is the best fit to IoT devices. For more details, refer to the next link: http://wizwiki.net/wiki/doku.php?id=products:wizw…
  • Seeedstudio Grove Starter Kit
    • It contains Plug-n-play hardware modules e.g., temp senser and buttons. For more details, refer to the next link:http://www.seeedstudio.com/wiki/Grove_System
    • Grove Shield Grove – Temperature Sensor v1.1
    • Grove – Potentiometer
    • Grove – Button (x 2)
    • Grove – Universal 4 Pin Cable (x 4)
  • A computer for using KEIL uVision5 IDE / App inventor web IDE
    • REST web service library is developed and compiled with uVision5 IDE.
  • Jumper wires (x 6)

Step 3: Hardware Circuits

Hardware

wizwiki-w7500eco_pinout

  • [WIZwiki-W7500ECO] and [Grove Shield] is connected via jumper wires.
  • [Grove Shield] and [Grove Peripheral] is connected via grove universal 4 pin cables.
WIZwiki-W7500ECO Grove Shield Grove Peripheral
3.3V 3.3V
GND GND
P30 Analog0 (A0) Temperature Sensor
P29 Analog1 (A1) Potentiometer
P28 Digital2 (D2) Button1
P27 Digital3 (D3) Button2

Step 4: Firmware

WIZwiki-W7500ECO board and Android mobile phone are must be obtain an IP address automatically from same router (DHCP server) for network communication. e.g.,

Router IP: 192.168.11.1 (gateway, DHCP server)

WIZwiki-W7500ECO IP: 192.168.11.2

  • Obtain an IP address automatically, Ethernet connected

Android Mobile phone IP: 192.168.11.4

  • Obtain an IP address automatically, Wi-Fi connected

How to enable IP obtained from DHCP server (automatically)

  1. Delete the comment mark (//, two slashes) at preprocessor directives ‘#define _USE_DHCP_‘ (in main.c file)
  2. Delete the comment mark at call set_dhcp_mode() function line in main()functionn (in main.c file)
  3. Commented out set_static_mode() function line in main() function (in main.c file)
  4. (bugfix: main.c file) Line 321, #ifdef _USE_DHCP -> #ifdef _USE_DHCP_(‘_’ is missing)

Step 5: Apps Design1_apps_screen_arch

Screens

  • Main Screen

2_apps_screen_main

  • Temperature Screen

3_apps_screen_temperature

  • Potentiometer Screen

4_apps_screen_potentiometer

  • Buttons Screen

5_apps_screen_buttons

  • Settings Screen

6_apps_screen_settings

Step 6: Firmware Download, Build and Run

Download the RESTful Web Server & I/O Control by REST API Project on GitHub repository

Build and Firmware write to target board: WIZwiki-W7500ECO

  1. Project Build
  2. Firmware Write
    • Writing firmware into WIZwiki-W7500ECO has three ways
      1. Using the CMSIS-DAP (Drag and Drop)
      2. Using the CMSIS-DAP (through Keil uVision5)
      3. Using the ISP (ISP, In-System Programming)
      4. For more details, Please refer to WIZnet wiki site; How to write the firmware into WIZwiki-W7500ECO

Step 7: Apps Build and Run

Build the App Inventor Apps 

  • Build and Create .apk file at Web IDE
  • Select the ‘Build’ menu on top of browser

app_inventor_webide_build

Step 8: Enjoy it!

Try to create the Android apps for your own IoT devices!

Advertisements

답글 남기기

아래 항목을 채우거나 오른쪽 아이콘 중 하나를 클릭하여 로그 인 하세요:

WordPress.com 로고

WordPress.com의 계정을 사용하여 댓글을 남깁니다. 로그아웃 / 변경 )

Twitter 사진

Twitter의 계정을 사용하여 댓글을 남깁니다. 로그아웃 / 변경 )

Facebook 사진

Facebook의 계정을 사용하여 댓글을 남깁니다. 로그아웃 / 변경 )

Google+ photo

Google+의 계정을 사용하여 댓글을 남깁니다. 로그아웃 / 변경 )

%s에 연결하는 중