This forum uses cookies
This forum makes use of cookies to store your login information if you are registered, and your last visit if you are not. Cookies are small text documents stored on your computer; the cookies set by this forum can only be used on this website and pose no security risk. Cookies on this forum also track the specific topics you have read and when you last read them. Please confirm that you accept these cookies being set.

Port name issue
#2
If you only have a single USB converter you can use a function to find port name:
Code:
function findttyusb()
  for _, dev in ipairs(io.ls('/dev')) do
    if dev:find('ttyUSB') then
      return '/dev/' .. dev
    end
  end
end

tty = findttyusb()

if tty then
  require('serial')
  port = serial.open(tty)
end
Reply


Messages In This Thread
Port name issue - by oveh - 20.04.2019, 15:19
RE: Port name issue - by admin - 23.04.2019, 07:00

Forum Jump: