This package uses a serialport to communicate with the SIM900 GSM Modem.
- You'll need Golang v1.3+
- SIM900 Package uses the serial package in order to communicate with the modem via AT commands, you will need to install both SIM900 and serial packages.
go get github.com/argandas/serial # installs the serial package
go get github.com/argandas/sim900 # installs the SIM900 package
-
You'll need an available serial port, SIM900 boards usually works with 5V TTL signals so you can get a USB-to-Serial TTL converter, I recommend you to use the FTDI Cable for this, but you can use any USB-to-Serial adapters there are plenty of them.
package main
import "github.com/argandas/sim900"
func main() {
gsm := sim900.New()
err := gsm.Setup("COM1", 9600)
if err != nil {
panic(err)
}
defer gsm.Teardown()
phoneNumber := "XXXXXXXXXX" // The number to send the SMS
gsm.SendSMS(phoneNumber, "Hello World!")
}
- List of available SIM900 commands can be found here.
- For more information about available SIM900 methods please check godoc for this package.
Go explore!
SIM900 package is MIT-Licensed