Help: cannot open source file "wifi101.h" (dependency of "WIFIConnectorMKR1000.h")

Hi.
I’m new to programming, I’m working on a very small school project, it’s about connecting our arduino to the internet and transferring the data from the tmp36 sensor to thingsboard, our teacher gave us a ready made code, and we just need to build it and upload it to arduino mkr1000.

I use platformeIO being in vscode which runs on Linux Ubuntu 21.10(64 bits), I downloaded two libraries (MQTT and WIFI101) to use it for internet connection and data transfer.

Except that, after downloading the libraries, I have this problem that persists, I have struggled in the forums to find a solution in vain.

If someone can help me, I’d be really happy.

I am new (Linux, vscode, platformeio, arduino, cpp)

Here is the the errors that display.

1- #include errors detected. Please update your includePath. Squiggles are disabled for this translation unit (/home/yvan/Documents/PlatformIO/Projects/IoTMP36/src/main.cpp).

2- cannot open source file “wifi101.h” (dependency of “WIFIConnector_MKR1000.h”)

 > Executing task in folder IoTMP36: platformio run <

Processing mkr1000USB (platform: atmelsam; board: mkr1000USB; framework: arduino)
--------------------------------------------------------------------------------------------------------------
Verbose mode can be enabled via `-v, --verbose` option
CONFIGURATION: https://docs.platformio.org/page/boards/atmelsam/mkr1000USB.html
PLATFORM: Atmel SAM (7.0.0) > Arduino MKR1000
HARDWARE: SAMD21G18A 48MHz, 32KB RAM, 256KB Flash
DEBUG: Current (atmel-ice) External (atmel-ice, blackmagic, jlink)
PACKAGES: 
 - framework-arduino-samd 1.8.11 
 - framework-cmsis 1.40500.0 (4.5.0) 
 - framework-cmsis-atmel 1.2.2 
 - toolchain-gccarmnoneeabi 1.70201.0 (7.2.1)
LDF: Library Dependency Finder -> https://bit.ly/configure-pio-ldf
LDF Modes: Finder ~ chain, Compatibility ~ soft
Found 14 compatible libraries
Scanning dependencies...
Dependency Graph
|-- <WiFi101> 0.16.1
|   |-- <SPI> 1.0
|-- <MQTT> 2.5.0
|-- <SPI> 1.0
Building in release mode
Compiling .pio/build/mkr1000USB/src/main.cpp.o
In file included from src/main.cpp:11:0:
include/WIFIConnector_MKR1000.h:13:10: fatal error: wifi101.h: No such file or directory

*****************************************************************
* Looking for wifi101.h dependency? Check our library registry!
*
* CLI  > platformio lib search "header:wifi101.h"
* Web  > https://platformio.org/lib/search?query=header:wifi101.h
*
*****************************************************************

 #include <wifi101.h>
          ^~~~~~~~~~~
compilation terminated.
Compiling .pio/build/mkr1000USB/libde3/WiFi101/WiFiServer.cpp.o
Compiling .pio/build/mkr1000USB/libde3/WiFi101/WiFiUdp.cpp.o
Compiling .pio/build/mkr1000USB/libde3/WiFi101/bsp/source/nm_bsp_arduino.c.o
*** [.pio/build/mkr1000USB/src/main.cpp.o] Error 1
========================================= [FAILED] Took 1.57 seconds =========================================
The terminal process "platformio 'run'" terminated with exit code: 1.

Terminal will be reused by tasks, press any key to close it.

If you need more information for understant me, kindly ask me. thanks.

1 Like

You are on Linux where you have to take care to correctly spell the filenames in regards to the upper- and lowercasing. Windows ignores upper/lowercase in the filename.

Since you see m to want to use the WiFi101 library, it has a header called WiFi101.h. Not wifi101.h. (As can also be seen in tutorials). Change the code in your project’s include/WIFIConnector_MKR1000.h file accordingly.

1 Like

Thank you, that’s exactly the solution.
By the way, my teacher’s code was developed under windows, therefore, I just did copy and paste, I couldn’t imagine for a moment that this could happen.

Thank you very much, I had a hard time to find the solution.
Thanks again.

1 Like