communication problem (Ethernet shield and EFCom GPRS/GSM Shield)

Hello,

I have two shields (http://www.elecfreaks.com/wiki/index.php?title=EFCom_GPRS/GSM_Shield and Ethernet Shield Wiznet 5100). Both work pretty well, but if I connect to the internet (Ethernet.begin ()), I can not send SMS or call.

If I have a cable connected and not start internet (Ethernet.begin ()). Calling and sms works perfectly.

P.S. I have Arduino Mega 2560

Any idea for solve this problem?

Sorry for my bad english.

Thank you for your reply.

Power could be an issue. Both devices require a bit of current.

But as far as interfacing, the Mega 2560 has some software serial limitations last I heard. If you are using software serial (D2 and D3), the Mega may have problems.

This is from the software serial reference:

Not all pins on the Mega and Mega 2560 support change interrupts, so only the following can be used for RX: 10, 11, 12, 13, 14, 15, 50, 51, 52, 53, A8 (62), A9 (63), A10 (64), A11 (65), A12 (66), A13 (67), A14 (68), A15 (69).

Thanks for your reply.

I use pin 50 and 51 communication works well, but when I use the command Ethernet.begin() communication with GSM Shield stops working.

You can't use D50-D53 with the ethernet shield. Those are the SPI data lines. They are duplicated on the ICSP connector.

I would use hardware serial on the Mega. Use Serial1 instead.

When i used RX1 TX1 -> RX TX on gsm shield. GSM shield still does not work.

Are you changing the code from mySerial to Serial1?

Yes, I changed it.

Maybe you should post the code you are trying.

Class GSM Shield:

void GSMShield::sendSMS(String text) {
    Serial1.begin(19200);
    delay(1000); //Wait for a second while the modem sends an "OK"
    Serial1.println("AT+CMGF=1"); //Because we want to send the SMS in text mode
    delay(1000);
    Serial1.println("AT+CMGS=\"+xxxxxxxxxxx\""); //Start accepting the text for the message
    //to be sent to the number specified.
    //Replace this number with the target mobile number.
    delay(1000);
    Serial1.println(text);
    delay(1000);
    Serial1.print("\x1A");
    Serial.println("Send sms");
    delay(5000);
}

Class Ethernet Shield:

void Internet::connectToInternet() {
    Ethernet.begin(mac, ip);
    if(client.connect(gateway, 80)) {
        Serial.println("SUCCESS: I have internet connection");
    } else {
        Serial.println("ERROR: I don't have internet connection. I will try new connection.");
        delay(10000);
        this->connectToInternet();
    }
}

Main code:

Internet internet;
GSMShield gsm;

void setup() {
    Serial.begin(19200);
    pinMode(6, OUTPUT);
    internet.connectToInternet();
    digitalWrite(6, HIGH); // Power on GSM shield
    delay(10000); // wait for connect to gsm network
    gsm.sendSms("Any text")
}

You only need to start Serial1 once, just like Serial.

void setup() {
    Serial.begin(19200);
    Serial1.begin(19200);
 
   pinMode(6, OUTPUT);
    internet.connectToInternet();
    digitalWrite(6, HIGH); // Power on GSM shield
    delay(10000); // wait for connect to gsm network
    gsm.sendSms("Any text")
}

You are not reading the response from the modem, so it will be almost impossible to troubleshoot.

    delay(1000); //Wait for a second while the modem sends an "OK"

What if it isn't sending an "OK"?

Helda:
When i used RX1 TX1 -> RX TX on gsm shield. GSM shield still does not work.

Did you change the jumpers on the shield?

Jumpers changed. I communicate with gsm Shield, but respond from gsm shield is !ïØkoÌ etc. Serial.begin(19200); Serial monitor = baudrate 19200