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
wssh ("wish") is a command-line utility/shell for WebSocket inpsired by netcat.

wssh ("wish") is a command-line utility/shell for WebSocket inspired by netcat

Jeff Lindsay 256 Nov 16, 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
Developer-friendly asynchrony for Django

Django Channels Channels augments Django to bring WebSocket, long-poll HTTP, task offloading and other async support to your code, using familiar Djan

Django 5.5k Jan 03, 2023
Websocket 'broadcast' demo using FastAPI/Starlette

fastapi-websocket-broadcast An example of the familiar 'chat' websocket demo app, implemented in FastAPI / Starlette. Run with uvicorn app:app And th

Kit Thwaite 109 Nov 30, 2022
Django Channels HTTP/WebSocket server

daphne Daphne is a HTTP, HTTP2 and WebSocket protocol server for ASGI and ASGI-HTTP, developed to power Django Channels. It supports automatic negotia

Django 1.9k Dec 31, 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
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
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
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
Socket.IO integration for Flask applications.

Flask-SocketIO Socket.IO integration for Flask applications. Installation You can install this package as usual with pip: pip install flask-socketio

Miguel Grinberg 4.9k Jan 03, 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
AWS API Gateway Websocket Asynchronous Notifications Pusher

AWS API Gateway Websocket Asynchronous Pusher Fast AWS API Gateway websockets notifications' pusher using Python AsyncIO for managing asynchronous and

OBytes 5 May 15, 2022
一款为 go-cqhttp 的正向 WebSocket 设计的 Python SDK

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

35 Dec 21, 2022
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 implementation on top of Tornado framework

TornadIO2 Disclaimer Unfortunately, Socket.IO 0.8 branch is abandoned, there are huge amount of bugs and nothing getting fixed. I would suggest to loo

Serge S. Koval 526 Oct 03, 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
Synci - Learning project to create a websocket based client server messaging application

Synci Learning project to create a websocket based client server messaging appli

2 Jan 13, 2022
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
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
Library for easily creating and managing websockets.

Documentation coming in version 0.1.4 GitHub PyPI Discord Features Easy to use with object oriented syntax. Intellisense support with typehints and do

ZeroIntensity 0 Aug 27, 2022