Arduino Giga code crashes(board flashes red) "randomly"

* What is this The following code is an arduino giga project with the arduino giga display shield. The project's goal is for the board to display 2 different group of buttons, users and modes. The person managing the board will have to choose a mode and then select an user to send the selected mode to, uppon which a mqtt message will be send to the user's topic. * What's the problem? the code currently has an issue where having selected a mode and clicking on a user, the board will "randomly" crash(led flashes red), sometimes it doesn't and it's good, but after a reset to try again, it will crash. I've also had this problem occur when changing modes, but I can't replicate it. I've been stuck on this problem for the past 4 days, and used chatgpt extensively to try and find the issue to no avail. Here's the gist : https://gist.github.com/Agentgollem/b4b68feb036bcfe813974ff8291458ad
Gist
Domus Arduino Giga Code.ino
GitHub Gist: instantly share code, notes, and snippets.
3 Replies
GolemMan
GolemManOP6mo ago
Things I've tried : - remove the mqtt sending message part fixes the issue (but of course isn't what I want) - isolating the mqtt sending message part also works with no crahses (but of course isn't what I fully want) I believe there's either some sort of conflicting or memory issue going on but I can't quite put my finger on it.
Unknown User
Unknown User6mo ago
Message Not Public
Sign In & Join Server To View
GolemMan
GolemManOP5mo ago
tried it but it still persists, thanks for the idea though!! okay I fixed it after so much time, having the mqtt message being sent through a callback function must be unstable because sending it through the loop function seems to completely remove this issue so yeah that's probably the weirdest bug I've ever seen in my 5 years of coding, still thanks a lot of the help

Did you find this page helpful?