Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,10 +36,11 @@ jobs:
pip install ./core
pip install \
./plugins/message_sources/mock_message_source \
./plugins/message_sources/udp_message_source \
./plugins/message_processors/ais_decoder_processor \
./plugins/renderers/image_renderer
- name: Import smoke test
run: python -c "import vf_core.main, mock_message_source, ais_decoder_processor, image_renderer"
run: python -c "import vf_core.main, mock_message_source, udp_message_source, ais_decoder_processor, image_renderer"

test:
name: Tests (py${{ matrix.python-version }})
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
*.egg*
config.toml
*.log
*.log.*
*.sqlite
**/.secrets
data
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -178,10 +178,17 @@ async def _receive_loop(self) -> None:
"""Receive AIS messages from the bus and enqueue them for decoding."""
try:
async for msg in self._bus.subscribe(self._in_topic):
if isinstance(msg, str):
msg = msg.encode("utf-8")
if isinstance(msg, bytes):
msg = msg.decode("utf-8", errors="ignore")

# Some sources push multipart messages as one bus
# message with multiple lines. Need to split and
# deal with them as two single messages
for line in msg.splitlines():
line = line.strip()
if line:
self._message_queue.put_line(line.encode("utf-8"))

self._message_queue.put_line(msg)
await asyncio.sleep(0)
except asyncio.CancelledError:
self._logger.info("Receive loop cancelled")
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -3,22 +3,22 @@ requires = ["setuptools>=77"]
build-backend = "setuptools.build_meta"

[project]
name = "daisy-message-source"
name = "udp-message-source"
version = "0.1.0"
description = "Wegmatt Daisy I2C AIS receiver source plugin for Vessel Frame."
description = "UDP AIS message source plugin for Vessel Frame. Receives NMEA sentences over UDP (eg from AIS-catcher) and republishes them on ais.raw"
requires-python = ">=3.11"
license = "GPL-3.0-only"
authors = [{ name = "Spook Workshop" }]
requires-python = ">=3.11"
dependencies = ["vessel-frame-core", "smbus2>=0.5.0"]
dependencies = ["vessel-frame-core"]

[tool.setuptools.packages.find]
where = ["src"]

[project.entry-points."vesselframe.plugins.messagesource"]
daisy_message_source = "daisy_message_source:make_plugin"
udp_message_source = "udp_message_source:make_plugin"

[project.entry-points."vesselframe.config.schemas"]
daisy_message_source = "daisy_message_source:get_config_schema"
udp_message_source = "udp_message_source:get_config_schema"

[project.urls]
Homepage = "https://github.com/SpookWorkshop/vessel-frame"
Expand Down
Loading