#!/usr/bin/perl -w use strict; use warnings; use Device::SerialPort; my $port = Device::SerialPort->new("/dev/ttyUSB0"); $port->databits(8); $port->baudrate(115200); $port->parity("none"); $port->stopbits(1); $port->handshake("on"); $port->write_settings; $port->write(chr(254)); $port->write(chr(27)); my $char = $port->lookfor(); if ($char) { print "$char"; }