Compilation fails: "WiFi.h: No such file or directory"

Do you know how to fix this error message? I can’t seem to find much online.

C:\Users\rapsk\Documents\Arduino\BW16-Open-AT\BW16-Open-AT.ino:15:10: fatal error: WiFi.h: No such file or directory
 #include <WiFi.h>
          ^~~~~~~~
compilation terminated.
exit status 1

Compilation error: WiFi.h: No such file or directory

Hi @rapskallyun. Please add a reply here on this forum topic to tell us which Arduino board you are using.

Please be as specific as possible, as some Arduino boards with similar names have significant differences and the forum helpers can only provide effective assistance if we are aware of which one is being used.

If you aren't sure how to describe which board you are using, you can provide the link to the online product listing you bought the board from and we'll proceed based on the information found there.

1 Like

The most likely reason for that error is you have not installed the library called WiFi but it does also depend on what board you have selected.

This is a quote from the instructable for the Wispier project I’m working on.

“We'll be working with two identical ESP32-based development boards. These feature the ESP32-WROOM-32U module, which specifically integrates an IPEX (aka U.FL or IPX) coaxial connector for attaching an external antenna.”

Here is a link to the project page.

I'm going to ask you to provide the full verbose output from a compilation.


:red_exclamation_mark: This procedure is not intended to solve the problem. The purpose is to gather more information.


Please do this:

  1. Select File > Preferences... (or Arduino IDE > Settings... for macOS users) from the Arduino IDE menus.
    The "Preferences" dialog will open.
  2. Check the box next to "Show verbose output during: ☐ compile" in the "Preferences" dialog.
  3. Click the "OK" button.
    The "Preferences" dialog will close.
  4. Select Sketch > Verify/Compile from the Arduino IDE menus.
  5. Wait for the compilation to fail.
  6. You will see a "Compilation error: ..." notification at the bottom right corner of the Arduino IDE window. Click the "COPY ERROR MESSAGES" button on that notification.
  7. Open a reply here on this forum topic by clicking the "Reply" button.
  8. Click the <CODE/> icon on the post composer toolbar.
    This will add the forum's code block markup (```) to your reply to make sure the error messages are correctly formatted.
  9. Press the Ctrl+V keyboard shortcut (Command+V for macOS users).
    This will paste the compilation output into the code block.
  10. Move the cursor outside of the code block markup before you add any additional text to your reply.
  11. Click the "Reply" button to publish the post.

In case the output is longer than the forum software will allow to be added to a post, you can instead save it to a .txt file and then attach that file to a reply here.

Click here for attachment instructions

  1. Open any text editor program.
  2. Paste the copied output into the text editor.
  3. Save the file in .txt format.
  4. Open a reply here on this forum topic by clicking the "Reply" button.
  5. Click the "Upload" icon (Upload icon) on the post composer toolbar:

    The "Open" dialog will open.
  6. Select the .txt file you saved from the "Open" dialog.
  7. Click the "Open" button.
    The dialog will close.
  8. Click the "Reply" button to publish the post.

Alternatively, instead of using the "Upload" icon on the post composer toolbar as described in steps (5) - (7) above, you can simply drag and drop the .txt file onto the post composer field to attach it.

@rapskallyun Another non responder.

here goes…

This is the input I have

/*
  DigitalReadSerial

  Reads a digital input on pin 2, prints the result to the Serial Monitor

  This example code is in the public domain.

  https://docs.arduino.cc/built-in-examples/basics/DigitalReadSerial/
*/

// digital pin 2 has a pushbutton attached to it. Give it a name:
int pushButton = 0;

// the setup routine runs once when you press reset:
void setup() {
  // initialize serial communication at 9600 bits per second:
  Serial.begin(9600);
  // make the pushbutton's pin an input:
  pinMode(pushButton, INPUT);
}

// the loop routine runs over and over again forever:
void loop() {
  // read the input pin:
  int buttonState = digitalRead(pushButton);
  // print out the state of the button:
  Serial.println(buttonState);
  delay(1);  // delay in between reads for stability
}

And this is what I get for an output

Sketch uses 298891 bytes (22%) of program storage space. Maximum is 1310720 bytes.
Global variables use 20688 bytes (6%) of dynamic memory, leaving 306992 bytes for local variables. Maximum is 327680 bytes.
"C:\Users\rapsk\AppData\Local\Arduino15\packages\esp32\tools\esptool_py\5.0.0/esptool.exe" --chip esp32 --port "COM7" --baud 921600  --before default-reset --after hard-reset write-flash  -z --flash-mode keep --flash-freq keep --flash-size keep 0x1000 "C:\Users\rapsk\AppData\Local\arduino\sketches\028DB7BF515A35D7116663E8606D4DCB/DigitalReadSerial.ino.bootloader.bin" 0x8000 "C:\Users\rapsk\AppData\Local\arduino\sketches\028DB7BF515A35D7116663E8606D4DCB/DigitalReadSerial.ino.partitions.bin" 0xe000 "C:\Users\rapsk\AppData\Local\Arduino15\packages\esp32\hardware\esp32\3.3.0/tools/partitions/boot_app0.bin" 0x10000 "C:\Users\rapsk\AppData\Local\arduino\sketches\028DB7BF515A35D7116663E8606D4DCB/DigitalReadSerial.ino.bin" 
esptool v5.0.0
Serial port COM7:
Connecting.........
Connected to ESP32 on COM7:
Chip type:          ESP32-D0WD-V3 (revision v3.1)
Features:           Wi-Fi, BT, Dual Core + LP Core, 240MHz, Vref calibration in eFuse, Coding Scheme None
Crystal frequency:  40MHz
MAC:                14:33:5c:2e:25:a8

