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 and firmware 1.17
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
- Update the Pico's firmware
Q: A ConnectionRefusedError error is thrown
- Update the Pico's firmware
- Try increasing the
request_limit
in theCommunication
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
Built Distribution
File details
Details for the file spymarine-0.5.0.tar.gz
.
File metadata
- Download URL: spymarine-0.5.0.tar.gz
- Upload date:
- Size: 10.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.7.1 CPython/3.11.10 Linux/6.5.0-1025-azure
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | bd337f107c6dfae721881fe624ac5fe5ac46f56c0b2708b1ea96ca5d2fdfab67 |
|
MD5 | eb467896127221919fece2758ba44cd8 |
|
BLAKE2b-256 | 0304a52a205fdaab281f7c60d30876efe3122daa9b57950e30c85dc3e3300847 |
File details
Details for the file spymarine-0.5.0-py3-none-any.whl
.
File metadata
- Download URL: spymarine-0.5.0-py3-none-any.whl
- Upload date:
- Size: 12.2 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.7.1 CPython/3.11.10 Linux/6.5.0-1025-azure
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | d396654158b9fcec47df96c283dc7f69b48ce7841d8bd1576f6b141f29e932d6 |
|
MD5 | 2c753483a5c83fa03718da11ec06a8ae |
|
BLAKE2b-256 | 6e915a4a88d1452fd78a463d7638605e73de2b06ff6333b92119fa5bb8887448 |