You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: mavsdk/source/index.rst
+47-5Lines changed: 47 additions & 5 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -69,13 +69,55 @@ The examples assume that the embedded ``mavsdk_server`` binary can be run. In so
69
69
Debug connection issues
70
70
-----------------------
71
71
72
-
.. note::
73
-
By default mavsdk-python will not print any output from mavsdk-server. If you are experiencing connection issues, it can pay to enable forwarding of the mavsdk-server output into the python console. You can do so with this piece of code at the top of your file:
72
+
MAVSDK-Python automatically captures and displays important messages from ``mavsdk_server``. Error and warning messages are shown by default, while informational messages can be enabled for more detailed debugging.
74
73
75
-
.. code:: python
74
+
**For basic debugging (recommended):**
76
75
77
-
import logging
78
-
logging.basicConfig(level=logging.DEBUG)
76
+
.. code:: python
77
+
78
+
import logging
79
+
logging.basicConfig(level=logging.INFO)
80
+
81
+
This will show connection attempts, version information, and any errors or warnings from ``mavsdk_server``.
82
+
83
+
**For detailed debugging:**
84
+
85
+
.. code:: python
86
+
87
+
import logging
88
+
logging.basicConfig(level=logging.DEBUG)
89
+
90
+
This shows all messages including internal debug information.
91
+
92
+
**For server-only messages:**
93
+
94
+
You can also control just the ``mavsdk_server`` output:
95
+
96
+
.. code:: python
97
+
98
+
import logging
99
+
logging.basicConfig(level=logging.WARNING) # Hide most messages
100
+
logging.getLogger('mavsdk_server').setLevel(logging.INFO) # Show server info
101
+
102
+
**To disable server messages completely:**
103
+
104
+
.. code:: python
105
+
106
+
import logging
107
+
logging.getLogger('mavsdk_server').setLevel(logging.CRITICAL) # Hide all server output
108
+
109
+
**Common error messages:**
110
+
111
+
If you see error messages like these, they indicate connection string issues:
0 commit comments