Site Tools


projects:sms_via_ubuntu

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

projects:sms_via_ubuntu [2013/11/10 09:44]
brenda created
projects:sms_via_ubuntu [2013/11/10 09:48] (current)
brenda
Line 10: Line 10:
  
 The service centre number is in the phone, but had to be explicitly assigned to get the thing to work. I have left some unnecessary debugging info in the program. The service centre number is in the phone, but had to be explicitly assigned to get the thing to work. I have left some unnecessary debugging info in the program.
 +
 +<​code>​
 +#​!/​usr/​bin/​perl
 +
 +use Device::​Gsm;​
 +my $gsm = new Device::​Gsm( port => '/​dev/​ttyACM0',​ log =>
 +'file, /​home/​owen/​network.log',​ loglevel => '​debug'​);​ # Got to be writable. ​
 +
 +if( $gsm->​connect() ) {
 +print "​connected!\n";​
 +} else {
 +print "​sorry,​ no connection with gsm phone on serial port!\n";​
 +}
 +
 +my $imei = $gsm->​imei();​
 +print "imie is $imei\n";​
 +
 +my $model = $gsm->​model();​
 +print "Model is $model\n";​
 +
 +$srv_cnt = $gsm->​service_center();​
 +print "My service center number is: $srv_cnt\n";​
 +
 +# My service center number is: +CSCA: "", ​
 +my $ok = $gsm->​service_center('​+61418706700'​); ​ # Telstra'​s service center number
 +print "​Service center changed!\n"​ if $ok;
 +
 +$srv_cnt = $gsm->​service_center();​
 +print "My service center number is: $srv_cnt\n";​
 +
 +$gsm->​register();​
 +
 +$gsm->​send_sms(
 +recipient => '​+614********',​
 +content => 'Here is your Ubuntu talking',​
 +class => '​normal'​
 +);
 +</​code>​
projects/sms_via_ubuntu.txt ยท Last modified: 2013/11/10 09:48 by brenda