Uploading stub flasher...
Running stub flasher...
Stub flasher running.
Changing baud rate to 921600...
Changed.

Configuring flash size...
Flash will be erased from 0x00001000 to 0x00007fff...
Flash will be erased from 0x00008000 to 0x00008fff...
Flash will be erased from 0x0000e000 to 0x0000ffff...
Flash will be erased from 0x00010000 to 0x00059fff...
Compressed 25168 bytes to 16063...

Writing at 0x00001000 [                              ]   0.0% 0/16063 bytes... 

Writing at 0x00007250 [==============================] 100.0% 16063/16063 bytes... 
Wrote 25168 bytes (16063 compressed) at 0x00001000 in 0.4 seconds (562.8 kbit/s).
Hash of data verified.
Compressed 3072 bytes to 146...

Writing at 0x00008000 [                              ]   0.0% 0/146 bytes... 

Writing at 0x00008c00 [==============================] 100.0% 146/146 bytes... 
Wrote 3072 bytes (146 compressed) at 0x00008000 in 0.0 seconds (1561.2 kbit/s).
Hash of data verified.
Compressed 8192 bytes to 47...

Writing at 0x0000e000 [                              ]   0.0% 0/47 bytes... 

Writing at 0x00010000 [==============================] 100.0% 47/47 bytes... 
Wrote 8192 bytes (47 compressed) at 0x0000e000 in 0.0 seconds (2267.5 kbit/s).
Hash of data verified.
Compressed 299040 bytes to 160843...

Writing at 0x00010000 [                              ]   0.0% 0/160843 bytes... 

Writing at 0x0001bf1b [==>                           ]  10.2% 16384/160843 bytes... 

Writing at 0x00028ec7 [=====>                        ]  20.4% 32768/160843 bytes... 

Writing at 0x0002e4bf [========>                     ]  30.6% 49152/160843 bytes... 

Writing at 0x00033fc9 [===========>                  ]  40.7% 65536/160843 bytes... 

Writing at 0x00039302 [==============>               ]  50.9% 81920/160843 bytes... 

Writing at 0x0003e914 [=================>            ]  61.1% 98304/160843 bytes... 

Writing at 0x00044050 [====================>         ]  71.3% 114688/160843 bytes... 

Writing at 0x0004b4fc [=======================>      ]  81.5% 131072/160843 bytes... 

Writing at 0x000543bf [==========================>   ]  91.7% 147456/160843 bytes... 

Writing at 0x00059020 [==============================] 100.0% 160843/160843 bytes... 
Wrote 299040 bytes (160843 compressed) at 0x00010000 in 2.4 seconds (990.1 kbit/s).
Hash of data verified.

Hard resetting via RTS pin...

It tells me to change ‘init pushButton = 2; from 2 to 0 and when I do that this is the output I get and it hangs on the same Hard resetting via RTS pin…

Sketch uses 298891 bytes (22%) of program storage space. Maximum is 1310720 bytes.
Global variables use 20696 bytes (6%) of dynamic memory, leaving 306984 bytes for local variables. Maximum is 327680 bytes.
"C:\Users\rapsk\AppData\Local\Arduino15\packages\esp32\tools\esptool_py\5.0.0/esptool.exe" --chip esp32 --port "COM7" --baud 921600  --before default-reset --after hard-reset write-flash  -z --flash-mode keep --flash-freq keep --flash-size keep 0x1000 "C:\Users\rapsk\AppData\Local\arduino\sketches\028DB7BF515A35D7116663E8606D4DCB/DigitalReadSerial.ino.bootloader.bin" 0x8000 "C:\Users\rapsk\AppData\Local\arduino\sketches\028DB7BF515A35D7116663E8606D4DCB/DigitalReadSerial.ino.partitions.bin" 0xe000 "C:\Users\rapsk\AppData\Local\Arduino15\packages\esp32\hardware\esp32\3.3.0/tools/partitions/boot_app0.bin" 0x10000 "C:\Users\rapsk\AppData\Local\arduino\sketches\028DB7BF515A35D7116663E8606D4DCB/DigitalReadSerial.ino.bin" 
esptool v5.0.0
Serial port COM7:
Connecting....
Connected to ESP32 on COM7:
Chip type:          ESP32-D0WD-V3 (revision v3.1)
Features:           Wi-Fi, BT, Dual Core + LP Core, 240MHz, Vref calibration in eFuse, Coding Scheme None
Crystal frequency:  40MHz
MAC:                14:33:5c:2e:25:a8

