Webserver Problem . AP Mode and Station Mode at once

haraldfriedrich11
Posts: 1
Joined: Fri Mar 29, 2024 5:49 pm

Webserver Problem . AP Mode and Station Mode at once

Postby haraldfriedrich11 » Fri Mar 29, 2024 6:22 pm

Hey, i really need help with my code. It is quite a long code i would be happy if anyone could take a look over it.
This code is for my Automated window Control. Where you can Open the Window via Buttons, IR Remote, and Web Interface. There is an Automatic mode which looks at a microphone signal (the microphone signal gets amplified and then runs over an envelope demodulator so i have enough time to look at the signal) When its too loud the window closes and if its quiet for long enough it opens the window again. My goal is that it starts the AP Mode where i can enter Wifi Cridentials, and then the esp connects to the entered WiFi and shows the main Control Webpage. Right now it connects to the entered WiFi, but it just shows the AP Mode Website, so the ap_mode_html, and not the cotrol website so the index_html. How do i get it to show the control Website after Connecting. I will upload the full code as a TextFile and the Schematics as screenshots, one schematic is the whole circuit and one is just the microphone amplifier circuit.
If you find any other mistakes please be welcome and correct me.
The code runs on the 2 different cores of the ESP32 one handles the logic and one handles the Webserver
These are tho logic Functions running on one core

messStrom(): Measures the current flowing through the motor to determine if the motor has reached an obstacle or is blocked.
findeMittelpunkt(): Moves the window to its middle position by first moving in one direction until an obstacle is detected, then moving in the opposite direction for half the measured time.
istAnschlagErreicht(): Checks if the motor has reached an obstacle based on the current measurement.
forward() and reverse(): Control the motor's direction of rotation for opening or closing the window, respectively.
stopMotor(): Stops the motor.
checkMotorError(): Checks for motor errors based on a possible error indicator signal.
handleButtons(): Processes input from physical buttons for manual control commands.
handleIR(): Processes infrared commands from a remote control.
handleCurrent(): Monitors motor current to detect overload or blockage.
handleSerial(): Allows for control and monitoring of the system via the serial interface.
handleNoiseControl(): Implements logic for automatic control based on noise level measurements.
handleOeffnen(), oeffnenVonMitte and schliessenVonMitte(): Functions for opening or closing the window from/to its middle position.
handleAutomaticModeLED(): Controls the LED display for automatic mode.

These are the webServer Funtions
startAPMode(): Initiates the Access Point (AP) mode, allowing the user to connect to the ESP32 and configure WiFi settings via a webpage.
setupWiFiAndWebServer(): Configures the WiFi connection and initializes the web server for normal operation mode.
processor(): Used to insert dynamic content into webpages.

Thanks in advance i really hope somone can help, and if you need any additional info feel free to ask. Thanks!!!
Attachments
photo_2024-03-29_19-05-02.jpg
Schematic
photo_2024-03-29_19-05-02.jpg (172.76 KiB) Viewed 1323 times
photo_2024-03-29_19-05-03.jpg
Schematic
photo_2024-03-29_19-05-03.jpg (108.32 KiB) Viewed 1323 times
Works_kind_of_no_new_website.txt
Code
(31.55 KiB) Downloaded 76 times

Who is online

Users browsing this forum: No registered users and 54 guests