troubleshooting.rst 1.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  1. :github_url: https://github.com/gopro/OpenGoPro/tree/main/demos/python/sdk_wireless_camera_control
  2. ===============
  3. Troubleshooting
  4. ===============
  5. This section will provide some information on how to debug the Open GoPro package.
  6. Logging
  7. -------
  8. There is a lot of logging sprinkled throughout using the standard Python logging module.
  9. Furthermore, there is a help function in `util.py` that will enable logging with some default modules / levels.
  10. All of the demos use this and here is an example:
  11. .. code-block:: python
  12. from pathlib import Path
  13. from open_gopro import WirelessGoPro
  14. from open_gopro.util import setup_logging
  15. logger = setup_logging(__name__, Path("my_log.log"))
  16. async with WirelessGoPro() as gopro:
  17. logger.info("I'm logged!")
  18. There are several other logging-related functions that extend and / or offer finer logging control.
  19. Here is a guide for the levels:
  20. =================== =======================
  21. Logging Level Module use
  22. =================== =======================
  23. logging.TRACE Custom logging level with even more information then debug. You should not need this.
  24. logging.DEBUG Maximum amount of information. Byte level tx / rx.
  25. logging.INFO String-level tx / rx. This is very readable.
  26. logging.WARNING Things that shouldn't have happened but won't break anything
  27. logging.ERROR This is bad and unrecoverable.
  28. logging.CRITICAL Not used.
  29. =================== =======================
  30. Bluetooth Characteristics
  31. -------------------------
  32. There is a utility in the GoPro class to dump the discovered BLE characteristics to a
  33. CSV file. This can be done as such:
  34. .. code-block:: python
  35. from open_gopro import WirelessGoPro
  36. with WirelessGoPro() as gopro:
  37. gopro._ble.gatt_db.dump_to_csv()