Uploading stub flasher...
Running stub flasher...
Stub flasher running.
Changing baud rate to 921600...
Changed.

Configuring flash size...
Flash will be erased from 0x00001000 to 0x00007fff...
Flash will be erased from 0x00008000 to 0x00008fff...
Flash will be erased from 0x0000e000 to 0x0000ffff...
Flash will be erased from 0x00010000 to 0x00059fff...
Compressed 25168 bytes to 16063...

Writing at 0x00001000 [                              ]   0.0% 0/16063 bytes... 

Writing at 0x00007250 [==============================] 100.0% 16063/16063 bytes... 
Wrote 25168 bytes (16063 compressed) at 0x00001000 in 0.4 seconds (557.7 kbit/s).
Hash of data verified.
Compressed 3072 bytes to 146...

Writing at 0x00008000 [                              ]   0.0% 0/146 bytes... 

Writing at 0x00008c00 [==============================] 100.0% 146/146 bytes... 
Wrote 3072 bytes (146 compressed) at 0x00008000 in 0.0 seconds (1570.5 kbit/s).
Hash of data verified.
Compressed 8192 bytes to 47...

Writing at 0x0000e000 [                              ]   0.0% 0/47 bytes... 

Writing at 0x00010000 [==============================] 100.0% 47/47 bytes... 
Wrote 8192 bytes (47 compressed) at 0x0000e000 in 0.0 seconds (2401.1 kbit/s).
Hash of data verified.
Compressed 299040 bytes to 160839...

Writing at 0x00010000 [                              ]   0.0% 0/160839 bytes... 

Writing at 0x0001bf19 [==>                           ]  10.2% 16384/160839 bytes... 

Writing at 0x00028ec7 [=====>                        ]  20.4% 32768/160839 bytes... 

Writing at 0x0002e4c1 [========>                     ]  30.6% 49152/160839 bytes... 

Writing at 0x00033fc9 [===========>                  ]  40.7% 65536/160839 bytes... 

Writing at 0x00039302 [==============>               ]  50.9% 81920/160839 bytes... 

Writing at 0x0003e913 [=================>            ]  61.1% 98304/160839 bytes... 

Writing at 0x0004404f [====================>         ]  71.3% 114688/160839 bytes... 

Writing at 0x0004b4fc [=======================>      ]  81.5% 131072/160839 bytes... 

Writing at 0x000543bf [==========================>   ]  91.7% 147456/160839 bytes... 

Writing at 0x00059020 [==============================] 100.0% 160839/160839 bytes... 
Wrote 299040 bytes (160839 compressed) at 0x00010000 in 2.4 seconds (989.3 kbit/s).
Hash of data verified.

Hard resetting via RTS pin...

Everything looks good but when I check the serial monitor it looks like this

�0
0
0
0
0
0
0
0
0

and it just keeps outputting 0 regardless of pressing the BOOT button on the board. Pressing the other button labeled EN briefly shows a 1 on the serial monitor but the instructions say it should be showing 1 and only change to 0 when the BOOT button is pressed.

And I just remembered I never fully verified step 1 but these steps are using 2 separate boards so I kinda wanted to get something done and go back to try and finish step 1 with fresh eyes but I imagine I should be going step by step just to be safe.

I am beyond frustrated at this point so I may take another day or two and come back to this.

@sonofcy What do you mean by non responder?

And everything compiles fine because this is what the output looks when I verify even before I upload. No errors.

FQBN: esp32:esp32:esp32
Using board 'esp32' from platform in folder: C:\Users\rapsk\AppData\Local\Arduino15\packages\esp32\hardware\esp32\3.3.0
Using core 'esp32' from platform in folder: C:\Users\rapsk\AppData\Local\Arduino15\packages\esp32\hardware\esp32\3.3.0

