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 thedevices_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
Built Distribution
File details
Details for the file spymarine-0.3.0.tar.gz
.
File metadata
- Download URL: spymarine-0.3.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 Darwin/23.3.0
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 16bee498bfd1644a36a93b30c576f68b413af3a0838489e2728481f29ce09a46 |
|
MD5 | 678375308ab3d99577a283d902e06419 |
|
BLAKE2b-256 | 47fd14120f79bfdc530b896ae2a9e73b26d07cfefea7adbb7646bcbf81138815 |
File details
Details for the file spymarine-0.3.0-py3-none-any.whl
.
File metadata
- Download URL: spymarine-0.3.0-py3-none-any.whl
- Upload date:
- Size: 12.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.7.1 CPython/3.12.2 Darwin/23.3.0
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 89e3b4832df1f0706630616fc91bcff2115c3adfd733757d3febc5e13fb93914 |
|
MD5 | af32bdb03194cdac4973063cacc6e529 |
|
BLAKE2b-256 | 002ca6664efbc3494ca2df79960cd5ef670288a815ad49e459c15e0cd13e96f9 |