Skip to content

Ruby interface to AT-compatible GSM modems

Notifications You must be signed in to change notification settings

mollat/rubygsm

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

79 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

RubyGSM is a Ruby library which uses serialport to provide a nifty interface to send and receive SMS messages via a GSM modem.

This fork is useful if you want to send sms with Unicode Characters (UCS2)

However - it is not tested for receiving SMS in UCS2 mode. If you test it - please let me know… ;)

Sample Usage

#not tested yet in UCS2 mode
class ReverseApp
    def initialize(gsm)
        gsm.receive(method(:incoming))
        @gsm = gsm
    end

    def incoming(from, datetime, message)
        @gsm.send(from, message.reverse)
    end
end

gsm = Gsm::Modem.new("/dev/tty.usbserial")
ReverseApp.new(gsm)

If you just want to send sms

gsm = Gsm::Modem.new("/dev/tty.usbserial")
msg = Gsm::Outgoing.new(gsm, "+447777777777", "Oh hai")
msg.send!

If you want to send sms with (not more than 70) unicode chars

gsm = Gsm::Modem.new("/dev/tty.usbserial", ucs2: true)
gsm.send_sms(gsm, "+447777777777", "These are german umlauts: ÖÄÜ öäü!")

Installing

$ gem sources -a http://gems.github.com
$ sudo gem install serialport
$ sudo gem install mollat-rubygsm

Building gem

$ gem build rubygsm.gemspec

Known issues

There is a known issue when you try to send message to shortcode. Enble :debug to see problem.

Devices Tested

  • XS Stick W21

  • Multitech MTCBA

  • Wavecom M1306B

  • Huawei E1752

About

Ruby interface to AT-compatible GSM modems

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Ruby 100.0%