question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

MTU not changed after reconnection

See original GitHub issue

I have a remote device that initializes with the default MTU. I request a larger MTU in my app at initialization, in my BleManager object:

protected void initialize() {
            beginAtomicRequestQueue()
                    .add(requestMtu(512)
                            .with((device, mtu) -> log(Log.INFO, "MTU set to " + mtu))
                            .fail((device, status) -> log(Log.WARN, "Requested MTU not supported: " + status)))
                    .done(device -> log(Log.INFO, "Target initialized"))
                    .enqueue();
}

This works normally when I do it the first time after opening the app.

If I stop the remote device or go out of range, and then reconnect, the app connects normally and the initialize() method is called, but the MTU is not updated. I would expect the MTU to be updated in this case as well.

The log messages show “MTU set to 512”, but if I try to write more than the default 23 bytes, I get:

E/BleManager: onCharacteristicWrite error 6
E/MyBleManager: Error (0x6): GATT REQ NOT SUPPORTED

If I add two requests to force the MTU change, then everything works correctly, but only if both requests are sent. Sending only the 512 bytes request has no effect.

requestMtu(28).enqueue();
requestMtu(512).enqueue();

I am not sure if this is a library issue or an Android issue. I do not think it is a remote device issue since there is no outgoing BLE traffic after the re-connection if I do not do the workaround.

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:5 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
philips77commented, Apr 16, 2021

I’ll close it as it as solved on develop.

1reaction
philips77commented, Apr 16, 2021

Hi, This issue was fixed in develop branch, but for some reason that was not released yet. I just resumed working on this project, so I’ll go through all issues, fix bugs and will do a release.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Solved: Impact of changing core MTU - Cisco Community
So, you need a reboot after deploying the config. Changing MTU should not affect the inband management connection but I recommend doing it ......
Read more >
MTU And change connection's MTU limit - TechNet - Microsoft
Changed MTU to 1472. Not open VPN with SonicWALL netextender on my PC windows 7 pro 64 bit. Should changed MTU on a...
Read more >
K7840: An MTU change after the connection has been ... - AskF5
If the MTU is changed after a connection has been established with a virtual server utilizing a FastL4 profile, the connection will stall....
Read more >
MTU size change and failover reset cause vNIC interface to go ...
It is observed that a Maximum Transmission Unit (MTU) size change and failover might cause the virtual Network Interface Controller (vNIC) ...
Read more >
MTU change not working - Fedora Forum
I have fedora 12. xfce My internet not working because i need to change mtu.On ubuntu, before it worked when I changed the...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found