ParadoxIP150v2 icon indicating copy to clipboard operation
ParadoxIP150v2 copied to clipboard

Anybody got this working in Docker?

Open IoTPlay opened this issue 6 years ago • 5 comments

Anybody got this up and running in Docker? I still get this error:

logging to file /var/log/paradoxip.log
ERROR:root:******************* Error reading config.ini file (will use defaults): No section: 'Application'
reading  config
Traceback (most recent call last):
  File "/usr/src/app/ParadoxIP150v2/IP150-MQTTv2.py", line 955, in <module>
    logging.error( "MQTT connection error (" + str(attempts) + ": " + e.strerror)
AttributeError: 'exceptions.AttributeError' object has no attribute 'strerror'

IoTPlay avatar Oct 06 '18 00:10 IoTPlay

I have my version running in docker, but I think I replaced the logger commands.

I’d post mine but I think it’s too specific for sp7000 series panels now.

On Sat, 6 Oct 2018 at 13:25, Jéan Roux [email protected] wrote:

Anybody got this up and running in Docker? I still get this error:

logging to file /var/log/paradoxip.log ERROR:root:******************* Error reading config.ini file (will use defaults): No section: 'Application' Traceback (most recent call last): File "/usr/src/iotp/ParadoxIP150v2/IP150-MQTTv2.py", line 955, in reading config logging.error( "MQTT connection error (" + str(attempts) + ": " + e.strerror) AttributeError: 'exceptions.AttributeError' object has no attribute 'strerror'

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/Tertiush/ParadoxIP150v2/issues/33, or mute the thread https://github.com/notifications/unsubscribe-auth/AFGkc8tLIRFPwPKMRuHgUi4RsMWHtVpuks5uh_iIgaJpZM4XLF3g .

psyciknz avatar Oct 06 '18 01:10 psyciknz

Here is my Dockerfile:

FROM python:2-alpine

RUN apk update              && \
    apk add --no-cache         \
    git

WORKDIR /usr/src/app
RUN git clone https://github.com/Tertiush/ParadoxIP150v2.git
RUN chmod +x /usr/src/app/ParadoxIP150v2/IP150-MQTTv2.py
# I run the command in a folder where the config.ini is - that has all my settings
COPY config.ini /usr/src/app/ParadoxIP150v2
CMD ["python","/usr/src/app/ParadoxIP150v2/IP150-MQTTv2.py"]

IoTPlay avatar Oct 06 '18 01:10 IoTPlay

Here is my docker file, the FROM BASEIMAGE_ARCH/python:2.7.15-jessie

__CROSS_COPY qemu/qemu-__QEMU_ARCH__-static /usr/bin/

# based on https://github.com/pfichtner/docker-mqttwarn

# install python libraries (TODO: any others?)
RUN pip install paho-mqtt requests

# build /opt/mqttwarn
RUN mkdir -p /opt/paradox
WORKDIR /opt/paradox

# add user paradox to image
RUN groupadd -r paradox && useradd -r -g paradox paradox
RUN chown -R paradox /opt/paradox

# process run as paradox user
USER paradox

# conf file from host
VOLUME ["/opt/paradox/conf"]

# set conf path
ENV PARADOXINI="/opt/paradox/conf/config.ini"

# finally, copy the current code (ideally we'd copy only what we need, but it
#  is not clear what that is, yet)
COPY . /opt/paradox

# run process
CMD python IP150-MQTTv2.py

I'll confirm if I made any changes to the code to support the config file like this, but I believe I did make alterations to the logging so it uses syslog.

psyciknz avatar Oct 06 '18 19:10 psyciknz

If you want (or tertuish does as well) you can look at my fork...and if it's still good for everyone (as it not just SP panels as I added a log of status reporting from those for battery voltage etc). Then I can PR it back to the main fork. But this includes my docker file....it's called a cross, and I have a build script for building arm64v8, arm32v6 and amd64. I'll need to add more files into the fork to explain this. Here's the link: https://github.com/psyciknz/ParadoxIP150v2 It was forked a while ago, so I'm not sure the state compared to the original.

psyciknz avatar Oct 06 '18 19:10 psyciknz

👍

IoTPlay avatar Oct 06 '18 21:10 IoTPlay