cmd /c if exist "C:\\Users\\rapsk\\AppData\\Local\\Temp\\.arduinoIDE-unsaved2025714-20496-90fnrn.fdv4\\DigitalReadSerial\\partitions.csv" COPY /y "C:\\Users\\rapsk\\AppData\\Local\\Temp\\.arduinoIDE-unsaved2025714-20496-90fnrn.fdv4\\DigitalReadSerial\\partitions.csv" "C:\\Users\\rapsk\\AppData\\Local\\arduino\\sketches\\972C6FFC7DE8EBB220396764EF56F5F4\\partitions.csv"
cmd /c if not exist "C:\\Users\\rapsk\\AppData\\Local\\arduino\\sketches\\972C6FFC7DE8EBB220396764EF56F5F4\\partitions.csv" if exist "C:\\Users\\rapsk\\AppData\\Local\\Arduino15\\packages\\esp32\\hardware\\esp32\\3.3.0\\variants\\esp32\\partitions.csv" COPY "C:\\Users\\rapsk\\AppData\\Local\\Arduino15\\packages\\esp32\\hardware\\esp32\\3.3.0\\variants\\esp32\\partitions.csv" "C:\\Users\\rapsk\\AppData\\Local\\arduino\\sketches\\972C6FFC7DE8EBB220396764EF56F5F4\\partitions.csv"
cmd /c if not exist "C:\\Users\\rapsk\\AppData\\Local\\arduino\\sketches\\972C6FFC7DE8EBB220396764EF56F5F4\\partitions.csv" COPY "C:\\Users\\rapsk\\AppData\\Local\\Arduino15\\packages\\esp32\\hardware\\esp32\\3.3.0\\tools\\partitions\\default.csv" "C:\\Users\\rapsk\\AppData\\Local\\arduino\\sketches\\972C6FFC7DE8EBB220396764EF56F5F4\\partitions.csv"
        1 file(s) copied.
cmd /c IF EXIST "C:\\Users\\rapsk\\AppData\\Local\\Temp\\.arduinoIDE-unsaved2025714-20496-90fnrn.fdv4\\DigitalReadSerial\\bootloader.bin" ( COPY /y "C:\\Users\\rapsk\\AppData\\Local\\Temp\\.arduinoIDE-unsaved2025714-20496-90fnrn.fdv4\\DigitalReadSerial\\bootloader.bin" "C:\\Users\\rapsk\\AppData\\Local\\arduino\\sketches\\972C6FFC7DE8EBB220396764EF56F5F4\\DigitalReadSerial.ino.bootloader.bin" ) ELSE ( IF EXIST "C:\\Users\\rapsk\\AppData\\Local\\Arduino15\\packages\\esp32\\hardware\\esp32\\3.3.0\\variants\\esp32\\bootloader.bin" ( COPY "C:\\Users\\rapsk\\AppData\\Local\\Arduino15\\packages\\esp32\\hardware\\esp32\\3.3.0\\variants\\esp32\\bootloader.bin" "C:\\Users\\rapsk\\AppData\\Local\\arduino\\sketches\\972C6FFC7DE8EBB220396764EF56F5F4\\DigitalReadSerial.ino.bootloader.bin" ) ELSE ( "C:\\Users\\rapsk\\AppData\\Local\\Arduino15\\packages\\esp32\\tools\\esptool_py\\5.0.0\\esptool.exe" --chip esp32 elf2image --flash-mode dio --flash-freq 80m --flash-size 4MB -o "C:\\Users\\rapsk\\AppData\\Local\\arduino\\sketches\\972C6FFC7DE8EBB220396764EF56F5F4\\DigitalReadSerial.ino.bootloader.bin" "C:\\Users\\rapsk\\AppData\\Local\\Arduino15\\packages\\esp32\\tools\\esp32-arduino-libs\\idf-release_v5.5-b66b5448-v1\\esp32\\bin\\bootloader_qio_80m.elf" ) )
esptool v5.0.0
Creating ESP32 image...
Merged 2 ELF sections.
Successfully created ESP32 image.
cmd /c if exist "C:\\Users\\rapsk\\AppData\\Local\\Temp\\.arduinoIDE-unsaved2025714-20496-90fnrn.fdv4\\DigitalReadSerial\\build_opt.h" COPY /y "C:\\Users\\rapsk\\AppData\\Local\\Temp\\.arduinoIDE-unsaved2025714-20496-90fnrn.fdv4\\DigitalReadSerial\\build_opt.h" "C:\\Users\\rapsk\\AppData\\Local\\arduino\\sketches\\972C6FFC7DE8EBB220396764EF56F5F4\\build_opt.h"
cmd /c if not exist "C:\\Users\\rapsk\\AppData\\Local\\arduino\\sketches\\972C6FFC7DE8EBB220396764EF56F5F4\\build_opt.h" type nul > "C:\\Users\\rapsk\\AppData\\Local\\arduino\\sketches\\972C6FFC7DE8EBB220396764EF56F5F4\\build_opt.h"
cmd /c type nul > "C:\\Users\\rapsk\\AppData\\Local\\arduino\\sketches\\972C6FFC7DE8EBB220396764EF56F5F4/file_opts"
cmd /c COPY /y "C:\\Users\\rapsk\\AppData\\Local\\Arduino15\\packages\\esp32\\tools\\esp32-arduino-libs\\idf-release_v5.5-b66b5448-v1\\esp32\\sdkconfig" "C:\\Users\\rapsk\\AppData\\Local\\arduino\\sketches\\972C6FFC7DE8EBB220396764EF56F5F4\\sdkconfig"
        1 file(s) copied.
Detecting libraries used...
C:\Users\rapsk\AppData\Local\Arduino15\packages\esp32\tools\esp-x32\2411/bin/xtensa-esp32-elf-g++ -c @C:\Users\rapsk\AppData\Local\Arduino15\packages\esp32\tools\esp32-arduino-libs\idf-release_v5.5-b66b5448-v1\esp32/flags/cpp_flags -w -Os -Werror=return-type -w -x c++ -E -CC -DF_CPU=240000000L -DARDUINO=10607 -DARDUINO_ESP32_DEV -DARDUINO_ARCH_ESP32 -DARDUINO_BOARD="ESP32_DEV" -DARDUINO_VARIANT="esp32" -DARDUINO_PARTITION_default -DARDUINO_HOST_OS="windows" -DARDUINO_FQBN="esp32:esp32:esp32:UploadSpeed=921600,CPUFreq=240,FlashFreq=80,FlashMode=qio,FlashSize=4M,PartitionScheme=default,DebugLevel=none,PSRAM=disabled,LoopCore=1,EventsCore=1,EraseFlash=none,JTAGAdapter=default,ZigbeeMode=default" -DESP32=ESP32 -DCORE_DEBUG_LEVEL=0 -DARDUINO_RUNNING_CORE=1 -DARDUINO_EVENT_RUNNING_CORE=1 -DARDUINO_USB_CDC_ON_BOOT=0 @C:\Users\rapsk\AppData\Local\Arduino15\packages\esp32\tools\esp32-arduino-libs\idf-release_v5.5-b66b5448-v1\esp32/flags/defines -IC:\Users\rapsk\AppData\Local\Temp\.arduinoIDE-unsaved2025714-20496-90fnrn.fdv4\DigitalReadSerial -iprefix C:\Users\rapsk\AppData\Local\Arduino15\packages\esp32\tools\esp32-arduino-libs\idf-release_v5.5-b66b5448-v1\esp32/include/ @C:\Users\rapsk\AppData\Local\Arduino15\packages\esp32\tools\esp32-arduino-libs\idf-release_v5.5-b66b5448-v1\esp32/flags/includes -IC:\Users\rapsk\AppData\Local\Arduino15\packages\esp32\tools\esp32-arduino-libs\idf-release_v5.5-b66b5448-v1\esp32/qio_qspi/include -IC:\Users\rapsk\AppData\Local\Arduino15\packages\esp32\hardware\esp32\3.3.0\cores\esp32 -IC:\Users\rapsk\AppData\Local\Arduino15\packages\esp32\hardware\esp32\3.3.0\variants\esp32 @C:\Users\rapsk\AppData\Local\arduino\sketches\972C6FFC7DE8EBB220396764EF56F5F4/build_opt.h @C:\Users\rapsk\AppData\Local\arduino\sketches\972C6FFC7DE8EBB220396764EF56F5F4/file_opts C:\Users\rapsk\AppData\Local\arduino\sketches\972C6FFC7DE8EBB220396764EF56F5F4\sketch\DigitalReadSerial.ino.cpp -o nul
Generating function prototypes...
C:\Users\rapsk\AppData\Local\Arduino15\packages\esp32\tools\esp-x32\2411/bin/xtensa-esp32-elf-g++ -c @C:\Users\rapsk\AppData\Local\Arduino15\packages\esp32\tools\esp32-arduino-libs\idf-release_v5.5-b66b5448-v1\esp32/flags/cpp_flags -w -Os -Werror=return-type -w -x c++ -E -CC -DF_CPU=240000000L -DARDUINO=10607 -DARDUINO_ESP32_DEV -DARDUINO_ARCH_ESP32 -DARDUINO_BOARD="ESP32_DEV" -DARDUINO_VARIANT="esp32" -DARDUINO_PARTITION_default -DARDUINO_HOST_OS="windows" -DARDUINO_FQBN="esp32:esp32:esp32:UploadSpeed=921600,CPUFreq=240,FlashFreq=80,FlashMode=qio,FlashSize=4M,PartitionScheme=default,DebugLevel=none,PSRAM=disabled,LoopCore=1,EventsCore=1,EraseFlash=none,JTAGAdapter=default,ZigbeeMode=default" -DESP32=ESP32 -DCORE_DEBUG_LEVEL=0 -DARDUINO_RUNNING_CORE=1 -DARDUINO_EVENT_RUNNING_CORE=1 -DARDUINO_USB_CDC_ON_BOOT=0 @C:\Users\rapsk\AppData\Local\Arduino15\packages\esp32\tools\esp32-arduino-libs\idf-release_v5.5-b66b5448-v1\esp32/flags/defines -IC:\Users\rapsk\AppData\Local\Temp\.arduinoIDE-unsaved2025714-20496-90fnrn.fdv4\DigitalReadSerial -iprefix C:\Users\rapsk\AppData\Local\Arduino15\packages\esp32\tools\esp32-arduino-libs\idf-release_v5.5-b66b5448-v1\esp32/include/ @C:\Users\rapsk\AppData\Local\Arduino15\packages\esp32\tools\esp32-arduino-libs\idf-release_v5.5-b66b5448-v1\esp32/flags/includes -IC:\Users\rapsk\AppData\Local\Arduino15\packages\esp32\tools\esp32-arduino-libs\idf-release_v5.5-b66b5448-v1\esp32/qio_qspi/include -IC:\Users\rapsk\AppData\Local\Arduino15\packages\esp32\hardware\esp32\3.3.0\cores\esp32 -IC:\Users\rapsk\AppData\Local\Arduino15\packages\esp32\hardware\esp32\3.3.0\variants\esp32 @C:\Users\rapsk\AppData\Local\arduino\sketches\972C6FFC7DE8EBB220396764EF56F5F4/build_opt.h @C:\Users\rapsk\AppData\Local\arduino\sketches\972C6FFC7DE8EBB220396764EF56F5F4/file_opts C:\Users\rapsk\AppData\Local\arduino\sketches\972C6FFC7DE8EBB220396764EF56F5F4\sketch\DigitalReadSerial.ino.cpp -o C:\Users\rapsk\AppData\Local\Temp\2106889584\sketch_merged.cpp
C:\Users\rapsk\AppData\Local\Arduino15\packages\builtin\tools\ctags\5.8-arduino11/ctags -u --language-force=c++ -f - --c++-kinds=svpf --fields=KSTtzns --line-directives C:\Users\rapsk\AppData\Local\Temp\2106889584\sketch_merged.cpp

