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… ;)
#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: ÖÄÜ öäü!")
$ gem sources -a http://gems.github.com $ sudo gem install serialport $ sudo gem install mollat-rubygsm
$ gem build rubygsm.gemspec
There is a known issue when you try to send message to shortcode. Enble :debug to see problem.
-
XS Stick W21
-
Multitech MTCBA
-
Wavecom M1306B
-
Huawei E1752