How to transmit Android real-time sensor data to computer?

23,502

Solution 1

Some Android apps allow you to share the sensors via the network:

You can also read the sensors via ADB!

Solution 2

There exist multiple Android apps to transmit sensor data wirelessly. Checkout e.g. "Smartphone IMU GPS" [1], which is open-source [2]. It transmits the data via UDP. A Python code snippet to receive the data stream is given in the app description [1]. Make sure the smartphone as well as the receiving device are connected to the same WiFi network and no firewall blocks the traffic.

[1] https://play.google.com/store/apps/details?id=de.lorenz_fenster.sensorstreamgps
[2] https://sourceforge.net/projects/smartphone-imu/

Solution 3

You could use python sockets to recieve the data and process it. Look at: https://docs.python.org/2/howto/sockets.html for some idea of how to setup the server machine.

Android has a compatible socket that you could use to send your data: Look at: http://examples.javacodegeeks.com/android/core/socket-core/android-socket-example/ for some ideas on how to use it.

Edit: This will work for wifi and 3g/4g.

Share:
23,502
Sibbs Gambling
Author by

Sibbs Gambling

Updated on December 19, 2021

Comments

  • Sibbs Gambling
    Sibbs Gambling over 2 years

    I wish to transmit real-time sensor data collected by Android smartphone to my computer and do the signal process on my computer. How may I achieve that? Any helpful links to tutorials are very well welcomed.

    Either by wireless means or USB cables is acceptable.

    When the data are transmitted, how may the computer process them?

    I am familiar with Python, and so perferrably use Python to deal with the coming data.

    Is it possible for Python to continuously accept newly come data and process them?

  • Jacob Sundqvist
    Jacob Sundqvist over 9 years
    Found this old code of mine, that you could have a look at: github.com/ninc/pi-vinterljus/blob/master/pialive/pialive.py It basicly sends an "I am alive" message and then closes down the socket. You should however keep the socket alive to continue the stream of realtime data.
  • GuySoft
    GuySoft over 5 years
    smartphone-imu Worked pretty well for me, lets you control the rate of data and is FOSS