:Using the GSM module to send a message
Required PartsWe'll need the following parts:
|Raspberry Pi||RS 8111284|
|RasPiComm+ GSM Module||TBA|
|Sim-Card||GSM Antenna||RS 793-4357||SMA Coaxial Cable||DK 931-1098-ND|
- Hardware Setup
Let's get our gear in place!
- Software Setup
If you haven't already, download the Setup-Script:
and make it executable:
Then execute the automated setup
chmod +x rpc+setup.sh
- Using the GSM module
Let's activate the GSM module in slot 3:
The GSM module's LED will start to blink. Our Linux drivers have installed the GSM module as a serial device, available under /dev/ttyRPC+X, whereas X depends on the module slot and on how many serial ports are connected.
echo 1 > /proc/rpc+/module3/enable_gsm
Module Slot tty Slot 1 /dev/ttyRPC+0
Slot 2 /dev/ttyRPC+2
Slot 3 /dev/ttyRPC+4
Slot 4 /dev/ttyRPC+6
In our example the GSM-module is located in slot 3, which means we can adress it with /dev/ttyRPC+4. I will access it with the screen terminal. You could also use echo commands (if you do, make sure you don't supress the newline, it activates the commands!).
Upon activating the screen terminal at a baud rate of 9600 with
the GSM module is awaiting our AT commands (full list here).
screen /dev/ttyRPC+4 9600
Let's try one!
and pressing Enter will activate verbose messages. Always a good thing.
where 'xxxx' is your SIM-card's PIN.
Strength indication dBm 0 -115 dBm or less 1 -110 dBm 2-30 -110 to -54 dBm 31 -52 dBm or greater 99 not known or detectable
- Sending an SMS
Let's activate text mode instead of PDU mode first
where recipient = the phone number you want to write the message to. You will need the quotes for the command to work!
tells us that sending the message with the number xx was sent successfully. If something went wrong, we'd be seeing
instead. Looking at the phone:
+CMS ERROR: xx
- Quitting Screen
To get back to your linux prompt, press
(grey bar at bottom of your screen) and press Enter.
If you have questions or feedback, please check out the following Resources:
|IndieGoGo Campaign||IndieGoGo Campaign|
|RasPiComm+ Support Forum||Official RasPiComm+ Support Forum|