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

[Wifi link] Connection speed lower with 2.5.0 (Beta 1) than with 2.4.2 #5486

Closed
5 of 6 tasks
Swiftnesses opened this issue Dec 12, 2018 · 7 comments
Closed
5 of 6 tasks
Assignees
Labels
waiting for feedback Waiting on additional info. If it's not received, the issue may be closed.

Comments

@Swiftnesses
Copy link

Swiftnesses commented Dec 12, 2018

Basic Infos

  • This issue complies with the issue POLICY doc.
  • I have read the documentation at readthedocs and the issue is not addressed there.
  • I have tested that the issue is present in current master branch (aka latest git).
  • I have searched the issue tracker for a similar issue.
  • If there is a stack dump, I have decoded it.
  • I have filled out all fields below.

Platform

  • Hardware: [NodeMCU V1.0]
  • Core Version: [Latest Arduino IDE build]
  • Development Env: [Arduino IDE]
  • Operating System: [MacOS]

Settings in IDE

  • Module: [NodeMCU V1.0]
  • Flash Mode: [qio|dio|other]
  • Flash Size: [4MB (No SPIFFS)]
  • lwip Variant: [v2 Higher Bandwidth]
  • CPU Frequency: [80Mhz|160MHz]
  • Upload Using: [OTA]

Problem Description

With 2.4.2, I consistently see connections circa 20Mbps uplink / downlink and pings below 10m. After updating to 2.5.0 (Beta 1), link speed is significantly reduced and ping times often 20-100ms.

screenshot 2018-12-12 at 07 05 59

Sketch contains the following parameters:

  // Prevent wifi sleeping
  WiFi.setSleepMode(WIFI_NONE_SLEEP);
  // 802.11n
  WiFi.setPhyMode(WIFI_PHY_MODE_11N);
  // Station mode
  WiFi.mode(WIFI_STA);
@Swiftnesses Swiftnesses changed the title Wifi link connection lower with 2.5.0 (beta 1) than with 2.4.2 Wifi link connection lower with 2.5.0 (Beta 1) than with 2.4.2 Dec 12, 2018
@Swiftnesses Swiftnesses changed the title Wifi link connection lower with 2.5.0 (Beta 1) than with 2.4.2 [Wifi link] connection lower with 2.5.0 (Beta 1) than with 2.4.2 Dec 12, 2018
@Swiftnesses Swiftnesses changed the title [Wifi link] connection lower with 2.5.0 (Beta 1) than with 2.4.2 [Wifi link] Connection speed lower with 2.5.0 (Beta 1) than with 2.4.2 Dec 12, 2018
@devyte
Copy link
Collaborator

devyte commented Dec 12, 2018

@Swiftnesses post 2.4.2 there was a change that seems to affect rf calibration, see #5056 .
Does reverting that change work for you?
That PR pulls out a workaround implemented previously. There is reference to this comment to force rf calibration on startup.
Does implementing that work for you?
Alternatively you could implement the following function in your sketch, which executes very early in the bootup process (no access to global objects allowed in there):

void preinit()
{
    volatile uint32_t* rtc_reg = (volatile uint32_t*) 0x60001000;
    rtc_reg[24] &= 0xFFFF;
}

If none of the above works for you, then it is likely that something changed in the SDK which affects you. In that case I doubt there is anything that can be done on our end.

@devyte devyte added the waiting for feedback Waiting on additional info. If it's not received, the issue may be closed. label Dec 12, 2018
@devyte devyte self-assigned this Dec 12, 2018
@Swiftnesses
Copy link
Author

Looking into this now.

Certainly something has changed which effects sensors at the outer edge of the wifi signal (40% and below). Before they connect at 20+ Mbps TX / RX, now they connect at 1 or 2 Mbps.

The most inconvenient part is the sensors no longer present themselves for OTA updates (even with the new dns update in the loop), I assume they're dropping packets as the ping is also slower (sometimes they drop connection entirely!).

@Swiftnesses
Copy link
Author

Swiftnesses commented Dec 13, 2018

I will try to revert this:

void user_rf_pre_init()
{
    // *((volatile uint32_t*) 0x60000710) = 0;
    spoof_init_data = false;
    volatile uint32_t* rtc_reg = (volatile uint32_t*) 0x60001000;
    if((rtc_reg[24] >> 16) > 4) {
        rtc_reg[24] &= 0xFFFF;
        rtc_reg[30] = 0;
    }

    system_set_os_print(0);
    int rf_mode = __get_rf_mode();
    if (rf_mode >= 0) {
        system_phy_set_rfoption(rf_mode);
    }
    __run_user_rf_pre_init();
}

WIll update if it helps.

@Swiftnesses
Copy link
Author

Swiftnesses commented Dec 14, 2018

No luck. Spent 2 hours outside trying various things, using 2.5.0 Beta 1, the sensors in the garden not only connect extremely slowly, they also refuse to advertise OTA. I tried with multiple sensors, wiping flash before, I tried both changes you suggested, they did not help.

Reverting back to 2.4.2, connection is restored and OTA works again.

Tried with a different AP, same behaviour.

2.5.0
screenshot 2018-12-14 at 08 46 24

2.4.2
screenshot 2018-12-14 at 09 02 12

@d-a-v
Copy link
Collaborator

d-a-v commented Dec 14, 2018

About OTA, check #5487 or run with latest git.

About connection speed, I cannot say right now.
Are you able to run in arduino IDE, enable all debug options, enable timestamp in serial logger, and copy paste the boot/dhcpclient process with 2.4.2 and 2.5.0-beta1 so we can see firmware debug log with relative durations ?

@d-a-v
Copy link
Collaborator

d-a-v commented Dec 14, 2018

Can you also try with lwIP-1.4 and lwIP-2/no-features ?

@devyte
Copy link
Collaborator

devyte commented Oct 31, 2019

No feedback in almost a year. Closing.

@devyte devyte closed this as completed Oct 31, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
waiting for feedback Waiting on additional info. If it's not received, the issue may be closed.
Projects
None yet
Development

No branches or pull requests

3 participants