|
META TOPICPARENT |
name="WebHome" |
Compiling Micropython
Forcing the correct module versions |
| 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 |
|
> > | 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:
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.
|
|
-- Uli Raich - 2020-04-29 |
|
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" |
|
|
> > |
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" |
|