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

Photon/P1: A number of networking-related fixes #1492

Merged
merged 14 commits into from Apr 5, 2018

Conversation

@avtolstoy
Copy link
Member

commented Feb 28, 2018

submission notes
**Important:** Please sanitize/remove any confidential info like usernames, passwords, org names, product names/ids, access tokens, client ids/secrets, or anything else you don't wish to share.

Please Read and Sign the Contributor License Agreement ([Info here](https://github.com/spark/firmware/blob/develop/CONTRIBUTING.md)).

You may also delete this submission notes header if you'd like. Thank you for contributing!

Problem

  1. WICED makes a write to DCT while DCT is locked for reading causing an assertion failure (particle-iot/photon-wiced#27)
  2. There is a race condition between HAL and WICED in DHCP handling: DHCP may be started non-synchronously under certain conditions (and we assume that it's synchronous in wlan_hal)
  3. There is a bug with tcp server resource cleanup in socket_hal: when wiced_tcp_server_start() reports an error, we do not call wiced_tcp_server_stop(), causing an internal tcp server list in WICED to get completely filled. As a result, we are unable to create any more tcp servers
  4. There is a race condition with SYSTEM_THREAD(ENABLED) between WiFi.ready() and when the config is updated in system thread (#1371)
  5. LwIP tcp_tmr no longer functions after network stack is reinitialized (particle-iot/photon-wiced#27)
  6. socket_close_all() causes a hardfault due to socket destruction when it should simply be closing them and leaving the resource cleanup up to the socket 'user'
  7. Pinger is not functioning properly, hence #1479

Solution

  • Photon: socket_create_tcp_server() needs to close() server instance in case of an error before deleting it
  • wlan_hal: call wiced_network_down() in wlan_connect_finalize() to prevent DHCP from being started asynchronously under certain conditions
  • system_network_internal: ip config needs to be updated in notify_dhcp() in order to mitigate an issue when network_ready() == true but the config has not been updated yet
  • Photon: socket_hal: Fixes a hardfault due to socket destruction in socket_close_all()
  • communication: Fixes broken Pinger (#1479)
  • particle-iot/photon-wiced#27

Steps to Test

N/A

Example App

N/A

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 added 6 commits Feb 26, 2018
wlan_hal: call wiced_network_down() in wlan_connect_finalize() to pre…
…vent DHCP from being started asynchronously under certain conditions
system_network_internal: ip config needs to be updated in notify_dhcp…
…() in order to mitigate an issue when network_ready() == true but the config has not been updated yet
@elcojacobs

This comment has been minimized.

Copy link
Contributor

commented Feb 28, 2018

Awesome! You're really squashing a lot of bugs here.

@elcojacobs

This comment has been minimized.

Copy link
Contributor

commented Mar 1, 2018

regarding #1490, I was still able to trigger the stack overflow.

#1371 (comment)

@elcojacobs

This comment has been minimized.

Copy link
Contributor

commented Mar 7, 2018

I now found a photon in a state where it is stuck in really fast blinking green. These fixes are included.
WiFi.ready() returns false, but it still has an IP address. Couldn't go into listening mode. Holding the setup button does nothing, no matter how long I hold it. Doesn't respond to ping.
The user thread is still running.

@elcojacobs

This comment has been minimized.

Copy link
Contributor

commented Mar 8, 2018

So... it looked like Particle finally noticed that WiFi + TCP was really unstable. Finally after 6 months, fixes were incoming!
But not everything is fixed yet. And I have not seen an update in 8 days.

Can someone at Particle tell me, is there a plan to fix the rest? Is someone assigned?
Is it scheduled on a sprint? Does Particle even acknowledge that there are still problems?

I have unhappy end users and I am totally dependent on Particle for a fix. I'm not the only one having these issues. There are plenty of other users posting about them on the forum. This is really getting on my nerves.

Please, keep us informed.

@avtolstoy avtolstoy referenced this pull request Mar 14, 2018
6 of 6 tasks complete
avtolstoy and others added 2 commits Apr 5, 2018
Merge pull request #1500 from particle-iot/fix/photon-networking-1
Photon/P1: A number of networking-related fixes [v2]

@technobly technobly merged commit e4ba14d into develop Apr 5, 2018

0 of 2 checks passed

continuous-integration/travis-ci/pr The Travis CI build is in progress
Details
continuous-integration/travis-ci/push The Travis CI build is in progress
Details

@technobly technobly deleted the fix/photon-tcp branch Apr 5, 2018

@technobly technobly restored the fix/photon-tcp branch Apr 5, 2018

@technobly technobly deleted the fix/photon-tcp branch Apr 13, 2018

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
4 participants
You can’t perform that action at this time.