Git Product home page Git Product logo

Comments (5)

david-cermak avatar david-cermak commented on May 30, 2024

It's not possible to set on_read_cb from C API yet.

As a workaround you can check what's done in the mdoem-console example. It implements a generic command that takes a pattern matching string as an argument, so you can wait for a ready signal, or some specific string (such as +CLIP: in your case), e.g.

esp> cmd -n "" -t 50000 -p "SIM"
I (442984) modem_console: Sending command  with timeout 50000
I (459154) modem_console: 
RDY

+CME ERROR: SIM not inserted

esp>

CHECK_ERR(dce->command(cmd, [&](uint8_t *data, size_t len) {
std::string response((char *) data, len);
ESP_LOGI(TAG, "%s", response.c_str());
if (pattern.empty() || response.find(pattern) != std::string::npos) {
return command_result::OK;
}
if (response.find(pattern) != std::string::npos) {
return command_result::OK;
}
return command_result::TIMEOUT;
}, timeout),);

Is it better for you to be able to set the actual callback and check the results manually? Or alternatively extend the existing at_command() to allow for the pattern matching in replies?
The first option is more universal, but wouldn't support sending any other AT commands while it's active (Unless you use one more virtual terminal)

from esp-protocols.

RaD avatar RaD commented on May 30, 2024

Thanks, will try to implement a solution...

from esp-protocols.

RaD avatar RaD commented on May 30, 2024

I have tried to send empty command:

W (115445) INET: Waiting Caller ID failed, retry...
W (125445) INET: Waiting Caller ID failed, retry...
W (135445) INET: Waiting Caller ID failed, retry...
W (145445) INET: Waiting Caller ID failed, retry...
W (148515) command_lib: RING found
E (148515) ESP_MODEM_THROW: esp_modem_dte.cpp:60 ERROR


abort() was called at PC 0x400e295e on core 0


Backtrace:0x40081c5a:0x3ffb12e00x40086901:0x3ffb1300 0x4008e31e:0x3ffb1320 0x400e295e:0x3ffb1390 0x400e2643:0x3ffb14c0 0x400e8aec:0x3ffb14f0 0x400ded76:0x3ffb1550 0x400dc9f9:0x3ffb1570 0x400d875d:0x3ffb15c0 0x400d75cb:0x3ffb1620 0x4013ec37:0x3ffb1650 0x4008987d:0x3ffb1670

from esp-protocols.

david-cermak avatar david-cermak commented on May 30, 2024

E (148515) ESP_MODEM_THROW: esp_modem_dte.cpp:60 ERROR

We had a similar issue once. It's been fixed in a871473

Could you please check that your version includes this commit?

from esp-protocols.

RaD avatar RaD commented on May 30, 2024

this bug was gone accidently, sorry

from esp-protocols.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.