Connecting ESP32 via wifi to Raspberry pi4

Hi, I’ve only just started working with Platformio as I want connect an esp32 via wifi to my Raspberry pi4. I’ve complied the code, built it and uploaded it without any problems but cannot connect to the pi’s SSID. I get the following message in the serial monitor -
*WM: HTTP started.
*WM: About to scan()
*WM: About to scan()
*WM: Scan done
it then shows a couple of my neighbours’ wifi SSIDs, then repeats.
I cannot see it on 192.168.4.1 and don’t know where to go to next. Any help would be appreciated. TIA.

Your scenario is not clear to me.

Your Raspberr pi serves as Wifi accespoint?
Which code did you upload to the ESP?

Please describe what you like to achieve and share the code of your project.

Thank you for your quick reply. I’m trying to use an esp32 to send sensor information from the engine on my boat via wifi to a Raspberry, which has other sensors connected to it. Then connect Raspberry to a monitor. Can’t send the code as I’ve received this message “Sorry, new users can only put 2 links in a post”.

Does your Raspberry serve as a wifi accesspoint or is it connected to an accesspoint?

The esp must connect to the same wifi network as the raspberry is connected to.

How does your raspberry accepts the sensor data? Is there some http server running, or mqtt broker or … (so many possibillities).

Please describe how the whole system works.

I have configured the Raspberry to be an AP. I have checked and can see both the SSID of the Pi and esp32 on my phone. I’ve tried to set up the esp32 in platformio to connect to the Pi’s AP via wifi. Is there a way I can send you the main.cpp code?
The Pi accepts the local sensors (1wire & BMP280) data to it by connection to the GPIO pins. I’m using signal K via Open Plotter on the Pi to configure these sensors.

If you can see the SSID of your ESP on your phone, then the ESP is running in SoftAP-mode (acting as accesspoint).

You need to connect your ESP to the Raspberry Pi’s accesspoint by WiFi.begin("raspi-ssid-here","raspi-password-here");

It is still not clear to me, how the raspi accepts sensordata via wifi! Wire != Wifi!

The raspi must run some kind of server like http that accepts POST or mqtt broker or websocket server or … (as written: many possibilities here).

I have now inserted this additional line into the code where I think it should go and it has created an error. ‘error: ‘WiFi’ does not name a type’

I’m not sure if I’ve put it into the correct place, is there a way I can send you the full code?

I assume this is an Arduino project, right?

Looks like you didn’t #include <WiFi.h> !

Upload your project somewhere like github or so and share the link please.

Is this your first ESP32 project?

Yes, this is my first ESP32 project…and maybe my last! Using the Arduino framework. I really appreciate your help with this.

Please see following link for the code I have used so far. I’m using a ESP32dev board .

Thank you for sharing!
Now things are becoming more clear to me.

The code from the repository is very complex and is not “beginner friendly”.
Especially the use of the sensesp library.

It seems that the sensESP library includes its own WiFi code.
Delete the line 25.

Enter the WiFi credentials for the Raspberri Pi access point in lines 22-23.

Uncomment the lines 91-92 ( → remove the double slashes “//”)

Change line 91 to set_wifi(WIFI_SSID, WIFI_PASSWORD)
Change the address in line 92 to the IP address of your SK server (which hopefully runs on your Raspberr Pi).

A better place to get further help for this project is the SignalK/SenseESP repository

Thank you Boris for the information. I have made the necessary changes, but now have the error to line 88
'cannot convert SensESPAppBuilder to sensesp_app
->set_hostname(“Oceans-Dream-Instruments”)

Unfortunately, I am not familiar with the SenseESP library.
I think the people at the SenseESP library are most likely to be able to help you.
File a issue in the SenseESP repository.