roc has asked for the wisdom of the Perl Monks concerning the following question:
hi every one...i have a cgi script to send sms as follow...
use CGI; use Device::Gsm; my $qu = new CGI; my @num = $qu->param("num"); my @msg = $qu->param("message"); print "Content-type:text/html\n\n"; my $gsm = new Device::Gsm( port => '/dev/ttyACM0', pin => '0000' , log + => 'file,network.log', loglevel => 'debug'); if( $gsm->connect() ) { #line no.14 print "connected!\n"; } else { print "sorry, no connection with gsm phone on serial port!\n"; } $gsm->register(); $gsm->send_sms( recipient => "$num[0]", content => "$msg[0]", class => 'normal');
im using frdora 12 ....when i run the script as root(su -l root -c "/usr/bin/perl /path/to/script/script.cgi") then script giving the output as "connected" in command line.. but as user(su -l user -c "/usr/bin/perl /path/to/script/script.cgi") its giving error as "Not connected at /path/to/script/script.cgi line 14" ...
the file is under 755 permission. i tried 'su -l user -c "strace -f /usr/bin/perl /path/to/script/script.cgi"'...it's giving 'open("/dev/ttyACM0", O_RDWR|O_NOCTTY|O_NONBLOCK|O_LARGEFILE) = -1 EACCES (Permission denied)....how to fix this problem...i mean how to make the script to work under user...please give me some suggestion to fix this..
------------------------------------------------Update
hey...thanks a lot...the problem solved...i gave 777 permission to /dev/ttyacm0......then its working fine...
| Replies are listed 'Best First'. | |
|---|---|
|
Re: GSM problem
by choroba (Cardinal) on Apr 23, 2010 at 11:51 UTC | |
|
Re: GSM problem
by almut (Canon) on Apr 23, 2010 at 11:53 UTC | |
by Anonymous Monk on Apr 23, 2010 at 13:22 UTC | |
|
Re: GSM problem
by wazoox (Prior) on Apr 23, 2010 at 11:48 UTC | |
by choroba (Cardinal) on Apr 23, 2010 at 11:53 UTC |