Skip to main content

Communicate with Simarine devices using asyncio and Python

Project description

spymarine

A library for spying on Simarine devices and their sensor values using asyncio and Python

Based on the fantastic reverse engineering work of https://github.com/htool/pico2signalk

Only tested with Simarine Pico rev2

Library Installation

pip install spymarine

Getting Started

Make sure your Simarine device is configured to use AP or STA Wifi mode. It's not possible to connect via a local network while in REMOTE mode.

Run the following code on the same network that the Simarine device is connected to:

import asyncio
import spymarine

async def main():
    # Print all devices and their latest sensor values every second
    async with spymarine.DeviceReader() as reader:
        while True:
            await reader.read_sensors()
            print(reader.devices)
            await asyncio.sleep(1)

if __name__ == "__main__":
    asyncio.run(main())

Troubleshooting

Q: DeviceReader is stuck while establishing a connection when using STA Wifi mode

  • Switch into AP Wifi mode and connect to the Wifi
  • Use reader.write_devices_cache(path) to create a devices cache
  • Construct a DeviceReader and using the devices_cache_path argument while in STA Wifi mode
  • See the Devices Cache Example

Note that the cache needs to be regenerated if any hardware of app configuration change.

Known Issues

  • Non-ASCII characters in device names will not be represented correctly and replaced with a placeholder. A non-standard encoding seems to be used.

Author

Christopher Strack

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

spymarine-0.4.0.tar.gz (10.4 kB view details)

Uploaded Source

Built Distribution

spymarine-0.4.0-py3-none-any.whl (12.3 kB view details)

Uploaded Python 3

File details

Details for the file spymarine-0.4.0.tar.gz.

File metadata

  • Download URL: spymarine-0.4.0.tar.gz
  • Upload date:
  • Size: 10.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.7.1 CPython/3.12.2 Linux/6.2.0-1019-azure

File hashes

Hashes for spymarine-0.4.0.tar.gz
Algorithm Hash digest
SHA256 8d7b1843d27a5ccdeee2307df28790cf3455d7c7600ed3f18105a49df3a8441a
MD5 81851714c701dd0966c5d0af25efaff0
BLAKE2b-256 d7b8b6d1b686d690587fc0561695a6ddf24af130d8bfb7d0fe39f249666146ff

See more details on using hashes here.

File details

Details for the file spymarine-0.4.0-py3-none-any.whl.

File metadata

  • Download URL: spymarine-0.4.0-py3-none-any.whl
  • Upload date:
  • Size: 12.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.7.1 CPython/3.12.2 Linux/6.2.0-1019-azure

File hashes

Hashes for spymarine-0.4.0-py3-none-any.whl
Algorithm Hash digest
SHA256 eaec77a6a7f8a9f532c561e2fe634e740428ffd0dc5af2c37e214178551dd4ce
MD5 1f430566b62142ac388a288a074621db
BLAKE2b-256 97be3ecb5212a370168e364ab9cb9edf368a4278c30e6b996cb3ce913ae2da00

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page