I have a mobile application that communicates with ESP32 IoT project. The project uses non-volatile memory of the ESP to store data which I think where the error is. The software of the ESP32 is working fine on other chips. And it was working on this chip before connecting it with the App. Even with the App it doesn’t happen in most cases, but in few scenarios when I send the HTTP requests, the ESP32 chip keeps restarting and prints the attached error image on serial monitor [Guru Meditation Error: Core 1. panic’ed (LoadProhibited). Exception was unhandled]. I tried another chip and the same happened with it.
What could be the reason and how to fix it?
And can I fix those chips or just replace them?
This is the dart the function I’m using to send the HTTP requests:
Future<void> changeData() async {
var url = Uri.parse('http://$activeIP/ChangeData');
// print(requestBody["TimeZone"]);
// Prepare the 'application/x-www-form-urlencoded' request body
try {
var response = await http.post(
url,
body: requestBody,
headers: {'Content-Type': 'application/x-www-form-urlencoded'},
);
if (response.statusCode == 200) {
// print('Response data: ${response.body.toString()}');
} else {
print('Request failed with status: ${response.statusCode}.');
}
} catch (e) {
print('An error occurred: $e');
}
}
Screenshot from the serial monitor on Arduino IDE
I know this is a long question, so I appreciate your time reading it.
Thanks a lot!
Information that might help:
1- I tested on two chips and after several arguments this error happened
2- I noticed that the ESP32 sometimes receives an empty request even when the variable assigned to ‘requestBody’ sent from application wasn’t empty or null (printed it on VSCode).
Ahmed Abdullah is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.