Skip to content

Commit

Permalink
Merge pull request #333 from OpenSprinkler/dev/221_1
Browse files Browse the repository at this point in the history
Firmware 2.2.1(1)
  • Loading branch information
rayshobby authored Mar 6, 2025
2 parents 0e2a68b + 5ea814a commit 20991dc
Show file tree
Hide file tree
Showing 31 changed files with 2,550 additions and 1,116 deletions.
24 changes: 4 additions & 20 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -3,44 +3,28 @@ FROM debian:bookworm-slim AS base
ARG BUILD_VERSION="OSPI"

########################################
## 1st stage compiles OpenSprinkler runtime dependency raspi-gpio
FROM base AS raspi-gpio-build

ENV DEBIAN_FRONTEND=noninteractive
RUN apt-get update
RUN apt-get install -y git gcc make automake
RUN rm -rf /var/lib/apt/lists/*
RUN mkdir /raspi-gpio
WORKDIR /raspi-gpio
RUN git clone --depth 1 https://github.com/RPi-Distro/raspi-gpio.git .
RUN autoreconf -f -i
RUN (./configure || cat config.log)
RUN make

########################################
## 2nd stage compiles OpenSprinkler code
## 1st stage compiles OpenSprinkler code
FROM base AS os-build

ENV DEBIAN_FRONTEND=noninteractive
RUN apt-get update && apt-get install -y bash g++ make libmosquittopp-dev libssl-dev
RUN apt-get update && apt-get install -y bash g++ make libmosquittopp-dev libssl-dev libi2c-dev libgpiod-dev libgpiod2 gpiod
RUN rm -rf /var/lib/apt/lists/*
COPY . /OpenSprinkler
WORKDIR /OpenSprinkler
RUN make clean
RUN make VERSION=${BUILD_VERSION}

########################################
## 3rd stage is minimal runtime + executable
## 2nd stage is minimal runtime + executable
FROM base

ENV DEBIAN_FRONTEND=noninteractive
RUN apt-get update && apt-get install -y libstdc++6 libmosquittopp1
RUN apt-get update && apt-get install -y libstdc++6 libmosquittopp1 libi2c0 libgpiod2
RUN rm -rf /var/lib/apt/lists/*
RUN mkdir /OpenSprinkler
RUN mkdir -p /data/logs

COPY --from=os-build /OpenSprinkler/OpenSprinkler /OpenSprinkler/OpenSprinkler
COPY --from=raspi-gpio-build /raspi-gpio/raspi-gpio /usr/bin/raspi-gpio
WORKDIR /OpenSprinkler

#-- Logs and config information go into the volume on /data
Expand Down
6 changes: 3 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
CXX=g++
# -std=gnu++17
VERSION=OSPI
VERSION?=OSPI
CXXFLAGS=-std=gnu++14 -D$(VERSION) -DSMTP_OPENSSL -Wall -include string.h -include cstdint -Iexternal/TinyWebsockets/tiny_websockets_lib/include -Iexternal/OpenThings-Framework-Firmware-Library/
LD=$(CXX)
LIBS=pthread mosquitto ssl crypto
LIBS=pthread mosquitto ssl crypto i2c gpiod
LDFLAGS=$(addprefix -l,$(LIBS))
BINARY=OpenSprinkler
SOURCES=main.cpp OpenSprinkler.cpp program.cpp opensprinkler_server.cpp utils.cpp weather.cpp gpio.cpp mqtt.cpp smtp.c $(wildcard external/TinyWebsockets/tiny_websockets_lib/src/*.cpp) $(wildcard external/OpenThings-Framework-Firmware-Library/*.cpp)
SOURCES=main.cpp OpenSprinkler.cpp notifier.cpp program.cpp opensprinkler_server.cpp utils.cpp weather.cpp gpio.cpp mqtt.cpp smtp.c RCSwitch.cpp $(wildcard external/TinyWebsockets/tiny_websockets_lib/src/*.cpp) $(wildcard external/OpenThings-Framework-Firmware-Library/*.cpp)
HEADERS=$(wildcard *.h) $(wildcard *.hpp)
OBJECTS=$(addsuffix .o,$(basename $(SOURCES)))

Expand Down
Loading

0 comments on commit 20991dc

Please sign in to comment.