Thing Plus WiFi Code

I purchased the Environmental Combo Breakout. where can I find code to use for it? I’ve tried relentlessly to create a project using whatever code I’ve downloaded from Espressif, but when I build there are nested header files that are not resolved. Any project structure, libraries, other tips would be greatly appreciated. Anything on GitHub that works? I’d like to get the two Thing Plus WiFi modules to communicate with each other.

Thanks!

Run through our guide https://learn.sparkfun.com/tutorials/cc … y-overview and be sure to grab the 2 required libraries, then wire it up and give it a whirl!

I began my effort with the top of the list of the article Sending Sensor Data Over WiFi.

https://learn.sparkfun.com/tutorials/se … -addresses

It speaks of two ESP32 WROOM 32E devices communicating with each other. I have tried relentlessly to get this to work but have been unsuccessful. Library errors, and a myriad of other messages have plagued my project.

What should I do? Any advice that works?

Hi,

We’ve been talking through the e-mail via the Tutorial Feedback. I copied a few the relevant responses into this forum so that we are on the same page.

Arduino Libraries

For the BME280 and SerLCD library, you can obtain those using the [Arduino Library Manager by doing a search for “SparkFun BME280” and “SparkFun SerLCD”. It sounds like you might have gotten these libraries installed though.

[AVR Based Serial Enabled LCDs Hookup Guide: Installing the Arduino Library

[GitHub: SerLCD Arduino Library

[SparkFun BME280 Breakout Hookup Guide: Installing the Arduino Library

[GitHub: SparkFun BME280 Arduino Library

The <WiFi.h>, <esp_now.h>, and <Wire.h> should automatically be included when you install the [Arduino Core for ESP32

Software Setup

The error code that you were seeing and provided in the e-mail, it does not seem like you installed the ESP32 board support files correctly. Make sure that you have installed the ESP32 board support files => [Installing a Third Party Board Definition or through espressif’s tutorial that was linked in our previous e-mail through their Arduino core for ESP32 => [ReadtheDoc: Espressif Arduino-ESP32 | Installing .

I was able to get the transmitter and receiver code to compile as expected from the tutorial using Arduino IDE v1.8.12, esp32 board support file v1.0.6 and v2.0.4, and selecting SparkFun ESP32 Thing Plus. I was using a computer with a Windows 10.

You stated in the e-mail that you removed & reinstalled the Arduino IDE and espressif files already. I’m not sure what your setup is but maybe we can recreate the issue that you are seeing if you can provide the following information.

  • What is your Arduino IDE version?

  • What is your ESP32 board definition version?

  • What is the board that you are selecting?
  • Wrong Library?

    Hmm. From your e-mail, it seems as though your computer is pulling the WiFi.h from …Arduino\libraries\WiFi Arduino program folder’s path instead of the *…AppData\Local\Arduino15\packages\esp32\hardware\esp32\1.0.6\libraries* . Here’s part of the error that you provided in the e-mail (i.e. without the username and replaced by “…” ).

    C:\Users\...\Documents\Arduino\sketch_aug14a\sketch_aug14a.ino: In function 'void loop()':
    sketch_aug14a:26:8: error: 'class WiFiClass' has no member named 'mode'
       WiFi.mode(WIFI_STA);
            ^~~~
    sketch_aug14a:26:13: error: 'WIFI_STA' was not declared in this scope
       WiFi.mode(WIFI_STA);
                 ^~~~~~~~
    sketch_aug14a:28:34: error: no matching function for call to 'WiFiClass::macAddress()'
       Serial.println(WiFi.macAddress());
                                      ^
    In file included from C:\Users\...\Documents\Arduino\sketch_aug14a\sketch_aug14a.ino:18:0:
    D:\Program Files (x86)\Arduino\libraries\WiFi\src/WiFi.h:137:14: note: candidate: uint8_t* WiFiClass::macAddress(uint8_t*)
         uint8_t* macAddress(uint8_t* mac);
                  ^~~~~~~~~~
    D:\Program Files (x86)\Arduino\libraries\WiFi\src/WiFi.h:137:14: note:   candidate expects 1 argument, 0 provided
    exit status 1
    'class WiFiClass' has no member named 'mode'
    

    Installing the ESP32 board support files should automatically install the WiFi folder in the correct path. Selecting the correct board (i.e. SparkFun ESP32 Thing Plus) should point it to the correct folder. Make sure that you are selecting the correct board definition as stated above.](Installing - - — Arduino ESP32 latest documentation)](https://learn.sparkfun.com/tutorials/installing-board-definitions-in-the-arduino-ide/installing-a-third-party-board-definition)](GitHub - espressif/arduino-esp32: Arduino core for the ESP32)](GitHub - sparkfun/SparkFun_BME280_Arduino_Library: An Arduino library to control the BME280 humidity and pressure sensor.)](https://learn.sparkfun.com/tutorials/sparkfun-bme280-breakout-hookup-guide#i)](GitHub - sparkfun/SparkFun_SerLCD_Arduino_Library: A library to seamlessly control the SparkFun SerLCD over I2C, SPI, and Serial.)](https://learn.sparkfun.com/tutorials/avr-based-serial-enabled-lcds-hookup-guide/all#sparkfun-serlcd-library)](https://learn.sparkfun.com/tutorials/installing-an-arduino-library/#using-the-arduino-library-manager)

    I’m going to uninstall everything and start from scratch. You’re probably right about the location of the location of library files. Thanks!

    Uninstalling and reinstalling worked. I’m able to upload sketches and flash the chip and watch things work. Does anyone have a sketch that makes the Thing Plus be a WiFi access point?

    I’m glad to hear that you got it working!

    You initially tried uninstalling/installing the Arduino IDE and board definitions. However, it seems like there were some old files causing issues compiling. You stated through a recent e-mail that you also “…removed the …AppData and …Arduino\libraries folders too.” to get it working to be specific (for anyone else that might run into the same issue). Checking in with TS-Russell , it sounds like this has happened before where users need to ensure that the Arduino IDE’s program and board files are deleted before getting the espressif files for the ESP32 to compile.

    Doing a brief search online, it sounds like you might want to look at this example to make an Access Point. You’ll probably want to modify the example a little for your needs. I hope this helps! =)

    WiFi Soft AP Example

    https://espressif-docs.readthedocs-host … ap-example