mqtt simulink block with ESP32 Failed

2 views (last 30 days)
Anil Shrestha
Anil Shrestha on 24 Jul 2022
Answered: Nakul Khadilkar on 25 Aug 2022
Hallo everyone,
I am trying to publish my Sensor Data in a Think Speak channel with the Help of Simulink Arduino MQTT Publish block. I am using a ESP32 Node MCU V1 microcontroller. I keep getting "Code generation information file does not exist" error and dont know how to proceed ahead. The Block supports ESP32 Microcontroller as shown in Information in Help Center.
Can anyone point out my mistake or have a solution for my Problem?
Best Regards
Shrestha
### Starting build procedure for: WebDisplay ### Generating code and artifacts to 'Model specific' folder structure ### Generating code into build folder: C:\DisplayIOT\WebDisplay_ert_rtw ### Invoking Target Language Compiler on WebDisplay.rtw ### Using System Target File: C:\Program Files\MATLAB\R2022b\rtw\c\ert\ert.tlc ### Loading TLC function libraries ....... ### Initial pass through model to cache user defined code . ### Caching model source code ........................................ ### Writing header file WebDisplay_types.h ### Writing header file WebDisplay.h ### Writing header file rtwtypes.h ### Writing header file multiword_types.h ### Writing source file WebDisplay.c . ### Writing header file WebDisplay_private.h ### Writing source file WebDisplay_data.c ### Writing header file rtmodel.h ### Writing source file ert_main.c ### TLC code generation complete (took 2.696s). ### Creating extmode_task_info.m. ### Creating external mode types file ext_mode_types.h ### Allocated 896 bytes for internal data structures of XCP stack. Considered a maximum of 4 Object Descriptor Tables (ODTs) and 4 Data Acquisition objects (DAQs), with no more than 3 ODTs in each DAQ and no more than 6 entries in each ODT. ### Allocated 66206 bytes for storage of XCP packets. Considered 670 bytes for Command Transfer Objects (CTOs) and 65536 bytes for Data Transfer Objects (DTOs). ### For more information, see Memory Allocation for Communication Buffers. ### Saving binary information cache. ### Using toolchain: ESP32 ### Creating 'C:\DisplayIOT\WebDisplay_ert_rtw\WebDisplay.mk' ... ### Building 'WebDisplay': "C:\PROGRA~1\MATLAB\R2022b\bin\win64\gmake" -f wrapper.mk all C:\DisplayIOT\WebDisplay_ert_rtw>cd . C:\DisplayIOT\WebDisplay_ert_rtw>if "all" == "" ("C:\PROGRA~1\MATLAB\R2022b\bin\win64\gmake" -f wrapper.mk all ) else ("C:\PROGRA~1\MATLAB\R2022b\bin\win64\gmake" -f wrapper.mk all ) "### Generating static library." "C:/Program Files/MATLAB/R2022b/bin/win64/gmake" -j7 -C "C:/PROGRA~3/MATLAB/SUPPOR~1/R2022B~1/toolbox/target/SUPPOR~1/ARDUIN~2/STATIC~1" SHELL="%SystemRoot%/system32/cmd.exe" -f esp32comm.mk all gmake[1]: Entering directory `C:/PROGRA~3/MATLAB/SUPPOR~1/R2022B~1/toolbox/target/SUPPOR~1/ARDUIN~2/STATIC~1' "### Successfully generated libcomm.a library." gmake[1]: Leaving directory `C:/PROGRA~3/MATLAB/SUPPOR~1/R2022B~1/toolbox/target/SUPPOR~1/ARDUIN~2/STATIC~1' "C:/Program Files/MATLAB/R2022b/bin/win64/gmake" -j7 -C "C:/PROGRA~3/MATLAB/SUPPOR~1/R2022B~1/toolbox/target/SUPPOR~1/ARDUIN~2/STATIC~1" SHELL="%SystemRoot%/system32/cmd.exe" -f esp32addon.mk all gmake[1]: Entering directory `C:/PROGRA~3/MATLAB/SUPPOR~1/R2022B~1/toolbox/target/SUPPOR~1/ARDUIN~2/STATIC~1' gmake[1]: Leaving directory `C:/PROGRA~3/MATLAB/SUPPOR~1/R2022B~1/toolbox/target/SUPPOR~1/ARDUIN~2/STATIC~1' gmake[1]: *** No rule to make target `C:/PROGRA~3/MATLAB/SUPPOR~1/R2022B~1/aIDE/portable/SKETCH~1/LIBRAR~1/PubSubClient/src/PubSubClient.cpp', needed by `C:/DISPLA~1/WEBDIS~1/PubSubClient.o'. Stop. gmake: *** [all] Error 2 C:\DisplayIOT\WebDisplay_ert_rtw>echo The make command returned an error of 2 The make command returned an error of 2 C:\DisplayIOT\WebDisplay_ert_rtw>exit /B 1 ### Build procedure for WebDisplay aborted due to an error.
Build Summary
Top model targets built: Model Action Rebuild Reason ====================================================================== WebDisplay Failed Code generation information file does not exist. 0 of 1 models built (0 models already up to date) Build duration: 0h 0m 16.872s
Error(s) encountered while building "WebDisplay"
Component:Simulink | Category:Model error

Answers (1)

Nakul Khadilkar
Nakul Khadilkar on 25 Aug 2022
Hello Anil,
This seems to an issue with the prerelease version of R2022b MATLAB.
Regarding the error, I see the following:
*** No rule to make target `C:/PROGRA~3/MATLAB/SUPPOR~1/R2022B~1/aIDE/portable/SKETCH~1/LIBRAR~1/PubSubClient/src/PubSubClient.cpp'
Try going through the hardware setup screens and install the library and build again.
-Nakul

Products

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!