Working through smart home with raspberry pi esp32 and esp8266 and I wouldprefer to use VS Code but when I try to import AsyncMQTT library and AsyncTCP via platfoemio / libraries I find AsyncMQTT_Generic by Marvin ROGER which i think is the correct one I still get an error on the include statment within main.cpp saying I need to edit my library path file.
Now I realize this is all out of the range of your book I would like to take this oportunuty to also learn VS code so if you could point me in the direction of a good tutorial that would be great. I have looked at the one that Rui did but unfortuneately it dows not cover libraries.
Cheers Mal
Hi.
How are you installing the library? Are you using the button Add to Project? After that, compile the code and then upload it.
We have this getting started guide for VS Code.
I am using the wifiscan program by Rui
I am installing libraries as per the above tutorial. Yes adding to the project. Before I compile I get an error indicated on the line
#include <AsyncMqttClient.h> {Just found this had to change this line to #include <AsyncMqtt_Generic.h>}
Which fixed my inital problemvbut it still wont compile see below for the errors.
This is my platform.ini file
PlatformIO Project Configuration File
;
; Build options: build flags, source filter
; Upload options: custom upload port, speed and extra flags
; Library options: dependencies, extra library storages
; Advanced options: extra scripting
;
; Please visit documentation for the other options and examples
; https://docs.platformio.org/page/projectconf.html
[env:esp32doit-devkit-v1]
platform = espressif32
board = esp32doit-devkit-v1
framework = arduino
monitor_speed = 115200
lib_deps =
me-no-dev/AsyncTCP@^1.1.1
khoih-prog/AsyncMQTT_Generic@^1.7.0
Now when I compile it I get a bunch of errors
Building in release mode
Compiling .pio\build\esp32doit-devkit-v1\lib287\STM32Ethernet\Dhcp.cpp.o
Compiling .pio\build\esp32doit-devkit-v1\lib287\STM32Ethernet\Dns.cpp.o
Compiling .pio\build\esp32doit-devkit-v1\lib287\STM32Ethernet\EthernetClient.cpp.o
Compiling .pio\build\esp32doit-devkit-v1\lib287\STM32Ethernet\EthernetServer.cpp.o
Compiling .pio\build\esp32doit-devkit-v1\lib287\STM32Ethernet\EthernetUdp.cpp.o
Compiling .pio\build\esp32doit-devkit-v1\lib287\STM32Ethernet\STM32Ethernet.cpp.o
Compiling .pio\build\esp32doit-devkit-v1\lib287\STM32Ethernet\utility\ethernetif.cpp.o
Compiling .pio\build\esp32doit-devkit-v1\lib287\STM32Ethernet\utility\stm32_eth.cpp.o
.pio/libdeps/esp32doit-devkit-v1/STM32Ethernet/src/utility/ethernetif.cpp:48:10: fatal error: stm32_def.h: No such file or directory
*******************************************************************
* Looking for stm32_def.h dependency? Check our library registry!
*
* CLI > platformio lib search “header:stm32_def.h”
* Web > https://registry.platformio.org/search?q=header:stm32_def.h
*
*******************************************************************
#include “stm32_def.h”
^~~~~~~~~~~~~
compilation terminated.
*** [.pio\build\esp32doit-devkit-v1\lib287\STM32Ethernet\utility\ethernetif.cpp.o] Error 1
In file included from .pio/libdeps/esp32doit-devkit-v1/STM32Ethernet/src/EthernetUdp.h:43,
from .pio/libdeps/esp32doit-devkit-v1/STM32Ethernet/src/Dhcp.h:7,
from .pio/libdeps/esp32doit-devkit-v1/STM32Ethernet/src/Dhcp.cpp:6:
.pio/libdeps/esp32doit-devkit-v1/STM32Ethernet/src/utility/stm32_eth.h:42:10: fatal error: stm32_def.h: No such file or directory
*******************************************************************
* Looking for stm32_def.h dependency? Check our library registry!
*
* CLI > platformio lib search “header:stm32_def.h”
* Web > https://registry.platformio.org/search?q=header:stm32_def.h
*
*******************************************************************
#include “stm32_def.h”
^~~~~~~~~~~~~
compilation terminated.
*** [.pio\build\esp32doit-devkit-v1\lib287\STM32Ethernet\Dhcp.cpp.o] Error 1
In file included from .pio/libdeps/esp32doit-devkit-v1/STM32Ethernet/src/EthernetUdp.h:43,
from .pio/libdeps/esp32doit-devkit-v1/STM32Ethernet/src/Dns.cpp:5:
.pio/libdeps/esp32doit-devkit-v1/STM32Ethernet/src/utility/stm32_eth.h:42:10: fatal error: stm32_def.h: No such file or directory
*******************************************************************
* Looking for stm32_def.h dependency? Check our library registry!
*
* CLI > platformio lib search “header:stm32_def.h”
* Web > https://registry.platformio.org/search?q=header:stm32_def.h
*
*******************************************************************
#include “stm32_def.h”
^~~~~~~~~~~~~
compilation terminated.
*** [.pio\build\esp32doit-devkit-v1\lib287\STM32Ethernet\Dns.cpp.o] Error 1
In file included from .pio/libdeps/esp32doit-devkit-v1/STM32Ethernet/src/EthernetClient.h:7,
from .pio/libdeps/esp32doit-devkit-v1/STM32Ethernet/src/STM32Ethernet.h:6,
from .pio/libdeps/esp32doit-devkit-v1/STM32Ethernet/src/EthernetServer.cpp:5:
.pio/libdeps/esp32doit-devkit-v1/STM32Ethernet/src/utility/stm32_eth.h:42:10: fatal error: stm32_def.h: No such file or directory
*******************************************************************
* Looking for stm32_def.h dependency? Check our library registry!
*
* CLI > platformio lib search “header:stm32_def.h”
* Web > https://registry.platformio.org/search?q=header:stm32_def.h
*
*******************************************************************
#include “stm32_def.h”
^~~~~~~~~~~~~
compilation terminated.
In file included from .pio/libdeps/esp32doit-devkit-v1/STM32Ethernet/src/EthernetClient.h:7,
from .pio/libdeps/esp32doit-devkit-v1/STM32Ethernet/src/STM32Ethernet.h:6,
from .pio/libdeps/esp32doit-devkit-v1/STM32Ethernet/src/STM32Ethernet.cpp:1:
.pio/libdeps/esp32doit-devkit-v1/STM32Ethernet/src/utility/stm32_eth.h:42:10: fatal error: stm32_def.h: No such file or directory
*******************************************************************
* Looking for stm32_def.h dependency? Check our library registry!
*
* CLI > platformio lib search “header:stm32_def.h”
* Web > https://registry.platformio.org/search?q=header:stm32_def.h
*
*******************************************************************
#include “stm32_def.h”
^~~~~~~~~~~~~
compilation terminated.
*** [.pio\build\esp32doit-devkit-v1\lib287\STM32Ethernet\EthernetServer.cpp.o] Error 1
*** [.pio\build\esp32doit-devkit-v1\lib287\STM32Ethernet\STM32Ethernet.cpp.o] Error 1
In file included from .pio/libdeps/esp32doit-devkit-v1/STM32Ethernet/src/EthernetClient.h:7,
from .pio/libdeps/esp32doit-devkit-v1/STM32Ethernet/src/STM32Ethernet.h:6,
from .pio/libdeps/esp32doit-devkit-v1/STM32Ethernet/src/EthernetClient.cpp:7:
.pio/libdeps/esp32doit-devkit-v1/STM32Ethernet/src/utility/stm32_eth.h:42:10: fatal error: stm32_def.h: No such file or directory
*******************************************************************
* Looking for stm32_def.h dependency? Check our library registry!
*
* CLI > platformio lib search “header:stm32_def.h”
* Web > https://registry.platformio.org/search?q=header:stm32_def.h
*
*******************************************************************
#include “stm32_def.h”
^~~~~~~~~~~~~
compilation terminated.
In file included from .pio/libdeps/esp32doit-devkit-v1/STM32Ethernet/src/EthernetClient.h:7,
from .pio/libdeps/esp32doit-devkit-v1/STM32Ethernet/src/STM32Ethernet.h:6,
from .pio/libdeps/esp32doit-devkit-v1/STM32Ethernet/src/EthernetUdp.cpp:28:
.pio/libdeps/esp32doit-devkit-v1/STM32Ethernet/src/utility/stm32_eth.h:42:10: fatal error: stm32_def.h: No such file or directory
*******************************************************************
* Looking for stm32_def.h dependency? Check our library registry!
*
* CLI > platformio lib search “header:stm32_def.h”
* Web > https://registry.platformio.org/search?q=header:stm32_def.h
*
I am running arduino.ide 1.8.19
just updated from 1.8.13
Hope all this helps
Thanks in advane
Mal
Hi.
Accordingly to the error, you need to install the stm32_def.h library.
Regards,
Sara
Could not find anything relating to stm32_def.h library but found other peple were also having trouble with it using the AsyncMQTT_Generic library/ Found I needed to use the AsyncMqttClientlibrary and not the AsyncMQTT_Generic as your book says.