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

Error when interface is not working #6

Closed
RocketRider opened this issue Feb 17, 2020 · 8 comments
Closed

Error when interface is not working #6

RocketRider opened this issue Feb 17, 2020 · 8 comments

Comments

@RocketRider
Copy link

RocketRider commented Feb 17, 2020

When I use NORM on Android over an WiFi and the connection goes down(not disabling the interface) I see the following error in the log, but I don't get any event to handle the issue:

2020-01-29 12:58:01.749 ? W/protolib: NormSession::SendMessage() sendto(224.1.2.3/4102) warning: Invalid argument
2020-01-29 12:58:01.752 ? E/protolib: ProtoSocket::SendTo() sendto() error: Invalid argument

The error is shown in an endless loop and I can't handle it. Is there any way to determine if NORM can send the data correctly?

@bebopagogo
Copy link
Collaborator

bebopagogo commented Feb 17, 2020 via email

@RocketRider
Copy link
Author

I am using an WiFi access point. And I am just powering off the access point for this test.

@bebopagogo
Copy link
Collaborator

bebopagogo commented Feb 18, 2020 via email

@RocketRider
Copy link
Author

I am using the Loglevel 7, //PL_MAX, and I don't get any more info from NORM.
In the log I can see the messages from the OS, like:

2020-02-19 10:14:06.393 ? D/NetworkMonitor/NetworkAgentInfo [WIFI () - 610]: Disconnected

But NORM is not showing anything.

Norm is printing these stats sometime after the disconnect:

2020-02-19 10:14:12.129 ? I/protolib: NormSenderNode::OnActivityTimeout() node>175843434 for sender>2681601
2020-02-19 10:14:12.766 ? I/protolib: REPORT time>09:14:12.766783 node>175843434 ***************************************
2020-02-19 10:14:12.767 ? I/protolib: Local status:
2020-02-19 10:14:12.767 ? I/protolib: txRate> 64.000 kbps sentRate> 0.000 grtt>0.228400
2020-02-19 10:14:12.767 ? I/protolib: Remote sender>2681601 grtt>0.422500 sec loss>0.000000
2020-02-19 10:14:12.767 ? I/protolib: rxRate> 0.000 kbps rx_goodput> 0.000 kbps
2020-02-19 10:14:12.767 ? I/protolib: rxObjects> completed>1 pending>0 failed>0
2020-02-19 10:14:12.767 ? I/protolib: fecBufferUsage> current>0 peak>0 overuns>0
2020-02-19 10:14:12.767 ? I/protolib: strBufferUsage> current>0 peak>0 overuns>0
2020-02-19 10:14:12.767 ? I/protolib: resyncs>0 nacks>0 suppressed>0
2020-02-19 10:14:12.767 ? I/protolib: ***************************************************************************
2020-02-19 10:14:13.263 ? D/io_stats: !@ 179,0 r 82125 4717596 w 150508 4729104 d 11929 24813356 f 37991 40392 iot 165088 147220 th 51200 0 0 pt 0 inp 0 0 47193.862

And a short time after that, it runns into the endless loop of:

2020-02-19 10:14:27.635 ? E/protolib: ProtoSocket::SendTo() sendto() error: Invalid argument
2020-02-19 10:14:27.635 ? W/protolib: NormSession::SendMessage() sendto(224.1.2.3/4102) warning: Invalid argument
2020-02-19 10:14:27.638 ? E/protolib: ProtoSocket::SendTo() sendto() error: Invalid argument
2020-02-19 10:14:27.639 ? W/protolib: NormSession::SendMessage() sendto(224.1.2.3/4102) warning: Invalid argument
2020-02-19 10:14:27.642 ? E/protolib: ProtoSocket::SendTo() sendto() error: Invalid argument

Yes exactly I would benefit from a notification that the data can't be send so I can handle it in my app. Otherwise I have no idea if the data was send or not.
Yes, NORM is trying to send the data again and again. This is good. But it does it in a very fast endless loop. It would be nice if it would use some exponential back-off.

@bebopagogo
Copy link
Collaborator

bebopagogo commented Mar 1, 2020

A couple of more questions:

  1. Does it recover when your wifi becomes reconnected? Or it a permanent condition?

  2. Are you running fixed data rate or with congestion control enabled? The latter will slow down on its own ... otherwise it does regulate the rate of this issue at the fixed data rate packet interval. If some sort of send error notification was issued, the application could reduce the data rate as it chose ...

(Also sorry I haven't been able to address this yet. I need to set up something so I can test this but have not been able to be in my office much. I have Android devices and an access point I can use to replicate your situation ... it's the time that's hard to find).

@bebopagogo
Copy link
Collaborator

I just pushed updated code that extends the NORM_SEND_ERROR notification posting cases to cover the sort of error you are getting. I have not tested it for your specific issue and did not change the "polling" behavior with regards to send retry attempts ... but with the notification you can now decide what to do at the app layer

@RocketRider
Copy link
Author

Thank you!
I will try it in the next days.

@RocketRider
Copy link
Author

Sorry for the delay. Now I found the time to test your new version.
Now I do see the NORM_SEND_ERROR when the WiFi drops.

Thank you for the improvement!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants