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

AT parser and gsm0710 muxer custom log category support #2267

Merged
merged 4 commits into from
Jan 20, 2021

Conversation

avtolstoy
Copy link
Member

@avtolstoy avtolstoy commented Jan 19, 2021

Problem

Now that we have ESP32 support on Tracker, it's impossible to differentiate between NCP client / gsm0710 muxer logs that come from the cellular modem and ESP32.

Solution

Add instance-local custom log categories support for AT parser and gsm0710muxer.

This PR also fixes a bug in ChannelStream in waitEvent() timeout handling and makes sure that we have a single implementation of the gsm0710muxer (by having a common Stream base class that support eventGroup() method).

Steps to Test

Run the test app, watch logs. It should be easy to differentiate NCP/muxer logs that come from the modem and from ESP32.

Example App

SerialLogHandler dbg(LOG_LEVEL_ALL);

SYSTEM_MODE(SEMI_AUTOMATIC);

void setup() {
    waitUntil(Serial.isConnected);
    Particle.connect();
}

void loop() {
    WiFiAccessPoint results[5];
    WiFi.scan(results, sizeof(results) / sizeof(results[0]));
    auto sig = Cellular.RSSI();
    (void)sig;
    delay(5000);
}

Logs

0000034741 [ncp.at] TRACE: > AT+CCID
0000034743 [ncp.at] TRACE: < +CCID: XXXXXX
0000034743 [ncp.at] TRACE: < OK
0000034745 [ncp.at] TRACE: > AT+CGSN
0000034746 [ncp.at] TRACE: < YYYYYYY
0000034746 [ncp.at] TRACE: < OK
0000034753 [ncp.esp32.at] TRACE: > AT+MVER
0000034763 [ncp.esp32.at] TRACE: < 9
0000034763 [ncp.esp32.at] TRACE: < OK
0000029981 [mux] INFO: Starting GSM07.10 muxer
0000029981 [mux] INFO: Openning mux channel 0
0000029982 [mux] INFO: GSM07.10 muxer thread started
0000030083 [mux] INFO: Openning mux channel 1
0000022002 [ncp.esp32.mux] INFO: Starting GSM07.10 muxer
0000022004 [ncp.esp32.mux] INFO: Openning mux channel 0
0000022004 [ncp.esp32.mux] INFO: GSM07.10 muxer thread started
0000022010 [ncp.esp32.mux] INFO: Openning mux channel 1

References


Completeness

  • User is totes amazing for contributing!
  • Contributor has signed CLA (Info here)
  • Problem and Solution clearly stated
  • Run unit/integration/application tests on device
  • Added documentation
  • Added to CHANGELOG.md after merging (add links to docs and issues)

@avtolstoy avtolstoy added this to the 3.0.0 milestone Jan 19, 2021
@avtolstoy avtolstoy merged commit 55f34b9 into develop Jan 20, 2021
@avtolstoy avtolstoy deleted the feature/parser-muxer-custom-log-category branch January 20, 2021 00:48
@avtolstoy avtolstoy modified the milestones: 3.0.0, 2.0.2 Jan 21, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants