Skip Menu |

This queue is for tickets about the Device-Gsm CPAN distribution.

Report information
The Basics
Id: 61729
Status: resolved
Worked: 1 hour (60 min)
Priority: 0/
Queue: Device-Gsm

People
Owner: cosimo [...] cpan.org
Requestors: bivanov [...] setcom.eu
Cc:
AdminCc:

Bug Information
Severity: (no value)
Broken in: (no value)
Fixed in: (no value)



Subject: I found bug
Date: Tue, 28 Sep 2010 18:44:29 +0100
To: "bug-device-gsm [...] rt.cpan.org" <bug-device-gsm [...] rt.cpan.org>
From: "Boris Ivanov" <bivanov [...] setcom.eu>
Please answer if you interested to fix it. Thanks. Show quoted text
____________________________________________________________ This message and any attachments contain confidential information and must not be disclosed to a third party without the prior written consent of setcom. If you have received it erroneously, please discard it and contact us by return.
____________________________________________________________
Show quoted text
> Please answer if you interested to fix it.
Sure I am. Go on.
Subject: RE: [rt.cpan.org #61729] I found bug
Date: Wed, 29 Sep 2010 13:43:54 +0100
To: "bug-Device-Gsm [...] rt.cpan.org" <bug-Device-Gsm [...] rt.cpan.org>
From: "Boris Ivanov" <bivanov [...] setcom.eu>
Hallo OS: Centos 5. 32bit. Device is /dev/ttyS1 My Script: #!/usr/local/bin/perl -w use Device::Gsm; my $gsm = Device::Gsm->new(port => '/dev/ttyS1', log=>'syslog'); $gsm->connect(baudrate => 9600) or die "Can't connect!"; #$gsm->register() or die "cannot register"; my $sent = $gsm->send_sms( content => "Lets Go!\n", # SMS text recipient => "+49XXXXXXXX", # recipient phone number mode => 'text', class => 'normal', ); if( $sent ) { print "OK!"; } else { print "Troubles..."; } My Device: old Samsung SGH-S100 connected over serial cable. Issues: 1. register never work. Phone sends back ERROR. I don’t need register anyway(Entered PIN after switching on the phone). So I ended up with my register function like this: my $lOk = 1; $me->{'REGISTERED'} = $lOk; return $lOk; 2. Delay at sending. I think its timing issues due to fact that you was using slower pc while developing this module. When I sent sms from terminal it was no problem but programmatically I got "Troubles..." AT+CMGS="+49XXX..XXX"<CR> Here after small delay comes : ">" and then we type message and press "CR": And SMS send. But in sub _send_sms_text { $me->atsend( qq[AT+CMGS="$num"] . Device::Modem::CR ); # Encode text $text = Device::Gsm::Charset::iso8859_to_gsm0338( $text ); # Complete message sending $me->atsend( $text . Device::Modem::CTRL_Z ); There no delay waiting for ">" as result immediately "Error". So I added $cReply = $me->answer('>', 2000); after first atsend to fix problem. 3. Is it possible to log into normal file, not syslog? My syslog working with -r key and nothing logged. Thanks Boris. Show quoted text
-----Original Message----- From: Cosimo Streppone via RT [mailto:bug-Device-Gsm@rt.cpan.org] Sent: Wednesday, September 29, 2010 2:13 PM To: bivanov@setcom.eu Subject: [rt.cpan.org #61729] I found bug <URL: https://rt.cpan.org/Ticket/Display.html?id=61729 >
> Please answer if you interested to fix it.
Sure I am. Go on.
____________________________________________________________ This message and any attachments contain confidential information and must not be disclosed to a third party without the prior written consent of setcom. If you have received it erroneously, please discard it and contact us by return.
____________________________________________________________
On Wed Sep 29 08:44:05 2010, bivanov@setcom.eu wrote: Show quoted text
> Issues:
Hi Boris, thanks for your feedback! Sorry for the late reply. Show quoted text
> 1. register never work. Phone sends > back ERROR. I don’t need register anyway(Entered PIN after switching > on the phone).
I'm not sure what to do here. Maybe an option to tell Device::Gsm to never attempt registration, and consider the phone already registered? Show quoted text
> 2. Delay at sending. I think its timing issues due to fact that you
was using slower pc while developing this module. Yes definitely :) Show quoted text
> When I sent sms from terminal > it was no problem but programmatically I got "Troubles..." > AT+CMGS="+49XXX..XXX"<CR> > Here after small delay comes : ">" and then > we type message and press "CR": > And SMS send. > But in > > sub > _send_sms_text { > > $me->atsend( qq[AT+CMGS="$num"] . > Device::Modem::CR ); > # Encode text > $text = > Device::Gsm::Charset::iso8859_to_gsm0338( $text ); > # Complete > message sending > $me->atsend( $text . Device::Modem::CTRL_Z ); > There no delay waiting for ">" as result immediately "Error". > So I > added $cReply = $me->answer('>', 2000); after first atsend to fix > problem.
I don't know if all phones send a '>' character. A short delay should be sufficient. Can you try with '$me->wait(250)' after the first atsend()? Show quoted text
> 3. Is it possible to log into normal file, not syslog? My > syslog working with -r key and nothing logged.
Yes, it's possible. Look at the documentation and examples. my $gsm = Device::Gsm->new( log => 'file,/tmp/myfile.log', ); Let me know, and thanks!
Subject: Re: [rt.cpan.org #61729] I found bug
Date: Mon, 15 Nov 2010 17:47:46 +0100
To: bug-Device-Gsm [...] rt.cpan.org
From: Boris Ivanov <bivanov [...] setcom.eu>
Hi Cosimo Thanks that you found time. On Nov 15, 2010, at 3:50 PM, Cosimo Streppone via RT wrote: Show quoted text
> <URL: https://rt.cpan.org/Ticket/Display.html?id=61729 > > > On Wed Sep 29 08:44:05 2010, bivanov@setcom.eu wrote: >
>> Issues:
> > Hi Boris, thanks for your feedback! > Sorry for the late reply. >
>> 1. register never work. Phone sends >> back ERROR. I don’t need register anyway(Entered PIN after switching >> on the phone).
> > I'm not sure what to do here. > Maybe an option to tell Device::Gsm to never attempt registration, > and con
Show quoted text
> sider the phone already registered?
Yes, I think that's best. You have separate register command anyway. Show quoted text
>
>> 2. Delay at sending. I think its timing issues due to fact that you
> was using slower pc while developing this module. > > Yes definitely :) >
>> When I sent sms from terminal >> it was no problem but programmatically I got "Troubles..." >> AT+CMGS="+49XXX..XXX"<CR> >> Here after small delay comes : ">" and then >> we type message and press "CR": >> And SMS send. >> But in >> >> sub >> _send_sms_text { >> >> $me->atsend( qq[AT+CMGS="$num"] . >> Device::Modem::CR ); >> # Encode text >> $text = >> Device::Gsm::Charset::iso8859_to_gsm0338( $text ); >> # Complete >> message sending >> $me->atsend( $text . Device::Modem::CTRL_Z ); >> There no delay waiting for ">" as result immediately "Error". >> So I >> added $cReply = $me->answer('>', 2000); after first atsend to fix >> problem.
> > I don't know if all phones send a '>' character. > A short delay should be sufficient.
Very good. Please add that delay. Show quoted text
> > Can you try with '$me->wait(250)' after the first atsend()? >
>> 3. Is it possible to log into normal file, not syslog? My >> syslog working with -r key and nothing logged.
> > Yes, it's possible. Look at the documentation and examples. > > my $gsm = Device::Gsm->new( > log => 'file,/tmp/myfile.log', > ); > > Let me know, and thanks!
Thank you. Documentation has only 1 example with syslog.(Unless Im blind) Your example of "file, " wasnt really obvious for me :) Your module working fine since September after some hacking. Boris Show quoted text
____________________________________________________________ This message and any attachments contain confidential information and must not be disclosed to a third party without the prior written consent of setcom. If you have received it erroneously, please discard it and contact us by return.
____________________________________________________________
Should be fixed in v1.56, just uploaded to CPAN. https://github.com/cosimo/perl5-device-gsm/tree/CPAN-v1.56 Also, I have added a "assume_registered" option, as: my $gsm = Device::Gsm->new( port => "/dev/ttyS0", assume_registered => 1, ); Please confirm it works correctly for you. Cheers,