Compiling sketch...
"C:\\Users\\rapsk\\AppData\\Local\\Arduino15\\packages\\esp32\\tools\\esp-x32\\2411/bin/xtensa-esp32-elf-g++" -MMD -c "@C:\\Users\\rapsk\\AppData\\Local\\Arduino15\\packages\\esp32\\tools\\esp32-arduino-libs\\idf-release_v5.5-b66b5448-v1\\esp32/flags/cpp_flags" -w -Os -Werror=return-type -DF_CPU=240000000L -DARDUINO=10607 -DARDUINO_ESP32_DEV -DARDUINO_ARCH_ESP32 "-DARDUINO_BOARD=\"ESP32_DEV\"" "-DARDUINO_VARIANT=\"esp32\"" -DARDUINO_PARTITION_default "-DARDUINO_HOST_OS=\"windows\"" "-DARDUINO_FQBN=\"esp32:esp32:esp32:UploadSpeed=921600,CPUFreq=240,FlashFreq=80,FlashMode=qio,FlashSize=4M,PartitionScheme=default,DebugLevel=none,PSRAM=disabled,LoopCore=1,EventsCore=1,EraseFlash=none,JTAGAdapter=default,ZigbeeMode=default\"" -DESP32=ESP32 -DCORE_DEBUG_LEVEL=0 -DARDUINO_RUNNING_CORE=1 -DARDUINO_EVENT_RUNNING_CORE=1 -DARDUINO_USB_CDC_ON_BOOT=0 "@C:\\Users\\rapsk\\AppData\\Local\\Arduino15\\packages\\esp32\\tools\\esp32-arduino-libs\\idf-release_v5.5-b66b5448-v1\\esp32/flags/defines" "-IC:\\Users\\rapsk\\AppData\\Local\\Temp\\.arduinoIDE-unsaved2025714-20496-90fnrn.fdv4\\DigitalReadSerial" -iprefix "C:\\Users\\rapsk\\AppData\\Local\\Arduino15\\packages\\esp32\\tools\\esp32-arduino-libs\\idf-release_v5.5-b66b5448-v1\\esp32/include/" "@C:\\Users\\rapsk\\AppData\\Local\\Arduino15\\packages\\esp32\\tools\\esp32-arduino-libs\\idf-release_v5.5-b66b5448-v1\\esp32/flags/includes" "-IC:\\Users\\rapsk\\AppData\\Local\\Arduino15\\packages\\esp32\\tools\\esp32-arduino-libs\\idf-release_v5.5-b66b5448-v1\\esp32/qio_qspi/include" "-IC:\\Users\\rapsk\\AppData\\Local\\Arduino15\\packages\\esp32\\hardware\\esp32\\3.3.0\\cores\\esp32" "-IC:\\Users\\rapsk\\AppData\\Local\\Arduino15\\packages\\esp32\\hardware\\esp32\\3.3.0\\variants\\esp32" "@C:\\Users\\rapsk\\AppData\\Local\\arduino\\sketches\\972C6FFC7DE8EBB220396764EF56F5F4/build_opt.h" "@C:\\Users\\rapsk\\AppData\\Local\\arduino\\sketches\\972C6FFC7DE8EBB220396764EF56F5F4/file_opts" "C:\\Users\\rapsk\\AppData\\Local\\arduino\\sketches\\972C6FFC7DE8EBB220396764EF56F5F4\\sketch\\DigitalReadSerial.ino.cpp" -o "C:\\Users\\rapsk\\AppData\\Local\\arduino\\sketches\\972C6FFC7DE8EBB220396764EF56F5F4\\sketch\\DigitalReadSerial.ino.cpp.o"
Compiling libraries...
Compiling core...
cmd /c echo -DARDUINO_CORE_BUILD > "C:\\Users\\rapsk\\AppData\\Local\\arduino\\sketches\\972C6FFC7DE8EBB220396764EF56F5F4/file_opts"
Using precompiled core: C:\Users\rapsk\AppData\Local\arduino\cores\81927a10f1cc7dad289a96912bf3d556\core.a
cmd /c type nul > "C:\\Users\\rapsk\\AppData\\Local\\arduino\\sketches\\972C6FFC7DE8EBB220396764EF56F5F4/file_opts"
Linking everything together...
"C:\\Users\\rapsk\\AppData\\Local\\Arduino15\\packages\\esp32\\tools\\esp-x32\\2411/bin/xtensa-esp32-elf-g++" "-Wl,--Map=C:\\Users\\rapsk\\AppData\\Local\\arduino\\sketches\\972C6FFC7DE8EBB220396764EF56F5F4/DigitalReadSerial.ino.map" "-LC:\\Users\\rapsk\\AppData\\Local\\Arduino15\\packages\\esp32\\tools\\esp32-arduino-libs\\idf-release_v5.5-b66b5448-v1\\esp32/lib" "-LC:\\Users\\rapsk\\AppData\\Local\\Arduino15\\packages\\esp32\\tools\\esp32-arduino-libs\\idf-release_v5.5-b66b5448-v1\\esp32/ld" "-LC:\\Users\\rapsk\\AppData\\Local\\Arduino15\\packages\\esp32\\tools\\esp32-arduino-libs\\idf-release_v5.5-b66b5448-v1\\esp32/qio_qspi" -Wl,--wrap=esp_panic_handler "@C:\\Users\\rapsk\\AppData\\Local\\Arduino15\\packages\\esp32\\tools\\esp32-arduino-libs\\idf-release_v5.5-b66b5448-v1\\esp32/flags/ld_flags" "@C:\\Users\\rapsk\\AppData\\Local\\Arduino15\\packages\\esp32\\tools\\esp32-arduino-libs\\idf-release_v5.5-b66b5448-v1\\esp32/flags/ld_scripts" -Wl,--start-group "C:\\Users\\rapsk\\AppData\\Local\\arduino\\sketches\\972C6FFC7DE8EBB220396764EF56F5F4\\sketch\\DigitalReadSerial.ino.cpp.o" "C:\\Users\\rapsk\\AppData\\Local\\arduino\\cores\\81927a10f1cc7dad289a96912bf3d556\\core.a" "@C:\\Users\\rapsk\\AppData\\Local\\Arduino15\\packages\\esp32\\tools\\esp32-arduino-libs\\idf-release_v5.5-b66b5448-v1\\esp32/flags/ld_libs" -Wl,--end-group -Wl,-EL -o "C:\\Users\\rapsk\\AppData\\Local\\arduino\\sketches\\972C6FFC7DE8EBB220396764EF56F5F4/DigitalReadSerial.ino.elf"
"C:\\Users\\rapsk\\AppData\\Local\\Arduino15\\packages\\esp32\\tools\\esptool_py\\5.0.0/esptool.exe" --chip esp32 elf2image --flash-mode dio --flash-freq 80m --flash-size 4MB --elf-sha256-offset 0xb0 -o "C:\\Users\\rapsk\\AppData\\Local\\arduino\\sketches\\972C6FFC7DE8EBB220396764EF56F5F4/DigitalReadSerial.ino.bin" "C:\\Users\\rapsk\\AppData\\Local\\arduino\\sketches\\972C6FFC7DE8EBB220396764EF56F5F4/DigitalReadSerial.ino.elf"
esptool v5.0.0
Creating ESP32 image...
Merged 2 ELF sections.
Successfully created ESP32 image.
"C:\\Users\\rapsk\\AppData\\Local\\Arduino15\\packages\\esp32\\hardware\\esp32\\3.3.0\\tools\\gen_esp32part.exe" -q "C:\\Users\\rapsk\\AppData\\Local\\arduino\\sketches\\972C6FFC7DE8EBB220396764EF56F5F4/partitions.csv" "C:\\Users\\rapsk\\AppData\\Local\\arduino\\sketches\\972C6FFC7DE8EBB220396764EF56F5F4/DigitalReadSerial.ino.partitions.bin"
cmd /c if exist "C:\\Users\\rapsk\\AppData\\Local\\arduino\\sketches\\972C6FFC7DE8EBB220396764EF56F5F4\\libraries\\Insights" "C:\\Users\\rapsk\\AppData\\Local\\Arduino15\\packages\\esp32\\hardware\\esp32\\3.3.0\\tools\\gen_insights_package.exe" "C:\\Users\\rapsk\\AppData\\Local\\arduino\\sketches\\972C6FFC7DE8EBB220396764EF56F5F4" DigitalReadSerial.ino "C:\\Users\\rapsk\\AppData\\Local\\Temp\\.arduinoIDE-unsaved2025714-20496-90fnrn.fdv4\\DigitalReadSerial"
cmd /c if exist "C:\\Users\\rapsk\\AppData\\Local\\arduino\\sketches\\972C6FFC7DE8EBB220396764EF56F5F4\\libraries\\ESP_SR" if exist "C:\\Users\\rapsk\\AppData\\Local\\Arduino15\\packages\\esp32\\tools\\esp32-arduino-libs\\idf-release_v5.5-b66b5448-v1\\esp32\\esp_sr\\srmodels.bin" COPY /y "C:\\Users\\rapsk\\AppData\\Local\\Arduino15\\packages\\esp32\\tools\\esp32-arduino-libs\\idf-release_v5.5-b66b5448-v1\\esp32\\esp_sr\\srmodels.bin" "C:\\Users\\rapsk\\AppData\\Local\\arduino\\sketches\\972C6FFC7DE8EBB220396764EF56F5F4\\srmodels.bin"
"C:\\Users\\rapsk\\AppData\\Local\\Arduino15\\packages\\esp32\\tools\\esptool_py\\5.0.0/esptool.exe" --chip esp32 merge-bin -o "C:\\Users\\rapsk\\AppData\\Local\\arduino\\sketches\\972C6FFC7DE8EBB220396764EF56F5F4/DigitalReadSerial.ino.merged.bin" --pad-to-size 4MB --flash-mode keep --flash-freq keep --flash-size keep 0x1000 "C:\\Users\\rapsk\\AppData\\Local\\arduino\\sketches\\972C6FFC7DE8EBB220396764EF56F5F4/DigitalReadSerial.ino.bootloader.bin" 0x8000 "C:\\Users\\rapsk\\AppData\\Local\\arduino\\sketches\\972C6FFC7DE8EBB220396764EF56F5F4/DigitalReadSerial.ino.partitions.bin" 0xe000 "C:\\Users\\rapsk\\AppData\\Local\\Arduino15\\packages\\esp32\\hardware\\esp32\\3.3.0/tools/partitions/boot_app0.bin" 0x10000 "C:\\Users\\rapsk\\AppData\\Local\\arduino\\sketches\\972C6FFC7DE8EBB220396764EF56F5F4/DigitalReadSerial.ino.bin"
esptool v5.0.0
Wrote 0x400000 bytes to file 'C:\Users\rapsk\AppData\Local\arduino\sketches\972C6FFC7DE8EBB220396764EF56F5F4/DigitalReadSerial.ino.merged.bin', ready to flash to offset 0x0.
"C:\\Users\\rapsk\\AppData\\Local\\Arduino15\\packages\\esp32\\tools\\esp-x32\\2411/bin/xtensa-esp32-elf-size" -A "C:\\Users\\rapsk\\AppData\\Local\\arduino\\sketches\\972C6FFC7DE8EBB220396764EF56F5F4/DigitalReadSerial.ino.elf"
Sketch uses 298891 bytes (22%) of program storage space. Maximum is 1310720 bytes.
Global variables use 20696 bytes (6%) of dynamic memory, leaving 306984 bytes for local variables. Maximum is 327680 bytes.

