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
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
image stream publish server over websocket

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

MrError404 1 Nov 04, 2021
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
Terminals served by tornado websockets

This is a Tornado websocket backend for the Xterm.js Javascript terminal emulator library. It evolved out of pyxterm, which was part of GraphTerm (as

Project Jupyter 332 Dec 27, 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 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
Burgeramt-appointments-websockets - Fetch Bürgeramt appointments and broadcast them via websockets

Bürgeramt appointment finder This server looks for Bürgeramt appointment every f

74 Dec 19, 2022
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
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
一款为 go-cqhttp 的正向 WebSocket 设计的 Python SDK

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

35 Dec 21, 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
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
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
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
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
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 RPC and Pub/Sub for Python applications and microservices

wampy [whomp-ee] For a background as to what WAMP is, please see here. This is a Python implementation of WAMP using Gevent, but you can also configur

simon 121 Nov 22, 2022
tiny multi-threaded socks4 server implemented in python2

tiny, multi-threaded socks4a server implemented in python2.

4 Sep 21, 2022