Skip to content

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

License

Notifications You must be signed in to change notification settings

christopher-strack/spymarine

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

27 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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

About

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

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages