-
-
Notifications
You must be signed in to change notification settings - Fork 145
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
RNodeConf doesn't disable Bluetooth on command / Windows DTR causes timing/configuration issues #498
Comments
Okay, Linux appears to work as intended (issue appears related to #497 on Linux) but Windows is a legitimate problem. I cannot disable or enable Bluetooth. In addition, attempting to enable Bluetooth (from the disabled state at least) either resets the display or reboots the MCU. Since this appears to be a Windows issue, I'll see what I can do. |
It's intermittent. Sometimes it works, sometimes it doesn't, sometimes it does a power cycle. Since I can't monitor the serial port and call commands at the same time, I'll have to write a test program. It won't be soon. I'll let you know. |
Okay, so I lied. I stole a bunch of code from RNodeConf and got a test system running. Pushing the bytes across the com port works perfectly. Reboot occurs after Not much news, but ruled out RNode and serial issues. |
I have found a fundamental difference between Linux and Windows behavior that will need to be addressed and causes the reset. Windows doesn't disconnect cleanly somehow. This can be seen on the RNode itself, as on rnodeconf's termination, the connection icon does not revert like it does on Linux. On a fresh boot, the RNode functions as intended. At this time it appears that this occurs when data is read from the serial port. This needs significantly more research, but I've narrowed it down to a python serial difference under Windows, and not something fundamentally RNode/Reticulum related. No idea if this has anything to do with Bluetooth yet. |
Yes. It has something to do with Bluetooth, I'm sure. It actually locks up the RNode at some point, because the reset button doesn't work. I'm out of energy for the day. |
Thanks for investigating this! If it is indeed related to specific behaviour on Windows, and you can figure out a root cause, we can most likely implement necessary workarounds easy enough. |
I am convinced the issue is that something locks up the RNode and prevents the command from even being processed (not sent, or RNodeConf would detect the failure). I need to check function by function, since a raw serial connection or The rebooting issue turns out to be entirely unrelated, but a Windows specific issue. By default, connecting to an Arduino reboots the MCU, and this legacy behavior exists on the ESP32, apparently. It can be disabled, on paper, with |
Okay, important findings. Enabling TNC was a great idea, although I can't disable it. This allows me real-time identification of when the MCU locks up, as the waterfall functions until then. I have a pretty good sample of things that cause the issue and can hopefully use timing and the -e and -P commands to whitelist functions. The absolutely random retention of BT and display intensity settings makes me believe the failure is inside the EEPROM routines, but I won't assume at this time. Especially since that doesn't make a lick of sense if it works on Linux, and it sure does. I have some more tests to do. By call:
|
Okay, this is a good news bad news situation. First, this is a Windows-specific (and possibly driver specific!) issue. It can be treated like a timing issue, and I have, in the interim, "solved" it by adding a Core problem: Windows. No, seriously. Remember how I said Windows ignores DTR (Data Terminal Ready)? It's not entirely true. Windows IMMEDIATELY pulls DTR low when the serial port is closed. This causes the MCU to halt. Linux does not. The implication here is that on Linux the MCU finishes its work after the serial connection is broken. On Windows, it always resets on connection (edge case where DTR is already pulled high, such as first connection) and it always halts when disconnected. Meaning unless there's an active connection or the port has never been closed, an RNode will not work on Windows, since a closed connection will halt the system. In Reticulum use this doesn't matter; the serial connection is active when attached to the RNS. In RNodeConf use, it causes timing issues. If someone is setting up a portable RNode and thinks it'll work for powering the node, it will fail inexplicably. Even with the modifications I've done, once you enable bluetooth, it will halt on disconnect and need to be unplugged and plugged back in to function without an active serial connection. I don't know if this is all Windows or just specific driver batches, but it also can be terminal specific, as some terminals (like PuTTY) have been reported to show this behavior, but that could still be OS or driver related. @markqvist Please advise where you'd like the timing issue addressed. |
Phew, thanks for hunting this one down. I'm relieved it's solvable with a bit of timing modification.
Ah, that makes a lot of sense then. We can use
The most reliable thing would probably be to have a central quit function that gracefully cleans everything up, but if simply adding a conditional sleep to |
Closing this as fixed in #500 |
Describe the Bug
When using RNodeConf to disable Bluetooth, the configuration is not set. The board still responds to Bluetooth.
To Reproduce
Run
rnodeconf (port) -B
and attempt to attach via Bluetooth. Restarting board optional.Expected Behavior
RNode would no longer connect via Bluetooth
Logs & Screenshots
Linux:
Windows:
System Information
See above
RNodeConf 2.1.3
Additional context
I believe this is either an RNodeConf issue or a long-standing firmware problem based on the versions presenting this issue. FW Version 1.70 and 1.59 tested on both Linux and Windows.
The text was updated successfully, but these errors were encountered: