configuration updates

This commit is contained in:
2022-01-09 18:49:26 +01:00
parent b67fbc21d1
commit 6867f5260e
3 changed files with 7 additions and 4 deletions

View File

@@ -1,7 +1,8 @@
#require 'rubygems'
require 'daemons'
pwd = Dir.pwd
#pwd = Dir.pwd
pwd = '/home/pcog/smartmeter'
Daemons.run_proc('smartmeter', {:dir_mode => :normal, :dir => pwd+"/pids"}) do
Dir.chdir(pwd)
exec "ruby smartmeter.rb"

View File

@@ -3,7 +3,9 @@ services:
db:
container_name: smartmeter_db
restart: unless-stopped
image: mysql
image: mysql
volumes:
- /home/pcog/smartmeter/data:/var/lib/mysql
environment:
MYSQL_ROOT_PASSWORD: rootme
MYSQL_DATABASE: smartmeter
@@ -13,7 +15,7 @@ services:
build: .
command: 'ruby ./smartmeter.rb'
devices:
- "/dev/ttyUSB0:/dev/ttyUSB0"
- "/dev/ttyUSB1:/dev/ttyUSB0"
volumes:
- .:/usr/src/app
depends_on:

View File

@@ -17,7 +17,7 @@ ActiveRecord::Base.establish_connection(connection_details)
if __FILE__ == $0
#params for serial port
port_str = "/dev/ttyUSB0" #may be different for you
port_str = "/dev/ttyUSB1" #may be different for you
baud_rate = 9600
data_bits = 7
stop_bits = 1