Sorry I misread. EDIT, nope, I was right.

The comments say the following

But your code sets pushButton to pin 0 and there isn't any pin 0. It needs to be changed to the following

int pushButton = 2;

You also either need to add a resistor and connect appropriatly or change INPUT to INPUT_PULLUP, now when the button is pressed it will go from HIGH to LOW. You have no debounce so it will be flaky, you might want to use a button library to move on to more usefull sketches.

These are not the buttons used in a sketch.

Not a 'hang', normal operation.

It’s initially a 2 when I open the sketch but the instructions tell me to change it to 0

Also, how do I quote reply like you’re doing?

Hi @rapskallyun.

  1. Select the post content you wish to quote.
    A pop-up will appear above the selection:
  2. Click "Quote" in the pop-up.

The quote will now be added to the post composer.

1 Like

We are still waiting for you to respond to post 5. Everything you have showed us is NOT verbose.

Show me where the output says that. I never heard of a compiler that smart, BUT the comments are.

This is normal.

That appears to be a reference to Instructables tutorial that OP was following, not to any compiler output:

Too many things wrong with that sketch, typical Instructables. The OP needs to read the Arduino Cookbook.

Sorry, I've been away from my computer all week. I'll look up the arduino cookbook and start reading it this weekend.
And I'll get back to running the sketch and try to respond to post 5 as quick as I can.