{"id":27000193,"url":"https://github.com/ianovir/himuserver","last_synced_at":"2025-04-04T03:19:20.437Z","repository":{"id":20656981,"uuid":"23939194","full_name":"ianovir/HIMUServer","owner":"ianovir","description":"HIMUServer is a server-side solution for the app HyperIMU","archived":false,"fork":false,"pushed_at":"2021-08-23T21:37:49.000Z","size":151,"stargazers_count":23,"open_issues_count":0,"forks_count":9,"subscribers_count":3,"default_branch":"master","last_synced_at":"2024-10-31T23:14:43.515Z","etag":null,"topics":["android-device","himu-server","hyperimu","stream"],"latest_commit_sha":null,"homepage":"https://ianovir.com/works/mobile/hyperimu/","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/ianovir.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2014-09-11T23:11:47.000Z","updated_at":"2024-06-08T13:24:50.000Z","dependencies_parsed_at":"2022-08-21T19:01:06.008Z","dependency_job_id":null,"html_url":"https://github.com/ianovir/HIMUServer","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ianovir%2FHIMUServer","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ianovir%2FHIMUServer/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ianovir%2FHIMUServer/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ianovir%2FHIMUServer/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ianovir","download_url":"https://codeload.github.com/ianovir/HIMUServer/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247113168,"owners_count":20885673,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["android-device","himu-server","hyperimu","stream"],"created_at":"2025-04-04T03:19:19.835Z","updated_at":"2025-04-04T03:19:20.414Z","avatar_url":"https://github.com/ianovir.png","language":"Python","readme":"HIMU-Server\n===========\n\nHIMU Server (HyperIMU Server) is a python library covering all server-side stream protocols supported by [HyperIMU](https://ianovir.com/works/mobile/hyperimu/). It performs basic operations such as input stream reading and csv sequence chunking.\n\nRead the [HyperIMU Documentation](https://ianovir.com/works/mobile/hyperimu/hyperimu-help/) for more details.\n\n# Overview #\n\n## Network configurations ##\n\nIn order to connect the HIMUServer application and the HyperIMU app, you need the following:\n\n* Be sure the Android device (HyperIMU client) and you server (HIMUServer) are connected to the **same network**\n* Configure the HyperIMU app with the server **IP address** and **server port**\n* Be sure the **firewall** in the server machine doesn't limit the server application \n\n## Protocols and Data Format ##\n\nHyperIMU streams the sensors' data by using the protocols UDP and TCP,\nor by storing them into a file for an offline processing.\nThe order of the sensors is the same as specified in the HyperIMU's settings.\n\nData are formatted as CSV (Comma Separated Value).\nAt a time, all sensors' values are gathered into a single string and all values are separated by commas. \nHyperIMU samples always three values per sensor.\n\nE.g. considering a case with three sensors,\nthe packet will be:\n\n\t`0.123,0.586,0.2637,0.259,-0.5963,9.815,5.36,0.00,0.00 \u003cCR\u003e\u003cLF\u003e`\n\nwhere the values can be grouped as follows:\n      \n\t\t  \n| Sensor1                     | Sensor2                |Sensor3             | end of line|\n|:---------------------------:|:----------------------:|:------------------:|:-----:|\n| 0.123 **,**  0.586 **,**  0.2637      | 0.259 **,**  -0.5963 **,** 9.815 | 5.36  **,** 0.00  **,** 0.00 |   **[CR][LF]**   |  \n\t      \nAt the end of the CSV line it is inserted the symbols [CR][LF] or the char \"#\" (configurable option).\n\n**Timestamp** and **MAC address** will be added at the very beginning of the packet, while **GPS** data (Latitude, Longitude, Altitude) and **GPS NMEA** sentences will be added at the very end.\n\n# Installation\nGet `HIMUServer` source from Github and install it.\n\n## Linux\nExecute the following commands:\n```sh\ngit clone git://github.com/ianovir/HIMUServer.git\ncd HIMUServer/\nsudo python HIMUServer/setup.py install\nsudo rm -rf HIMUServer\n```   \n## Windows\nDownload the repository or execute the following git command:\n```sh\ngit clone git://github.com/ianovir/HIMUServer.git\n```\nVia Windows cmd (or Powershell) navigate to the downloaded folder `HIMUServer/` and execute the follwing command:\n```sh\npython HIMUServer/setup.py install\n```   \nFinally, delete the folder `HIMUServer/`\n\n# How to use HIMUServer #\n\n## Server configuration ##\n\nHIMU-Server offers code snippets for data acquisition via UDP, TCP and FILE protocols.\nIt is possible to read the signals directly from the stream by using an instance of the class **HIMUServer**:\n\n```python\nfrom HIMUServer import HIMUServer\nmyHIMUServer = HIMUServer()\n```\nConfigurations such as input buffer size, timeout and terminator symbol can be specified directly in the server constructor:\n\n```python\nfrom HIMUServer import HIMUServer\nmyHIMUServer = HIMUServer(bufferSize = 1024, timeout = 30, separatorIndex = 0)\n```\nThe parameter `separatorIndex` can assume the value 0 to use the symbol **[CR][LF]** for csv packet separator, value 1 to use the **#** symbol.\n\n## Custom listeners ##\n\nHIMU Server supports listeners. A listener is an object having the public method `notify(sensorData)` which is called by the server when a packet is received.\n\nYou can define your custom listener:\n\n```python\nclass SimplePrintListener:\n    def __init__(self, serverInstance):\n        self.__server = serverInstance\n        ...\n        \n    def notify (self, sensorData):\n        #simply printing all data strings\n        HIMUServer.printSensorsData(sensorData)\n```\n\nThen add an instance of the listener to the server:\n\n```python\nmyListener = SimplePrintListener(myHIMUServer)\nmyHIMUServer.addListener(myListener)\n```\n\n## Accessing Sensors' data ##\n\nYou can access the sensors' data by iterating the `sensorData` parameter in the `notify()` method of your custom listener:\n\n```python\nclass MyCustomListener:\n    def __init__(self):\n        pass\n    ...    \n    def notify (self, sensorData): \n        for sensors in sensorData:\n          sensor_1 = HIMUServer.strings2Floats(sensors[0])\n          sensor_2 = HIMUServer.strings2Floats(sensors[1])\n          ...\n          s1_x = sensor_1[0]\n          s1_y = sensor_1[1]\n          s1_z = sensor_1[2]\n```\nPlease, note the method `HIMUServer.strings2Floats()` which can be used to convert a list of strings (from csv) to a list of floats very easily.\n\n## Launching the server ##\n\nLaunch the server with TCP protocol:\n```python\n\tmyHIMUServer.start(\"TCP\", 2055)\n```\n\nUDP protocol:\n```python\n\tmyHIMUServer.start(\"UDP\", 2055)\n```\n\nFile:\n```python\n\tmyHIMUServer.start(\"FILE\", \"HIMU-file-path.csv\")\n```\n\nTake a look to the `demo.py` file for more info.\n\n\n# Copyright\nCopyright(c) 2019 Sebastiano Campisi - [ianovir.com](https://ianovir.com). \nRead the LICENSE file for more details.\n\n\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fianovir%2Fhimuserver","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fianovir%2Fhimuserver","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fianovir%2Fhimuserver/lists"}