diff --git a/smartmeter.rb b/smartmeter.rb index 666bc83..127a6c9 100644 --- a/smartmeter.rb +++ b/smartmeter.rb @@ -22,6 +22,8 @@ def open_device rescue p "Serialport Error - reverting to 'example_blurp.txt'" io_device = File.open("example_blurp.txt") + # start at random place in the file + io_device.seek(rand(1500), IO::SEEK_SET) end return io_device end