Hello
I wanted to start a small project with a gsm module
would I have read through some posts but unfortunately I’m not a simple task I manage to send a sms
someone has an idea what I’m doing here wrong
1 step: cellularRadio.PowerOn(50);
2 step: sending pin
3 step: wait if the modul ist registered
4 step: send sms cellularRadio.SendSms(“4915019855555”, “test”);
public partial class Program
{
void ProgramStarted()
{
joystick.JoystickPressed += new Joystick.JoystickEventHandler(joystick_JoystickPressed);
joystick.JoystickReleased += new Joystick.JoystickEventHandler(joystick_JoystickReleased);
button.ButtonPressed += new Button.ButtonEventHandler(button_ButtonPressed);
cellularRadio.DebugPrintEnabled = true;
cellularRadio.PowerOn(50);
cellularRadio.PinStateRetrieved += new CellularRadio.PinStateRetrievedHandler(cellularRadio_PinStateRetrieved);
cellularRadio.GsmNetworkRegistrationChanged += new CellularRadio.GsmNetworkRegistrationChangedHandler(cellularRadio_GsmNetworkRegistrationChanged);
Debug.Print("Program Started");
}
void cellularRadio_GsmNetworkRegistrationChanged(CellularRadio sender, CellularRadio.NetworkRegistrationState networkState)
{
if(Enum.Equals(networkState, CellularRadio.NetworkRegistrationState.Registered))
{ Debug.Print("NetworkRegistrationState -->" + networkState.ToString()); }
Debug.Print("NetworkRegistrationState ++>" + networkState.ToString());
}
void cellularRadio_PinStateRetrieved(CellularRadio sender, CellularRadio.PINState pinState)
{
if (Enum.Equals(pinState, CellularRadio.PINState.PIN ))
{ Debug.Print("Module initialized, sending PIN...");
cellularRadio.SendATCommand("AT+CPIN=9551");
}
}
void button_ButtonPressed(Button sender, Button.ButtonState state)
{
if (button.IsLedOn) button.TurnLEDOff();
else button.TurnLEDOn();
cellularRadio.SendSms("491501985555", "test");
}
void joystick_JoystickReleased(Joystick sender, Joystick.JoystickState state)
{
Debug.Print("joystick wurde los gelassen"); led7r.TurnLightOn(7);
}
The Output Monitor in Visual Studio says Error in the sending metode!!
Using mainboard GHIElectronics-FEZHydra version 1.2
Program Started
Der Thread '<Kein Name>' (0x3) hat mit Code 0 (0x0) geendet.
CellularRadio : Turning ON
CellularRadio : Turning module on
CellularRadio : <
RDY
>
CellularRadio : <
+CREG: 2
+CREG: 0
+CGREG: 0
+CFUN: 1
+CPIN: SIM PIN
>
Module initialized, sending PIN...
CellularRadio : <AT+CPIN=9551
>
CellularRadio : SENT: AT+CPIN=9551
NetworkRegistrationState ++>2
CellularRadio : <
OK
>
CellularRadio : <
+CREG: 2
>
NetworkRegistrationState ++>2
CellularRadio : SENT: AT
CellularRadio : <AT
OK
>
CellularRadio : SENT: AT+CMGF=1
CellularRadio : <AT+CMGF=1
OK
>
CellularRadio : SENT: AT+CSDH=0
CellularRadio : <AT+CSDH=0
OK
>
CellularRadio : SENT: AT+CPBS="SM"
CellularRadio : <AT+CPBS="SM"
OK
>
CellularRadio : SENT: AT+CPMS="SM"
CellularRadio : <AT+CPMS="SM"
>
CellularRadio : SENT: AT+CNMI=2,1,0,1,0
CellularRadio : SENT: AT+COLP=1
CellularRadio : <
+CPMS: 0,20,0,20,0,20
OK
AT+CGREG=1
OK
>
CellularRadio : SENT: AT+CGREG=1
CellularRadio : <AT+CREG=1
OK
>
CellularRadio : SENT: AT+CREG=1
Der Thread '<Kein Name>' (0x6) hat mit Code 0 (0x0) geendet.
CellularRadio : <
Call Ready
>
CellularRadio : <
+CGREG: 2
>
CellularRadio : <
+CREG: 1
>
NetworkRegistrationState -->1
NetworkRegistrationState ++>1
CellularRadio : <
+CGREG: 0
>
CellularRadio : <AT+CMGS="+491501985555"
> >
CellularRadio : <test>
CellularRadio : <
ERROR
>
CellularRadio : <AT+CMGS="+491501985555"
> test>
CellularRadio : <
ERROR
>
Das Programm "[13] Micro Framework application: Verwaltet" wurde mit Code 0 (0x0) beendet.
I forget somthing?!
Or i have the wrong driver
Many thanks for every tip!!