Fixes for new environment
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user