DZone
Thanks for visiting DZone today,
Edit Profile
  • Manage Email Subscriptions
  • How to Post to DZone
  • Article Submission Guidelines
Sign Out View Profile
  • Post an Article
  • Manage My Drafts
Over 2 million developers have joined DZone.
Log In / Join
Refcards Trend Reports
Events Video Library
Refcards
Trend Reports

Events

View Events Video Library

Zones

Culture and Methodologies Agile Career Development Methodologies Team Management
Data Engineering AI/ML Big Data Data Databases IoT
Software Design and Architecture Cloud Architecture Containers Integration Microservices Performance Security
Coding Frameworks Java JavaScript Languages Tools
Testing, Deployment, and Maintenance Deployment DevOps and CI/CD Maintenance Monitoring and Observability Testing, Tools, and Frameworks
Culture and Methodologies
Agile Career Development Methodologies Team Management
Data Engineering
AI/ML Big Data Data Databases IoT
Software Design and Architecture
Cloud Architecture Containers Integration Microservices Performance Security
Coding
Frameworks Java JavaScript Languages Tools
Testing, Deployment, and Maintenance
Deployment DevOps and CI/CD Maintenance Monitoring and Observability Testing, Tools, and Frameworks

Generative AI has transformed nearly every industry. How can you leverage GenAI to improve your productivity and efficiency?

SBOMs are essential to circumventing software supply chain attacks, and they provide visibility into various software components.

Related

  • How to Get Started With the Smart Parking
  • How to Securely Commission Your IoT Device
  • Mobile and IoT Security Strategies in the Cloud
  • Popular APIs for the Internet of Things (IoT) Systems

Trending

  • The Agile Paradox
  • Squid Game: The Clean Code Trials — A Java Developer's Survival Story
  • Docker Model Runner: A Game Changer in Local AI Development (C# Developer Perspective)
  • Scrum Smarter, Not Louder: AI Prompts Every Developer Should Steal
  1. DZone
  2. Data Engineering
  3. Big Data
  4. How to Exploit All Sensors of Your Mobile Phone as an IoT Device

How to Exploit All Sensors of Your Mobile Phone as an IoT Device

How to use your Android phone, Apache Camel, Kibana, and ElasticSearch to use your mobile phone sensors as an IoT device.

By 
Abdellatif Bouchama user avatar
Abdellatif Bouchama
·
Dec. 17, 15 · Tutorial
Likes (16)
Comment
Save
Tweet
Share
21.8K Views

Join the DZone community and get the full member experience.

Join For Free


This post will show you how you can exploit and send all data generated by the sensors of your mobile phone to the Internet of Things service by using Apache Camel, store the data with Elasticsearch and then how to visualize with Kibana.

Lastly, it shows you how to create and use a Rhiot Android application that exploit the following android sensors:

  • Accelerometer
  • Linear Acceleration sensor
  • Gravity sensor
  • Gyroscope
  • Light sensor
  • Orientation sensor
  • Other sensor ….

Here is an overview of the architecture:Image title

How Can We Implement This?

  • Step1: Install Camel Route on JBoss Fuse:Image title

As you can see from the camel route, after we retrieve messages from the HTTP endpoint, we will process it and store them into Elasticsearch, which will be picked up by Kibana and displayed in a Dashboard.

  • Step 2: At the Elasticsearch level, you have to create a new index, with the following mapping: https://github.com/abouchama/Rhiot_SensorDevice/blob/master/ELK/Mapping.json
  • Step 3: At this moment all the data is available in Elasticsearch, and we have just to explore, discover data, and visualize it via Kibana. For that, you have to create some visualizations that will be included in your Dashboards.
  • Step 4: Install and configure the Android app.
    • On your phone, go to Settings > Security. Under Device Administration, enable Unknown sources. Now you can install .apk files from outside of Google Play.
    • Download the Rhiot_SensorDevice.apk from the following URL:https://github.com/abouchama/Rhiot_SensorDevice/blob/master/Rhiot_SensorDevice.apk
    • Click Rhiot_SensorDevice.apk. Click Install

The Rhiot app is now installed on your Android device.

Note: The .apk file is compiled for Android version 5.0.1.

    • Start the Rhiot app.
    • Fill the URL and click on Start button.Image title

Below is an example of the Dashboard generated:

Image title

You can find the project code here:

 https://github.com/abouchama/Rhiot_SensorDevice/

Conclusion

Admittedly, this example is very simple and demonstrates how to turn your mobile phone into a sensor device, connect it to the Internet of Things server (Can be a Rhiot gateway), send data, and receive data. You also learned how to process and visualize device data with Apache Camel and Kibana.

I hope that you find this post useful and good luck with your projects!

IoT Mobile phone mobile app

Opinions expressed by DZone contributors are their own.

Related

  • How to Get Started With the Smart Parking
  • How to Securely Commission Your IoT Device
  • Mobile and IoT Security Strategies in the Cloud
  • Popular APIs for the Internet of Things (IoT) Systems

Partner Resources

×

Comments

The likes didn't load as expected. Please refresh the page and try again.

ABOUT US

  • About DZone
  • Support and feedback
  • Community research
  • Sitemap

ADVERTISE

  • Advertise with DZone

CONTRIBUTE ON DZONE

  • Article Submission Guidelines
  • Become a Contributor
  • Core Program
  • Visit the Writers' Zone

LEGAL

  • Terms of Service
  • Privacy Policy

CONTACT US

  • 3343 Perimeter Hill Drive
  • Suite 100
  • Nashville, TN 37211
  • [email protected]

Let's be friends: