nebulous / infinitude

Open control of Carrier/Bryant thermostats
MIT License
224 stars 50 forks source link

Issues with setting up docker installation to talk via serial #147

Closed LukeSkaff closed 1 year ago

LukeSkaff commented 2 years ago

Anyone willing to help a noob on the docker container would be super helpful. This is my first time using docker and I am using this project to learn docker. I installed docker on my Raspberry Pi 4 and I am trying to use Infinitude to listen over RS485 to an ICP unit (carrier parent company) that sells rebranded Bryant and Carrier units under names such as Airquest, Heil, Comfortmaker, and more. I have a variable speed blower 2-stage furnace and variable speed inverter heat pump that talks to an Ion thermostat model number SYST0101CW which appears to be a rebranded Bryant SYSTXBBECC01-B or Carrier SYSTXCCITC01-B thermostat. I am using a USB to RS485 converter and I can see the serial chatter in a serial terminal on the raspberry pi but I am unable to figure out how to get infinitude to see that serial chatter.

I started by running docker run --rm -v $PWD/state:/infinitude/state -p 3000:3000 nebulous/infinitude but that started the container without serial obviously

After messing around trying to figure out how to use the docker-compose.yaml file I downloaded I ran the below command in the same directory as the compose file and I am one step closer docker compose up The infinitude github page says to use the below command with a dash but I get a command not found error returned when I run it with a dash docker-compose up

I uncommented out the serial lines in the compose file but not sure if it is correct. The devices looks weird how it is listed twice

version: "2.1"

services:
  infinitude:
    container_name: infinitude
    hostname: infinitude
    image: nebulous/infinitude:latest
    build:
      context: .
      dockerfile: Dockerfile
    network_mode: host
    ports:
      - "3000:3000"
    volumes:
      - ./state:/infinitude/state
    environment:
      - APP_SECRET=Pogotudinal
      - PASS_REQS=300
      - MODE=Production
      - SERIAL_TTY=/dev/ttyUSB0
#      - SERIAL_SOCKET=10.0.0.1:1234
    devices:
      - /dev/ttyUSB0:/dev/ttyUSB0
    restart: always

In the terminal window where I ran docker compose up I see it trying to talk to the serial port

infinitude  | [2022-05-21 03:49:19.59479] [7] [info] Closed: 1001
infinitude  | [2022-05-21 03:49:19.70950] [7] [info] Attempting to access /dev/ttyUSB0
infinitude  | [2022-05-21 03:49:19.72749] [7] [info] Closed stream
infinitude  | [2022-05-21 03:49:49.71753] [7] [info] Closed: 1006

This is all I get in the serial window of raspberrypi:3000/#/serial A few lines appear in stream when I first start the program then it disappears

State
Updated Device  Address Value
4 minutes ago   OutdoorUnit3    00 06 05    00 00 00 00 01 00 00

Even though this is a ICP unit it appears to be using the same protocol so it appears I have docker setup wrong or something. I did a dump from cutecom serial terminal on the pi and I can see HEX 00 01 04 followed by the callout of the equipment for example HEX

00 01 04 78 4E 20 01 44 01 7B 00 00 06 00 01 04 54 57 4F 20 53 54 41 47 45 20 46 55 52 4E 41 43 45 20 20 20 20 20 20 20 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 43 45 53 52 31 33 31 35 38 33 2D 30 34 00 00 00 47 39 4D 56 45 30 34 30 31 37 31 32 41 33 00 00 00 00 00 00 31 36 33 36 4E 2D 2D 2D 2D 2D 2D 20 41 31 36 33 35 34 39 31 30 32 00 00 00 00 00 00 00 00 00 00 00 00 00 00 4A BC 53 01 20 01 03 00 00 0B 00 01 04 36 FA 20 01 53 01 7B 00 00 06 00 01 04 56 41 52 20 53 50 44 20 43 4F 4D 50 20 56 45 52 53 49 4F 4E 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 43 45 53 52 31 33 31 35 36 34 2D 31 30 00 00 00 48 56 48 38 32 34 47 4B 41 31 30 31 20 20 20 20 20 20 20 20 32 33 31 37 30 38 31 32 30 35 32 00 34 32 31 37 45 30 31 33 37 39 20 20 20 20 20 20 20 20 20 20 20 20 20 20 30 61 44

ASCII

�xN D{���TWO STAGE FURNACE       ������������������������CESR131583-04���G9MVE0401712A3������1636N------ A163549102��������������J¼S ���6ú S{���VAR SPD COMP VERSION����������������������������CESR131564-10���HVH824GKA101        23170812052�4217E01379              0aD
MallocArray commented 2 years ago

Following as I haven't been able to get serial monitoring working on a Raspberry Pi 4 docker container either. I was only seeing garbage on the output.

The latest version of Compose changed from docker-compose to docker compose so it will be some amount of transition since not everyone will upgrade right away.

LukeSkaff commented 2 years ago

@MallocArray, I was able to get infinitude to communicate over serial by installing/building it straight in Raspberry Pi OS (not using docker). So there is some issue with docker and serial or this build and docker.