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

[Tracker] ESP32 support #2250

Merged
merged 24 commits into from
Dec 22, 2020
Merged

[Tracker] ESP32 support #2250

merged 24 commits into from
Dec 22, 2020

Conversation

avtolstoy
Copy link
Member

Description

This PR adds WiFi scanning support for Tracker. All other APIs except for WiFi interface state management and scanning are not available as of right now.

This feature branch should work with both the stock 0.0.6 ESP32 NCP firmware available from the factory, as well as with particle-iot/esp32-ncp-firmware#18.

Steps to Test

  • wiring/no_fixture tests have been fixed to allow WiFi scanning on Tracker
  1. WiFi scanning should work with stock 0.0.6 ESP32 NCP firmware
  2. You should be able to grab a build from SDIO/Tracker support esp32-ncp-firmware#18 and update update over serial or OTA to 0.0.7 version (particle serial inspect should reflect that)
  3. WiFi scanning should work with 0.0.7 ESP32 NCP firmware over muxed channel
  4. 0.0.7 ESP32 NCP firmware should be updatable. Manually edit version.mk in SDIO/Tracker support esp32-ncp-firmware#18 and bump version to 0.0.8 and perform a clean build. Update OTA or using serial should work.

Example App

SYSTEM_THREAD(ENABLED);
SerialLogHandler dbg(LOG_LEVEL_ALL);

/* executes once at startup */
void setup() {
    WiFi.on();
}

/* executes continuously after setup() runs */
void loop() {
    WiFi.scan([](WiFiAccessPoint* result, void* cookie) -> void {
        char ssid[64] = {};
        memcpy(ssid, result->ssid, std::min<size_t>(sizeof(ssid) - 1, result->ssidLength));
        Log.info("Found SSID: %s (%02x:%02x:%02x:%02x:%02x:%02x)", ssid,
                result->bssid[0],
                result->bssid[1],
                result->bssid[2],
                result->bssid[3],
                result->bssid[4],
                result->bssid[5]);
    }, nullptr);
    delay(1000);
}

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)

Copy link
Member Author

@avtolstoy avtolstoy left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

(GitHub was stuck while submitting a comment and refreshing a page required to submit a review for some reason)

@avtolstoy avtolstoy force-pushed the feature/wifi-feature-on-tracker branch from 3b8bb4c to cde1dc3 Compare December 9, 2020 21:52
@avtolstoy avtolstoy force-pushed the feature/wifi-feature-on-tracker branch 2 times, most recently from a192c65 to 37cc890 Compare December 9, 2020 23:08
@YutingYou
Copy link
Contributor

@avtolstoy Great reworking, since you've changed the transport layer, I was wondering have you run the stress test for OTA, this would be helpful for the stability of OTA and SDIO. The easiest way may be manually doing updating with CLI several times. Better to upgrade and downgrade.

@avtolstoy
Copy link
Member Author

@YutingYou Yes, I've done that multiple times, you can see that there are some FIXMEs around XModem that were uncovered both here and in the NCP firmware. I've also listed updates as one of the main things to test :)

Copy link
Member

@XuGuohui XuGuohui left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This reminds me that in the system_network_manager.cpp, some of the APIs don't support more than one interface. We need to refactor them but we can do that later if they don't break things.

hal/inc/hal_dynalib_wlan.h Show resolved Hide resolved
hal/inc/hal_platform.h Outdated Show resolved Hide resolved
hal/inc/hal_platform.h Show resolved Hide resolved
hal/shared/spi_lock.h Show resolved Hide resolved
hal/src/tracker/esp32_sdio_stream.cpp Show resolved Hide resolved
hal/src/tracker/platform_ncp_quectel.cpp Outdated Show resolved Hide resolved
hal/src/tracker/sdspi/esp32_sdio.cpp Show resolved Hide resolved
hal/src/tracker/sdspi/esp32_sdio.h Outdated Show resolved Hide resolved
services/inc/system_defs.h Show resolved Hide resolved
@avtolstoy avtolstoy force-pushed the feature/wifi-feature-on-tracker branch from c3ef5a9 to 07696b1 Compare December 22, 2020 21:14
@avtolstoy avtolstoy merged commit ead7602 into develop Dec 22, 2020
@avtolstoy avtolstoy deleted the feature/wifi-feature-on-tracker branch December 22, 2020 21:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
4 participants