'PinStatus' does not name a type : IDE compile error

Issue: 'PinStatus' does not name a type compile error
Platform: Linux 64 bit IDE !.8.19 on Ubuntu Linux 20.04 LTS OS

This is turning out to be a trying challenge. After installing python on my Desktop to try and eliminate these errors my IDE crashed yesterday and burned. So I am working off fresh install.

  1. Is there a definitive solution to this issue found on this site or another like Github or the Espressif site?

  2. If I should delete the current WiFiNINA library and reinstall manually a replacement what is the source location for the new file? The WiFiNINA Resource library [WiFiNINA - Arduino Reference] shows 1.8.13 as the latest/greatest version. Is there a different version that addresses these compile issues? Or does a manual install provide a benefit better than going through the IDE Library Manager?

  3. I found on Github this fix action at:
    Fix PinStatus error on some platforms by khoih-prog · Pull Request #185 · arduino-libraries/WiFiNINA · GitHub
    For file: Arduino/libraries/WiFiNINA/src/utility/wifi_drv.h

   static void debug(uint8_t on);
    static float getTemperature();
    static void pinMode(uint8_t pin, uint8_t mode);

// Next 5 lines of code are fix for PinStatus error

#if defined(ARDUINO_ARCH_MBED)
    static PinStatus digitalRead(uint8_t pin);
#else    
    static int digitalRead(uint8_t pin);
#endif       
    
    static void digitalWrite(uint8_t pin, uint8_t value);
    static uint16_t analogRead(uint8_t adc_channel);
    static void analogWrite(uint8_t pin, uint8_t value);

Error text from compiler:

In file included from /home/ed/Arduino/libraries/WiFiNINA/src/WiFiStorage.h:23,
                 from /home/ed/Arduino/libraries/WiFiNINA/src/WiFi.h:38,
                 from /home/ed/Arduino/libraries/WiFiNINA/src/WiFiNINA.h:23,
                 from /tmp/arduino_modified_sketch_634813/ConnectWithWPA.ino:12:
/home/ed/Arduino/libraries/WiFiNINA/src/utility/wifi_drv.h:293:12: error: 'PinStatus' does not name a type
     static PinStatus digitalRead(uint8_t pin);
            ^~~~~~~~~
exit status 1
Error compiling for board ESP32 Wrover Module.

Inserting this code change seemed to fix the 'hiccup' at this specific code location but the subsequent compile had a tsunami of additional errors, some related to 'PinStatus.'

  1. Is it necessary to relink any of the python3 stuff I installed earlier to the fresh install of IDE?

  2. Should I consider moving up to the new IDE 2.0 with the hopes these current issues may not be present?

  3. Is it critical to link to the exactly correct board type under Boards Manager for the ESP-WROOM-32? There is no menu selection item that explicitly matches.

thanks fellas...

Hi @edthewino. The WiFiNINA library is not intended for use on the ESP32. Even if you did solve this error and ran the sketch on the ESP32, nothing would happen because the ESP32 does not have the hardware configuration the WiFiNINA was written for use with.

The Wi-Fi communication library you should use with the ESP32 is called "WiFi".

You will find the example sketches that demonstrate its use by first selecting an ESP32 board from the Tools > Board menu in the Arduino IDE and then opening the File > Examples > WiFi menu.

There is some additional official documentation for the library here:
https://docs.espressif.com/projects/arduino-esp32/en/latest/api/wifi.html
There is also a huge amount of helpful information about these popular boards from the Arduino community around the Internet.


No. Just use the right library. Installing a different version would fix the 'PinStatus' does not name a type error, but nothing can fix the problem that the library is not intended for use with your hardware configuration.

I don't think so. Python is in no way related to these errors you are getting. If you get an error during upload then we can investigate any Python actions that are needed, but at the moment there is no reason to think there is a problem.

I recommend against it. Arduino IDE 2.0 can not fix this problem. It is currently in a beta testing state and has a lot of known problems, so you would likely end up with even more issues stacked on top of each other.

That said, you are very much welcome to try out Arduino IDE 2.0 and provide feedback, feature requests, bug reports, etc. You just might not want to use it as your main IDE for developing sketches. I would recommend waiting until your current problems have been resolved, since you aren't really in a good position for beta testing now when you don't have a baseline working Arduino IDE 1.x experience to compare Arduino IDE 2.0 against.

I think a lot of those boards options actually have the same configuration under the hood. For these, any board selection is as good as the next so long as it matches the configuration of your hardware. But there are some definite differences (e.g., ESP32 vs. ESP32-S2), so they are not all completely equivalent.

If you would like guidance on the board selection, I recommend opening a dedicated forum topic for that. The board selection is not in any way related to the current error you are experiencing.

in0, you have the patience of the biblical Jobe dealing with my elderly butt. Lol

I appreciate your getting me lined out on the distinction between WiFiNINA and WiFi. I did successfully compile & upload a web comm sketch on the esp32 and it works!

My main remaining issue is regarding ESP32 and Boards Manager.
Tools > Boards "ESP32 Wrover Module"
Boards Manager...
ESP32 Arduino (in sketches) > Listing of diff. bds.

Is the (in sketches) normal?
After the fresh install I had difficulty getting the github esp32 .json link into the Additional Boards Manager entry field. As a result in Tools/Boards Manager I could never get any esp32 search choices to appear for an install of the esp32 by Espressif package. That remains currently true; so I am not sure if this needs to be addressed or not.

So I went to:

https://docs.espressif.com/projects/arduino-esp32/en/latest/installing.html

and did a manual install with:

sudo usermod -a -G dialout $USER && \
sudo apt-get install git && \
wget https://bootstrap.pypa.io/get-pip.py && \
sudo python3 get-pip.py && \
sudo pip3 install pyserial && \
mkdir -p ~/Arduino/hardware/espressif && \
cd ~/Arduino/hardware/espressif && \
git clone https://github.com/espressif/arduino-esp32.git esp32 && \
cd esp32/tools && \
python3 get.py

Is this why the esp32 board choices are now appearing as "ESP32 Arduino (in sketches) " under Tools > Boards "ESP32 Wrover Module"? And is this correct & ok?

I gotta say one thing right now. All these dang headaches, crashes, compile errors, and re-installs have forced me to learn the Arduino IDE rather thoroughly. LOL
In retrospect many of my issues are turning out to be unforced errors.

Ed (thewino)

Haha. I'm just happy if I am able to be of assistance in some small ways.

Yay! Great job on getting it working.

The reason for this is that you did a manual installation. The IDE is just communicating that fact to you. This "(in sketchbook)" label is especially useful when beta testing boards platforms, where you might have the release version of the platform installed via Boards Manager and the beta version installed manually. Without the label, you would have two duplicate entries in the Arduino IDE Tools > Boards menu and no way to tell which was which.

I do recommend against doing manual installation of boards platforms except for when doing development or beta testing of the platform itself, in which case it is the only option.

One of the main reasons I recommend against manual installation is that it is much more complex (as I think you already found). However, it seems you have managed it successfully now.

The other reason is that you get the unstable beta testing version of the platform. For everyday usage, the stable release version is better because it is generally more thoroughly tested and the helpers here on the forum are more likely to be familiar with any issues it does have.

Yeah! As long as you are persistent and methodical, every problem can be an opportunity to learn.