Difference: CompilingNopMicroPython (5 vs. 6)

Revision 62020-05-13 - UliRaich

Line: 1 to 1
 
META TOPICPARENT name="WebHome"

Compiling Micropython

Forcing the correct module versions

Line: 50 to 47
 The source code for the example module described in the docs and the dht11Raw module can be found in this gzipped tar archive:

https://iotworkshop.africa/pub/IoT_Course_English/CompilingNopMicroPython/user_modules.tar.gz

Added:
>
>

Debugging MicroPython

When using the ESP32 port of MicroPython you can use the logging facilities provided by ESP-IDF. Typically you define a DEBUG_printf function of this type:

debugPrintf.png

The ESP-IDF logging facility knows 5 levels of error logging:

  • ESP_LOGE: for errors
  • ESP_LOGW: for warnings
  • ESP_LOGI: for information messages (this level has been chosen in our example above)
  • ESP_LOGD: for debugging
  • ESP_LOGV: for verbose
You can set the logging level up to which you want to see the messages with

esp.osdebug(0,esp.LOG_INFO)

setting the level to "information". In this case LOGE, LOGW and LOGI messages will be shown but not LOGD and LOGV messages. If you set

esp.osdebug(None)

no messages will be shown.

The screen dump below shows the output of help(esp) with all the methods and constants defined in this module.

espModule.png

  -- Uli Raich - 2020-04-29
Line: 62 to 84
 
META FILEATTACHMENT attachment="modules.png" attr="" comment="" date="1588186737" name="modules.png" path="modules.png" size="35152" user="UliRaich" version="1"
META FILEATTACHMENT attachment="user_modules.tar.gz" attr="" comment="" date="1588408264" name="user_modules.tar.gz" path="user_modules.tar.gz" size="2205" user="UliRaich" version="1"
META FILEATTACHMENT attachment="upysh.png" attr="" comment="" date="1588841730" name="upysh.png" path="upysh.png" size="16059" user="UliRaich" version="1"
Added:
>
>
META FILEATTACHMENT attachment="debugPrintf.png" attr="" comment="" date="1589383416" name="debugPrintf.png" path="debugPrintf.png" size="20200" user="UliRaich" version="1"
META FILEATTACHMENT attachment="espModule.png" attr="" comment="" date="1589383922" name="espModule.png" path="espModule.png" size="50479" user="UliRaich" version="1"
 
This site is powered by the TWiki collaboration platform Powered by PerlCopyright © 2008-2024 by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
Ideas, requests, problems regarding TWiki? Send feedback