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
Chat app for Django, powered by Django Channels, Websockets & Asyncio

Django Private Chat2 New and improved https://github.com/Bearle/django-private-chat Chat app for Django, powered by Django Channels, Websockets & Asyn

Bearle 205 Dec 30, 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
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
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
Discord.py Connect to Discord voice call with websocket

Discord.py Connect to Discord voice call with websocket

WoahThatsHot 3 Apr 22, 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
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
Websockify is a WebSocket to TCP proxy/bridge. This allows a browser to connect to any application/server/service. Implementations in Python, C, Node.js and Ruby.

websockify: WebSockets support for any application/server websockify was formerly named wsproxy and was part of the noVNC project. At the most basic l

noVNC 3.3k Jan 03, 2023
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
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
Minecraft WebSocket

Minecraft-WebSocket Pythonでマインクラフトと通信します。 紹介動画 推奨設定 Minecraft Windows Edition (Education Edition) 1.17 以上 Python 3系(3.8.2で動作確認済み) 必要なモジュール ・asyncio ・w

Roii.py 2 Jul 07, 2022
WebSocket emulation - Python server

SockJS-tornado server SockJS-tornado is a Python server side counterpart of SockJS-client browser library running on top of Tornado framework. Simplif

Serge S. Koval 854 Nov 19, 2022
An IPC based on Websockets, fast, stable, and reliable

winerp An IPC based on Websockets. Fast, Stable, and easy-to-use, for inter-communication between your processes or discord.py bots. Key Features Fast

Black Thunder 5 Aug 09, 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
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
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
A simple texts communication platform using pygame and sockets.

Python Tchat A simple texts communication platform using pygame and sockets. How to install ? You need a python 3.8.6 server with at least one opened

Yohann Boniface 7 Jan 23, 2022
Get realtime updates in your mobile/web app from frappe and erpnext

Fsocket Extend frappe's websocket server using socket.io and redis Installation Use frappe bench to add fsocket in your project $ bench get-app https:

21 Sep 25, 2022
一款为 go-cqhttp 的正向 WebSocket 设计的 Python SDK

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

35 Dec 21, 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