mochigome/ij-mt-msp

By mochigome

Updated 12 months ago

IJ Machine T MSP to read data and MQTT publisher for a Programmable Logic Controller.

Image
0

46

Find out more in my github repository!

To get started create a docker-compose.yml with the following:

version: "3.8"

services:
  machineM-msp:
    container_name: machineM-msp
    image: mochigome/ij-mt-msp:0.5v
    restart: always
    logging:
      driver: "json-file"
      options:
        max-size: "20m"
        max-file: "10"
    environment:
      MQTT_HOST: ${MQTT_HOST}
      MQTT_TOPIC: ${MQTT_TOPIC}
      PLC_HOST: ${PLC_HOST}
      PLC_PORT: ${PLC_PORT}
      DEVICES_16bit: ${DEVICES_16bit}
      DEVICES_2bit: ${DEVICES_2bit}

and then run: docker-compose up (add -d to run in detached mode). This is only a publisher service.

You will need to create a environment file at the same directory name .env

############
# Secrets 
# YOU MUST CHANGE THESE BEFORE GOING INTO PRODUCTION
############

PLC_HOST=192.168.3.61
PLC_PORT=5011

############
# MQTT 
############

MQTT_HOST=tcp://192.168.0.6:1883
MQTT_TOPIC="machinem/holding_register/all/"
MQTT_SUB_HOST=192.168.0.6
MQTT_SUB_PORT=1883
MQTT_SUB_TOPIC="machinem/holding_register/all/+"

############
# DEVICES NO
############

# case 1: 16-bit device 0 to 65535
# case 2:  32-bit device
# case 3:  2-bit device
# case 4:  ASCII hex device
# case 5:  16-bit device -37268 to 32767

DEVICES_16bit=D,2870,1,D,706,1,D,2820,1,D,2810,1,D,736,1,D,2616,1,D,2630,1,D,840,1,D,2800,5,D,2826,5
DEVICES_2bit=M,1520,3,Y,8C,3,Y,90,3,Y,94,3

Docker Pull Command

docker pull mochigome/ij-mt-msp