JINS MEME(2021年モデル)のJINS MEME LoggerをPythonのWebSocketサーバーで受信するサンプル

Overview

JINS-MEME-Python-WebSocketServer-Sample

JINS MEME(2021年モデル)のJINS MEME LoggerをPythonのWebSocketサーバーで受信するサンプルです。

Logging Data

以下のデータに対応しています。
各データの定義はJINS MEME Platform:データ定義を参照ください。

  • 20Hzデータ(currentData)
    約20Hzでデータを取得でき、動きの把握やコントローラーなど
    精緻なデータの即時取得・分析に適したモードです。
    このデータはJINS MEMEとスマートフォンがBluetooth接続している時のみ生成されます。
  • 15秒間隔データ(logicIndexData)
    15秒間隔データは生体指標を出力する一番粒度の細かいデータです。
    このデータはJINS MEMEとスマートフォンがBluetooth接続している時のみ生成されます。
  • 60秒間隔データ(summaryData)
    1分間に1回データを取得できる、長時間の状態変化をモニタリングするのに適したモードです。
  • 高速頭部運動データ(fastHeadMotion)
    0.2〜0.9秒程度の周期で頭を左右、上下に向けた時の最初の方向、回数カウントのイベントです。
    連続で往復すると回数がカウントアップされ、連続した動作が止まると最終値のみ返されます。
    回転速度で判定するため、ジャイロセンサーをオンにする必要があります。
    このデータはJINS MEMEとスマートフォンがBluetooth接続している時のみ生成されます。
  • 低速頭部運動データ(slowHeadMotion)
    頭を真っ直ぐな状態から左右か前後に45°以上傾けて1秒間弱維持した時のイベントです。
    このデータはJINS MEMEとスマートフォンがBluetooth接続している時のみ生成されます。

Requirement

  • websocket-server 0.5.6 or later
pip install websocket-server

Preparation

  1. JINS MEME Loggerを起動する
    Play Store
    App Store
  2. JINS MEME Loggerの「接続」タブでJINS MEMEを接続する(要Bluetoothオン)
  3. サーバーとなるPCとJINS MEMEを接続したスマホを同じWifiに接続する
  4. JINS MEME Loggerの「設定」タブで「ジャイロを取得」をオンにする
     
  5. JINS MEME Loggerの「設定」タブで「WebSocketクライアント」を追加する
    設定名称:任意の名称を指定
    Ip Address:PCのIPアドレスを指定
    Port:8080(必要に応じて任意のポートを指定)
    Data Tyep:取得したいタイプを指定
     

Demo

デモの実行方法は以下です。

python Sample-currentData.py
    or
python Sample-summaryData.py
    or
python Sample-logicIndexData.py
    or
python Sample-fastHeadMotion.py
    or
python Sample-slowHeadMotion.py
  • --host
    WebSocketServerのPCのIPアドレス
    デフォルト:192.168.179.11
  • --port
    WebSocketServerのPCのポート
    デフォルト:8080

Reference

Author

高橋かずひと(https://twitter.com/KzhtTkhs)

License

JINS-MEME-Python-WebSocketServer-Sample is under MIT License.

Owner
KazuhitoTakahashi
KazuhitoTakahashi
Python framework for AsyncAPI-documented Websocket, PubSub, and other async constructs

asyncapi-eventrouter Work in Progress Write Python code for Event-Driven Architectures! The asyncapi-eventrouter prototype library creates Websocket,

noteable 4 Jan 27, 2022
WebSocket implementation in Python built on top of websockets python library. Similar to Node.js's ws.

ws WebSocket implementation in Python built on top of websockets python library. Similar to Node.js's ws. Basic usage. server.py import ws server = w

AceExpert 7 Jun 27, 2022
tiny multi-threaded socks4 server implemented in python2

tiny, multi-threaded socks4a server implemented in python2.

4 Sep 21, 2022
Connects microservices through a mesh of websockets

WebMesh WebMesh is a WebSocket based communication library for microservices. It uses a WebSocket server based on wsproto that distributes clients on

Charles Smith 9 Apr 29, 2022
JINS MEME(2021年モデル)のJINS MEME LoggerをPythonのWebSocketサーバーで受信するサンプル

JINS-MEME-Python-WebSocketServer-Sample JINS MEME(2021年モデル)のJINS MEME LoggerをPythonのWebSocketサーバーで受信するサンプルです。 Logging Data 以下のデータに対応しています。 各データの定義はJIN

KazuhitoTakahashi 19 Apr 29, 2022
WebSocket client for Python

websocket-client The websocket-client module is a WebSocket client for Python. It provides access to low level APIs for WebSockets. All APIs are for s

3.1k Jan 02, 2023
Elegant WebSockets for your Flask apps.

Flask-Sockets Elegant WebSockets for your Flask apps. Simple usage of route decorator: from flask import Flask from flask_sockets import Sockets app

Heroku Python Team 1.7k Dec 26, 2022
Whatsapp Clone using django, django-channels and websocket

whatsapp-clone Whatsapp Clone using django, django-channels and websocket Features : Signup/Login One on One personal chat with other user Some screen

Anshu Pal 14 Dec 25, 2022
A Security Tool for Enumerating WebSockets

STEWS: Security Testing and Enumeration of WebSockets STEWS is a tool suite for security testing of WebSockets This research was first presented at OW

175 Jan 01, 2023
Official repository for gevent-socketio

Presentation gevent-socketio is a Python implementation of the Socket.IO protocol, developed originally for Node.js by LearnBoost and then ported to o

Alexandre Bourget 1.2k Dec 12, 2022
Tetri5 - Multiplayer Websocket Backend

Tetri5 - Multiplayer Websocket Backend This repository is the backend of the multiplayer portion of the Tetri5 game client. It uses the python websock

Giovani Rodriguez 1 Dec 10, 2022
alien.py - Python interface to websocket endpoint of ALICE Grid Services

alien.py - Python interface to websocket endpoint of ALICE Grid Services Quick containerized testing: singularity

Adrian Sevcenco 6 Dec 14, 2022
一款为 go-cqhttp 的正向 WebSocket 设计的 Python SDK

Nakuru Project 一款为 go-cqhttp 的正向 WebSocket 设计的 Python SDK 在 kuriyama 的基础上改动 项目名来源于藍月なくる,图标由せら绘制 食用方法 将 nakuru 文件夹移至 Python 的 Lib/site-packages 目录下。

35 Dec 21, 2022
image stream publish server over websocket

Image Stream Push Server 简介 通过浏览器网页实时查看图像处理结果。 环境 运行程序需要安装一下python依赖: tornado: 用于创建http及websocket服务; opencv-contrib-python: 用于图像数据源获取及图像处理。 使用 进入到src目

MrError404 1 Nov 04, 2021
Library for building WebSocket servers and clients in Python

What is websockets? websockets is a library for building WebSocket servers and clients in Python with a focus on correctness and simplicity. Built on

Aymeric Augustin 4.3k Jan 04, 2023
This websocket program is for data transmission between server and client. Data transmission is for Federated Learning in Edge computing environment.

websocket-for-data-transmission This websocket program is for data transmission between server and client. Data transmission is for Federated Learning

9 Jul 19, 2022
Python Socket.IO server and client

python-socketio Python implementation of the Socket.IO realtime client and server. Version compatibility The Socket.IO protocol has been through a num

Miguel Grinberg 3.2k Dec 31, 2022
WebSocket and WAMP in Python for Twisted and asyncio

Autobahn|Python WebSocket & WAMP for Python on Twisted and asyncio. Quick Links: Source Code - Documentation - WebSocket Examples - WAMP Examples Comm

Crossbar.io 2.4k Jan 04, 2023
Async (trio) KuCoin minimal REST API + Websocket

Minimal Async KuCoin REST API + WebSocket using trio Coded by π ([email protected] TG: @p

Pi 2 Oct 23, 2022
A websocket client for Source Filmmaker intended to trasmit scene and frame data to other applications.

SFM SOCK A websocket client for Source Filmmaker intended to trasmit scene and frame data to other applications. This software can be used to transmit

KiwifruitDev 2 Jan 08, 2022