mirror of
https://github.com/Ysurac/openmptcprouter-feeds.git
synced 2025-03-09 15:40:03 +00:00
16 lines
No EOL
332 B
Lua
16 lines
No EOL
332 B
Lua
common_path = '/usr/share/gpoint/lib/?.lua;'
|
|
package.path = common_path .. package.path
|
|
|
|
serial = require("serial")
|
|
|
|
function serial_read(port)
|
|
local err, data = serial.read(port)
|
|
assert(err, data)
|
|
print("Error data: OK")
|
|
assert(data)
|
|
print("Data from serial: OK")
|
|
end
|
|
local port = "/dev/ttyUSB1"
|
|
serial_read(port)
|
|
|
|
print("OK") |