I'd like to connect to 3G modem using Ruby and the serialport gem.
My Ruby code:
require 'serialport'
class GSM
sp = SerialPort.new('COM7', 9600)
sp.read_timeout = 1500
sp.write "AT\r\n"
puts sp.read
end
I get this error after starting my script:
serialport.rb:25:in `create': Permission denied - \\.\COM7 (Errno::EACCES)
The IDE is run under administrator and the COM port is available from Putty and works fine. (I close Putty before running the script.)