Giter VIP home page Giter VIP logo

smwiredpy's Introduction

SMWiredPy

Sensemore - Wired vibration sensor Python interface

sm

Wired

Installing the library

  • Using pip
	$ pip install SMWired
  • Build from source
	#Inside the library folder
	$ pip install .

Requirements

  • pybind11
  • pyserial
  • SMComPy (pip install SMComPy or see SMComPy)

Example usage

import SMWiredPy

wired_network = SMWiredPy.SMWired(port = "/dev/ttyUSB0", configure_network='auto', max_device_number=2)
#Dump the list of found available devices
print("Found available devices:",wired_network.get_available_devices())

devices = wired_network.get_available_devices()

#Print the version of the devices
for device in devices:
	print("Version of '%s' is %s"%(device,wired_network.get_version(device)))


#Take measurement from a specific device in the network

mac = 'CA:B8:31:00:00:55'
accelerometer_range = "16G"
sampling_frequency = 6400
sample_size = 200

#wired_network.firmware_update(mac,'Wiredv1_0_13.bin')

measurement_result = wired_network.measure(mac,accelerometer_range,sampling_frequency,sample_size)

#Measurement results are native python lists
result_acc_x = measurement_result[0]
result_acc_y = measurement_result[1]
result_acc_z = measurement_result[2]

print("Acc-X:",result_acc_x)
print("Acc-Y:",result_acc_y)
print("Acc-Z:",result_acc_z)

"""
Also there are telemetries calculated in wired, we can also take it by calling get_all_telemetry
"""

telemetries = wired_network.get_all_telemetry(mac)
print(telemetries)

Available sampling frequencies

- 800 Hz
- 1600 Hz
- 3200 Hz
- 6400 Hz
- 12800 Hz

Available accelerometer ranges

- 2G
- 4G
- 8G
- 16G

Available sample size range

  • Up to 1 million sample is supported

Command line interface

  • Updating the wired device via CLI
python -m sensemore.SMWiredPy update --port=/dev/ttyUSB0 --file=Wiredv1_0_13.bin --mac=CA:B8:31:00:00:3C
  • Fast measurement via cli
python -m sensemore.SMWiredPy measure --port=/dev/ttyUSB0 --mac=CA:B8:31:00:00:3C --sample=1000 --freq=12800 -acc=16G -t

smwiredpy's People

Contributors

burakdeniz01 avatar fbgencer avatar samilarinc avatar

Stargazers

 avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

Forkers

samilarinc

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.