Skip to content
Open
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 Dockerfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
# syntax=docker/dockerfile:1
FROM python:3.13-alpine
# alpine causes issues with solarman_rtu_proxy.py: https://stackoverflow.com/a/77780983
FROM python:3.13-slim

# mount current directory to /app
# install with pip
Expand Down
7 changes: 6 additions & 1 deletion utils/solarman_rtu_proxy.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@

import argparse
import asyncio
import sys
from functools import partial

from pysolarmanv5 import PySolarmanV5Async
Expand Down Expand Up @@ -93,7 +94,11 @@ def main():
)
args = parser.parse_args()

asyncio.run(run_proxy(args.bind, args.port, args.logger, args.serial))
try:
asyncio.run(run_proxy(args.bind, args.port, args.logger, args.serial))
except Exception as e:
print(f"Exception: {e}")
sys.exit(1)
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is completely unnecessary call.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I also thaught that an expection should cause a crash of the script with a non-zero exit code.
But that was not the case, instead it kept prinitng the exception. I suspect this has something to do with how these scripts are made executable

[project.scripts]
solarman-decoder = "utils.solarman_decoder:main"
solarman-rtu-proxy = "utils.solarman_rtu_proxy:main"
solarman-scan = "utils.solarman_scan:main"
solarman-uni-scan = "utils.solarman_uni_scan:main"

Copy link
Copy Markdown
Contributor

@davidrapan davidrapan Jun 5, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hmmm.. 🤔



if __name__ == "__main__":
Expand Down