ESP8266 Connection Issue: Unable to Send HTTP Requests After Initial Mobile App Connection – Are There Permission Problems?

ERGEN 0 Reputation points
2024-08-02T07:38:10.4466667+00:00

I have an ESP8266 device that operates in AP mode, waiting for the SSID and password of the local Wi-Fi network to be entered, and connects to the internet once entered. It has a static IP address, and there is no issue with this device; it works fine.

I also have a mobile application that performs Wi-Fi scanning and connects to the network after entering the password (e.g., home internet). This part also works fine.

However, after the mobile application initially connects to the ESP8266, I am unable to send HTTP requests.

If I connect to the ESP8266 for the first time from the phone's Wi-Fi network, and then connect from the application at any time, it works.

During the first connection from the phone's Wi-Fi network, I get the following options under the "No internet" warning:

Only this time

Always (I need to select this option)

Cancel

However, when connecting from the application, this warning does not appear, and HTTP requests do not go through. I also cannot send HTTP requests from Chrome on the phone.

The application is connected, and the ESP8266 shows the connection in all cases, so there is no issue with the connection. The IP address is static, so it cannot be incorrect.

I have already granted the following permissions:

<uses-permission android:name="android.permission.ACCESS_WIFI_STATE" />

<uses-permission android:name="android.permission.CHANGE_WIFI_STATE" />

<uses-permission android:name="android.permission.CHANGE_NETWORK_STATE" />

<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />

<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />

<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" />

<uses-permission android:name="android.permission.INTERNET" />

It is clear that there is a permission issue, but I have not been able to resolve it. Thanks in advance to anyone who can help.

Developer technologies .NET .NET MAUI
{count} votes

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.