Skip to content

Can't get modpoll to run in a Compose Setup #82

@mircsicz

Description

@mircsicz

First and foremost thanks a lot for this awesome tool and all the work you've put into creating and still put maintaining it! :-*

I'm setting up a proof of concept environment in Docker-Compose but always fail at running the command in the container:

Error response from daemon: failed to create task for container: failed to create shim task: OCI runtime create failed: runc create failed: unable to start container process: exec: "modpoll -d --tcp-port 5020 --tcp modsim --mqtt-host modmqtt --config /app/examples/modsim-docker.csv": stat modpoll -d --tcp-port 5020 --tcp modsim --mqtt-host modmqtt --config /app/examples/modsim-docker.csv: no such file or directory: unknown

TLDR;

This is my compose.yml:

---
services:
  modsim:
    image: topmaker/modsim
    container_name: modsim 
    restart: unless-stopped
    #environment:
    ports:
      - 5020:5020
    volumes:
      - ./modsim-config:/config
    networks:
      - modbus
  modpoll:
    image: topmaker/modpoll
    container_name: modpoll 
    restart: unless-stopped
    command: ["modpoll -d \
    --tcp-port 5020 \
    --tcp modsim \
    --mqtt-host modmqtt \
    --config /app/examples/modsim-docker.csv"]
    volumes:
      - ./modpoll-config:/app/examples
    networks:
      - modbus
  mosquitto:
    image: eclipse-mosquitto
    container_name: modmqtt
    restart: unless-stopped
    ports:
      - "1884:1883"
      - "9002:9001"
    volumes:
      - ./mqtt-config:/mosquitto/config
      - ./mqtt-data:/mosquitto/data
    networks:
      - modbus
networks:
  modbus:

I've read through your Readme and also gone over this Writeup. The Doc's I've seen as well...

File is there:

 0:45:19 CODE/docker/modpoll 
$ ls -l modpoll-config 
total 8
-rw-r--r--@ 1 mirco  staff  1367 Jan  3 21:19 modsim-docker.csv

If I comment out the whole 'modpoll' service from the compose file and run it directly from 'docker run' it works:

 0:43:32 CODE/docker/modpoll 
$ docker run --rm -v /Users/mirco/CODE/SNB/docker/modpoll/modpoll-config:/app/examples --name modpoll --network=modpoll_modbus topmaker/modpoll \
  modpoll -d \
--tcp-port 5020 --tcp modsim --mqtt-host modmqtt \
--config /app/examples/modsim-docker.csv

Modpoll v1.4.1 - A New Command-line Tool for Modbus and MQTT

2025-01-06 23:43:40,105 | I | modpoll.main | Setup MQTT connection to modmqtt:1883
2025-01-06 23:43:40,119 | I | modpoll.main | Connected to MQTT broker.
2025-01-06 23:43:40,119 | I | modpoll.modbus_task | Loading config from: /app/examples/modsim-docker.csv
2025-01-06 23:43:40,120 | I | modpoll.modbus_task | Added 1 device(s)...
2025-01-06 23:43:40,120 | I | modpoll.main | Loaded 1 Modbus config(s).
2025-01-06 23:43:40,120 | I | modpoll.main |  === Modpoll is polling at rate:10.0s, actual:10.0s ===
2025-01-06 23:43:40,120 | I | modpoll.mqtt_task | Created new MQTT session.
2025-01-06 23:43:40,121 | I | modpoll.mqtt_task | Subscribe to topic: modpoll/+/set with QoS: 0
2025-01-06 23:43:40,121 | I | modpoll.mqtt_task | Subscribed successfully.
2025-01-06 23:43:42,134 | I | modpoll.mqtt_task | Publish message to topic: modpoll/modsim01/data

I can even check with MQTT-Explorer:
Bildschirmfoto 2025-01-07 um 12 44 26 AM

So now after the better of that afternoon I'm at a loss here and sincerly hope you can shad some light at me...

Metadata

Metadata

Assignees

No one assigned

    Labels

    documentationImprovements or additions to documentationquestionFurther information is requested

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions