EmbDev.net

Forum: µC & Digital Electronics arduino uno + gsm shield with gsm.h and wire.h not compatible?


von Gilbert (Guest)


Rate this post
useful
not useful
Hi,

I have written a program that uses the gsm shield (with library gsm.h) 
for sms and the i2c library wire.h for receiving sensor data.

Running the program without the wire.h library and WITHOUT using 
"wire.begin()" runs just fine, but by uncommenting the statenments 
"#include <wire.h>" and "wire.begin() inside the setup loop the 
controller does not get past the line of initialzing the gsm shield and 
hangs. Sometimes even after several retrys I get garbeled glyphs on the 
screen as if both libraries try to use the same memory space.

Has any one had that problem and therefore a solution to it?

Here is may code snipplet of the above area:

// initialize the library instance
GSM gsmAccess(debug);
GSM_SMS sms;
DateTime time;





void setup(){
Wire.begin();
RTC.begin();
Serial.begin(9600);

pinMode(VoltPin, INPUT);
pinMode(LedPin_connected, OUTPUT);
pinMode(LedPin_not_connected, OUTPUT);
digitalWrite(LedPin_connected, LOW);
digitalWrite(LedPin_not_connected, HIGH);
delay(50);

//Zeit setzen
while(uhrzeitformat == 0)
  {
  Uhrzeiteingabe(uhrzeit);
  uhrzeitformat = analysiereFormat_uhrzeit(uhrzeit,  &stunden, 
&minuten,  &sekunden);//Ausgabe 1 = ok, 0 = falsch
  }
Serial.print("Uhrzeit ");Serial.println(uhrzeit);
Serial.print("Stunde: ");Serial.println(stunden);
Serial.print("Minute: ");Serial.println(minuten);
Serial.print("Sekunde: ");Serial.println(sekunden);
/*setTime(stunden, minuten, sekunden,Tag,Monat,Jahr);
Serial.print("Stunde: ");Serial.println(hour(t));
Serial.print("Minute: ");Serial.println(minute(t));
Serial.print("Sekunde: ");Serial.println(second(t));*/

if(testmodus==0)
  {
  Serial.println("Initialisiere GSM....");



  // connection state
  boolean notConnected = true;

  // Start GSM connection
  while(notConnected)
  {
    if(gsmAccess.begin(PINNUMBER)==GSM_READY)
      notConnected = false;
    else
    {
      Serial.println("Not connected");
      delay(1000);
    }
  }

  Serial.println("GSM initialized");

Any help is highly appreciated!
Thanks from Germany

Gilbert

Please log in before posting. Registration is free and takes only a minute.
Existing account
Do you have a Google/GoogleMail account? No registration required!
Log in with Google account
No account? Register here.