Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error return codes doesn't work well #39

Open
nalen-dev opened this issue Jul 7, 2022 · 1 comment
Open

Error return codes doesn't work well #39

nalen-dev opened this issue Jul 7, 2022 · 1 comment

Comments

@nalen-dev
Copy link

nalen-dev commented Jul 7, 2022

Hello, I have an issue that the code acts weird when sending different data types, in this case, string and char using my RockBLOCK Mk2 9602 module. So my project is sending data from the SD CARD file, the idea is to read the file using iteration (for loop) and save it to variable char. It will try to send data until it succeeds. When I send string data ex. ("Test"), the Arduino will return 0/ISBD_SUCCESS to tell us that the server has already received the data. When I Send char data, the server receives the same data as on serial monitor, and Arduino sends 0 value to. But, my code act like it failed and tries to send data again and again. I don't know why, just like what I said, it acts weird.

Here is the "Important" part of the code.

char readSDC[162]; //this is variable I use to storage the value 

//Read file from SD Card, and storage it to readSDC variable
if (myFile)
        {Serial.println(F("start reading SD Card.txt"));
        while(myFile.available()) 
          { 
        for(int i=0; i<=160; i++){
        readSDC[i]+= myFile.read();
        }
        delay(1000);
        Serial.println(readSDC);
        delay(1000);}
}

//Sending Massage block Program
    Serial.println("Try to find signal");
     err = isbd.getSignalQuality(signalQuality);
      if(err!= ISBD_SUCCESS){
       Serial.print("Signal Quality failed: error");
       Serial.println(err);
       return;
          }
      delay(1000);
      Serial.print("Signal around here is ");
      Serial.println(signalQuality);
            
       //Start Sending Message
       Serial.println(F("Start Sending Message"));
       err = isbd.sendSBDText(readSDC);
       delay(2000);
       if(err =! ISBD_SUCCESS){
          Serial.println("Failed sending message");
          Serial.println(err);
            if(err == 0){
              Serial.println("Success sending message");
                  }
            if(err   == ISBD_SENDRECEIVE_TIMEOUT){
            Serial.println("Try again with a better view of the sky");
            return;
                  }
      }else{
         Serial.println("Success sending message");
}

Just like I said, it works well both Arduino Serial Monitor and Server when I put string on err = isbd.sendSBDText("Test");, but when I use my char variable, it acts like what I said above. Any solution?

@bevingtona
Copy link

I've had success using:

err = modem.sendSBDText(my_msg.c_str());

where my_msg is a string.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants