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

UCS2 long message hangs modem #118

Open
Wortoll opened this issue Jul 27, 2020 · 2 comments
Open

UCS2 long message hangs modem #118

Wortoll opened this issue Jul 27, 2020 · 2 comments

Comments

@Wortoll
Copy link

Wortoll commented Jul 27, 2020

When changing the character set in the GSM_SMS.cpp file by adding MODEM.send("AT+CSCS=\"UCS2\""); right under GSM_SMS::available(). I receive all messages in UCS2.
This gets translated and solves issues with accented characters or emoticons... documented in #101

When I now send a message with a lot of characters (somewhere over 140) the modem hangs.

If I then remove the MODEM.send("AT+CSCS=\"UCS2\""); to normal modem.send configuration & upload and reboot, this gets received in 2 messages (ok!)

Is it possible to make the modem 'not hang' ?

Could someone help? This destroys everything I was working on :(

@Wortoll
Copy link
Author

Wortoll commented Jul 28, 2020

FYI
So far I managed to 'trace' this to

int GSM_SMS::ready()
{
  int ready = MODEM.ready();
  TRACE();  //Prints this

  if (ready == 0) { TRACE(); //Prints this  ////// HERE !!!
    return 0; 
  }

  TRACE(); //does not print this
...

Which shows me the way to

int ModemClass::ready()
{
  poll(); //TRACE();

  return _ready;
}

And to: void ModemClass::poll()
Where _ready stays 0 ...

Printing _buffer gives: AT+CMGL="REC UNREAD"

@Wortoll
Copy link
Author

Wortoll commented Jul 30, 2020

FYI
It seems that the order of multiple-messages is sometimes wrong
But the timestamp is correct

My sketch checks if the next message (within a time window) has same number so it can stitch it together.
Now the order is sometimes wrong. I should order them according to time received.

+CMGL: 23,"REC UNREAD","+telnumber",,"20/07/30,21:58:13+08"
0041006100610061006100610061006100610061006100610061006100610061006100610061006100410061006100610061006100610061006100610061006100610061006100610061006100610061004100610061006100610061006100610061006100610061006100610061006100610061006100610041006100610061006100610061

+CMGL: 24,"REC UNREAD","+telnumber",,"20/07/30,21:58:15+08"
00610061006100610061006100410061006100610061006100610061006100610061006100610061006100610061006100610061D83DDE26

+CMGL: 25,"REC UNREAD","+telnumber",,"20/07/30,21:58:14+08"
0061006100610061006100610061006100610061006100610061004100610061006100610061006100610061006100610061006100610061006100610031003000300041006100610061006100610061006100610061006100610061006100610061006100610061006100410061006100610061006100610061006100610061006100610061

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

1 participant