A package for receiving data from sensor-streaming phone apps.
Project description
PhoneSensors
phonesensors
is a Python package to aid with receiving various sensor data from phones in a quick and easy way. It is
meant to be used in conjunction with the
SensorStreamer
app for Android devices, but support for any other app streaming sensor data over a TCP socket can be implemented
with relative ease.
How to install
Installation via pip is in being implemented. For now, download it manually.
How to use
Open the SensorStreamer app and make it a TCP server emitting JSON packets on a port of your choice. Port 5000 is used for this example. Find out the IP address of your device (e.g. 192.168.1.1). Run the following code to receive parsed sensor data packets from your device:
from main import SensorStreamerClient
with SensorStreamerClient("192.168.1.1", 5000) as client:
for packet in client:
print(packet)
packet
is a SensorDataCollection
instance. You can obtain the specific sensor data by accesing its attributes. The sensor data and timestamps are returned
as numpy arrays:
acceleration_values = packet.acc.values
acceleration_timestamps = packet.acc.timestamps
proximity_values = packet.prox.values
proximity_timestamps = packet.prox.timestamps
Data from different sources may have different number of elements due to differences in sampling frequency. For example, acceleration_values
, a 3D vector, may have
4 samples and thus be a (4,3) array. While proximity_values
, a 1D scalar, may only have one value and thus be a (1,) array.
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file phonesensors-0.0.1.tar.gz
.
File metadata
- Download URL: phonesensors-0.0.1.tar.gz
- Upload date:
- Size: 6.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.1 CPython/3.8.3
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 980b7614233cf028a8c13eaf7d485003d04495a86259c3ac8e476c7c218bd8c0 |
|
MD5 | c9329ffa4d4b64715c495f17a9da6064 |
|
BLAKE2b-256 | 91ca14f67a800c90384dace13cbfa4050474edb792d563caf1223676bc59285b |
File details
Details for the file phonesensors-0.0.1-py3-none-any.whl
.
File metadata
- Download URL: phonesensors-0.0.1-py3-none-any.whl
- Upload date:
- Size: 6.7 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.1 CPython/3.8.3
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | a5ad738a5b9da850b0bb36537a73763b62f8f0e5df22da33853b7893bc450365 |
|
MD5 | cb8e6040677bc9bc24dbb241d4b864e0 |
|
BLAKE2b-256 | d653cddc3d3e9df79a7d9fbbc46c15ba2835ee998b673d5ec84eae4498afc19a |