Fixes for new environment

This commit is contained in:
PCOG sites
2014-07-15 17:52:49 +02:00
parent 516e09bfba
commit bab08f987d
9 changed files with 19 additions and 11 deletions

View File

@@ -1,4 +1,4 @@
require "rubygems"
#require "rubygems"
require "bundler/setup"
require "active_record"
require "serialport"
@@ -8,6 +8,7 @@ MAX_BYTES = 100
project_root = File.dirname(File.absolute_path(__FILE__))
Dir.glob(project_root + "/app/models/*.rb").each{|f| require f}
Dir.glob(project_root + "/app/helpers/SearchingForSyncState.rb").each{|f| require f}
Dir.glob(project_root + "/app/helpers/*.rb").each{|f| require f}
connection_details = YAML::load(File.open('config/database.yml'))
@@ -16,7 +17,7 @@ ActiveRecord::Base.establish_connection(connection_details)
def open_device
begin
# Open connection to serial port
io_device = SerialPort.new("/dev/ttyUSB1", 9600, 7, 1, SerialPort::EVEN)
io_device = SerialPort.new("/dev/ttyUSB0", 9600, 7, 1, SerialPort::EVEN)
# Make reading blocking
io_device.read_timeout = 0
rescue