Go Down

Topic: An old Itead 3G modem works now with the Mega2560 (Read 957 times) previous topic - next topic

LMI1

This is for all those who bought an 3G modem from Itead in China.

I once bought an 3G modem from Itead. They do not sell that model any more for a good reason. The board is badly designed and does not have any SW support. Itead has a new model and I hope it is fully compatible with Arduino GSM library, or it will cause it's users a great deal trouble like mine did to me. The next modem I buy is a genuine Arduino modem.

I use HWserial1 for communicating with the modem. I soldered serial wires directly to boards, that way I could be certain which goes where. The default baud speed of the modem is 115,2kB. Itead or their HW designer forgot to mention it. For real work you should lower it with At commands to the GSM module.

You have to download SIM com datasheets for the SIM5216E. There they list the exact commands the module on this shield uses. SIMCOM's wepsite was too busy to answer today.

The Sim card holder is to too close to the connector, you have to take a corner off from your SIM card. The USB connector is too high. It may short something in the Mega board.

The listing shows the program I used to wake up and test the modem. You have to press the power and reset buttons yourself to wake up the modem. After that you can give AT commands to modem.
Code: [Select]

/**
Serial. It communicates on digital pins 0 (RX) and 1 (TX)
The Arduino Mega has three additional serial ports:
Serial1 on pins 19 (RX) and 18 (TX),
Serial2 on pins 17 (RX) and 16 (TX),
Serial3 on pins 15 (RX) and 14 (TX).
**/
int incomingByte = 0;
int outgoingByte = 0;
int tokab=0;

void setup(){
  Serial.begin(9600);
  Serial1.begin(115200);
  //Serial2.begin(19200);
  //Serial3.begin(4800);
delay(1000);
  Serial.println("Hello Computer");
  Serial1.println("Hello Serial 1");
  //Serial2.println("Hello Serial 2");
  //Serial3.println("Hello Serial 3");
  Serial.println("5");
  delay(5000);
  incomingByte = Serial1.read();
 while(incomingByte  != -1)
 {
  incomingByte = Serial1.read();
  Serial.write(incomingByte);
  while (Serial.available() > 0)
    {
   outgoingByte = Serial.read();
   Serial1.write(outgoingByte);
   Serial.write(outgoingByte);
    }
}
}

void loop() {
 while(Serial1.available() > 0)
 {
  incomingByte = Serial1.read();
  Serial.write(incomingByte);
}
  while (Serial.available() > 0)
    {
   outgoingByte = Serial.read();
   Serial1.write(outgoingByte);
   Serial.write(outgoingByte);
    }
}

The final code runs at 38kbauds and it is long and ugly so I won't post it here.

Go Up