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

Empty stream after call waitResponse() #776

Open
Dexter0007 opened this issue Feb 7, 2024 · 0 comments
Open

Empty stream after call waitResponse() #776

Dexter0007 opened this issue Feb 7, 2024 · 0 comments

Comments

@Dexter0007
Copy link

Dexter0007 commented Feb 7, 2024

Hi, I'm trying to get USSD code response from modem but method sendUSSDImpl not working (always return empty string).

I'm using ESP32 WROOM32 using HW Serial2 and NEOWAY M590 REVISION 01.30c

This code not working:

 String sendUSSDImpl(const String& code) {
     sendAT(GF("+CSCS=\"GSM\""));
     waitResponse();
     sendAT(GF("+CUSD=1,\""), code, GF("\",15"));
     
     int8_t state = waitResponse(10000L);

     String str = String(stream.available());
 
     return "Received:" + str + ", state:" + String(state);
  
 }

Return always: Received:0, state:1

This code working good:

String sendUSSDImpl(const String& code) {
    sendAT(GF("+CSCS=\"GSM\""));
    waitResponse();
    sendAT(GF("+CUSD=1,\""), code, GF("\",15"));

    delay(10000);
    
    int8_t state = 0; 

    String str = String(stream.available());
 
    return "Received:" + str + ", state:" + String(state);
  
}

Return always: Received:86, state:0

I can't read data by stream.readString(); if waitResponse() is before.

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