Re: gestire la seriale in perl
--- giusans@email.it wrote:
>
>
> Vorrei gestire la seriale in perl:
>
> #!/usr/bin/perl -w
>
> use Device::SerialPort;
> $Port = new Device::SerialPort("/dev/ttys0");
> $Port->baudrate(9600);
> $Port->parity("none");
> $Port->databits(8);
> $Port->stopbits(1);
> $Port->handshake("none");
> $Port->write_settings;
>
> #scrivi il dato
>
> $Port->write("ciao");
> &delay();
>
> Purtroppo una volta lanciata mi dà i seguenti errori:
>
> Can't open device: /dev/ttys0 at rs232.pl line4
> Can't call metod "baudrate" on an udefined value at rs232.pl line6
> debian:/home/giuseppe/prova
>
> Ho dato tutti i permessi con
> chmod 777 sia al file in questione(rs232.pl) che a /dev/ttys0.
> Ho installato i seguenti pacchetti:
> Libdevice-Serialport-perl
> Setserial
>
Con che utenza fai il tutto??
Prova da root !!!
Walter
___________________________________
Nuovo Yahoo! Messenger: E' molto più divertente: Audibles, Avatar, Webcam, Giochi, Rubrica? Scaricalo ora!
http://it.messenger.yahoo.it
Reply to: