Pages: [1]   Go Down
Author Topic: Issue with DLINE and UART  (Read 657 times)
0 Members and 1 Guest are viewing this topic.
Offline Offline
Sr. Member
****
Karma: 0
Posts: 368
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Dear All,
First I would like to list my Harware.
Arduino : https://www.sparkfun.com/products/11021
GPRS/GSM Module :  https://www.sparkfun.com/products/9607?
GPS Shield https://www.sparkfun.com/products/10710 with DLINE and UART switch
HPS https://www.sparkfun.com/products/465?

Firstly I assembled the arduino and the GPRS/GSM module and I added some sletch to push data to my ubuntu server. It's works fine!!
Secondely, I assembled the arduino and the GPS Shild with the GPS. I left the switch to the DLINE mode. I can upload code and run it. It's work on DLINE mode.

Lastly, I assembled the adruino with the GORS/GPS module on second position, and lastly the GPS Shield with the GPS.

From that point the DLINE/USRT mod make an issue. I can upload on DLINE mode, but I have to switch to UART to see my job.

I do not understand why I have to switch to UART while before I could run my GPS on DLINE mode, without the GPRS/GSM module.

I really need a solution to upload and run my code on DLINE mode.

Do you have some explication why when the 3 module are assembled, I need to swicth to UART?
Is there a solution to leave in DLINE mode at any time?

Many thank for your explication.

Cheers and nice day.
Logged

Il ne suffit pas de tout savoir, la persévérance, c'est déjà presque tout!

Offline Offline
Sr. Member
****
Karma: 0
Posts: 368
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

I discover some thing interesting.

I create a falk
//Create a 'fake' serial port. Pin 2 is the Rx pin, pin 3 is the Tx pin.
SoftwareSerial cell(2,3);

Then below, I am ready the at_buffer (Serial.println(at_buffer)smiley-wink.
Code:
/* Reads AT String from the SM5100B GSM/GPRS Module */
void readATString(void) {
  char c;
  buffidx= 0; // start at begninning
  while (1) {

    if(cell.available() > 0) {

      c=cell.read();
      if (c == -1) {
        Serial.print(F("true"));
        at_buffer[buffidx] = '\0';
        return;
      }
     
      if (c == '\n') {
         Serial.print(F("continue"));
        continue;
      }
     
      if ((buffidx == BUFFSIZ - 1) || (c == '\r')){
        Serial.print(F("true"));
        at_buffer[buffidx] = '\0';
        return;
      }

       at_buffer[buffidx++]= c;
       
       Serial.println(at_buffer);
     }
  }
}
on DLINE mode Serial.println(at_buffer); return something incoherent.
Quote
Starting SM5100B Communication...
`
`†
`†~
`†~˜
`†~˜
`†~˜
`†~˜
`†~˜
Quote
: 10,"SF,,0Ã~˜
+SIND: 10,"SF,,0Ã~˜
+SIND: 10,"SF,,0Ã~˜
+SIND: 10,"SF,,0Ã~˜
+SIND: 10,"SF,,0Ã~˜
+SIND: 10,"SF,,0Ã~˜
+SIND: 10,"SF,,0Ã~˜
+SIND: 10,"SF,,0Ã~˜
+SIND: 10,"SF,,0Ã~˜
+SIND: 10,"SF,,0Ã~˜
+SIND: 10,"SF,,0Ã~˜
+SIND: 10,"SF,,0Ã~˜
+SIND: 10,"SF,,0Ã~˜
+SIND: 10,"SF,,0Ã~˜
+SIND: 10,"SF,,0Ã~˜
+SIND: 10,"SF,,0Ã~˜
+SIND: 10,"SF,,0Ã~˜
+SIND: 10,"SF,,0Ã~˜
+SIND: 10,"SF,,0Ã~˜
+SIND: 10,"SF,,0Ã~˜
+SIND: 10,"SF,,0Ã~˜
+SIND: 10,"SF,,0Ã~˜
+SIND: 10,"SF,,0Ã~˜
+SIND: 10,"SF,,0Ã~˜
¡*WÉÑ¥¹SM5100B Communication...
0
0Ãþ˜
0Ãþ˜
0Ãþ˜

While in UART mode I got this
Code:
+SIND: 1
+SIND: 10
+SIND: 10,
+SIND: 10,"
+SIND: 10,"S
+SIND: 10,"SM
+SIND: 10,"SM"
+SIND: 10,"SM",
+SIND: 10,"SM",1
+SIND: 10,"SM",1,
+SIND: 10,"SM",1,"
+SIND: 10,"SM",1,"F
+SIND: 10,"SM",1,"FD
+SIND: 10,"SM",1,"FD"
+SIND: 10,"SM",1,"FD",
+SIND: 10,"SM",1,"FD",1
+SIND: 10,"SM",1,"FD",1,
+SIND: 10,"SM",1,"FD",1,"
+SIND: 10,"SM",1,"FD",1,"L
+SIND: 10,"SM",1,"FD",1,"LD
+SIND: 10,"SM",1,"FD",1,"LD"
+SIND: 10,"SM",1,"FD",1,"LD",
+SIND: 10,"SM",1,"FD",1,"LD",1
+SIND: 10,"SM",1,"FD",1,"LD",1,
+SIND: 10,"SM",1,"FD",1,"LD",1,"
+SIND: 10,"SM",1,"FD",1,"LD",1,"M
+SIND: 10,"SM",1,"FD",1,"LD",1,"MC
+SIND: 10,"SM",1,"FD",1,"LD",1,"MC"
+SIND: 10,"SM",1,"FD",1,"LD",1,"MC",
+SIND: 10,"SM",1,"FD",1,"LD",1,"MC",1
+SIND: 10,"SM",1,"FD",1,"LD",1,"MC",1,
+SIND: 10,"SM",1,"FD",1,"LD",1,"MC",1,"
+SIND: 10,"SM",1,"FD",1,"LD",1,"MC",1,"R
+SIND: 10,"SM",1,"FD",1,"LD",1,"MC",1,"RC
+SIND: 10,"SM",1,"FD",1,"LD",1,"MC",1,"RC"
+SIND: 10,"SM",1,"FD",1,"LD",1,"MC",1,"RC",
+SIND: 10,"SM",1,"FD",1,"LD",1,"MC",1,"RC",1
+SIND: 10,"SM",1,"FD",1,"LD",1,"MC",1,"RC",1,
+SIND: 10,"SM",1,"FD",1,"LD",1,"MC",1,"RC",1,"
+SIND: 10,"SM",1,"FD",1,"LD",1,"MC",1,"RC",1,"M
+SIND: 10,"SM",1,"FD",1,"LD",1,"MC",1,"RC",1,"ME
+SIND: 10,"SM",1,"FD",1,"LD",1,"MC",1,"RC",1,"ME"
+SIND: 10,"SM",1,"FD",1,"LD",1,"MC",1,"RC",1,"ME",
+SIND: 10,"SM",1,"FD",1,"LD",1,"MC",1,"RC",1,"ME",1


It's a bit like if it is running and runngin until it crash...
« Last Edit: January 11, 2013, 02:33:53 pm by pierrot10 » Logged

Il ne suffit pas de tout savoir, la persévérance, c'est déjà presque tout!

UK
Offline Offline
Shannon Member
****
Karma: 223
Posts: 12577
-
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

The page you linked to for the GPRS shield say that it has the same capability to use the physical serial pins 0+1 or digital pins 2+3.

If you want to use the Arduino's serial port then neither of the shields can use the hardware serial pins 0+1. This means the GPRS shield has to use software serial on pins 2+3. This in turn means the GPS shield has to use software serial pins. The default is to use 2+3 (which won't work) but it sounds as if it can be configured to use any other pins. So I suggest you choose some free pins for it, and configure it to use those pins.
Logged

I only provide help via the forum - please do not contact me for private consultancy.

Offline Offline
Sr. Member
****
Karma: 0
Posts: 368
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Dear PeterH
Thank fro answering.
I partially understand you answer.
If I understood well, the pin 0+1 shoud not be use. Pin 2+3 are software serial.

How can I make sure which pin are free?

Thank again
Logged

Il ne suffit pas de tout savoir, la persévérance, c'est déjà presque tout!

UK
Offline Offline
Shannon Member
****
Karma: 223
Posts: 12577
-
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Read the specifications for the shields you're attaching and whatever other hardware you have connected, and discover which pins they use.

For each pin, ensure that there is no conflict in the things using it. For example, in this case you have two shields both trying to use pins 2+3 to provide a serial connection to the Arduino, and clearly that isn't going to work.
Logged

I only provide help via the forum - please do not contact me for private consultancy.

Seattle, WA USA
Offline Offline
Brattain Member
*****
Karma: 601
Posts: 48543
Seattle, WA USA
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

What baud rate are you using to talk to the GPRS?
Logged

Offline Offline
Sr. Member
****
Karma: 0
Posts: 368
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Hello,
Thank for helping me.

I tryed several baud, but I mainly work on 4800. I once read to work 115200

Code:
Serial.begin(4800);
cell.begin(9600);

I am located in Switzerland
« Last Edit: January 12, 2013, 12:48:15 am by pierrot10 » Logged

Il ne suffit pas de tout savoir, la persévérance, c'est déjà presque tout!

Pages: [1]   Go Up
Jump to: