ramapcsx2 / gbs-control

GNU General Public License v3.0
771 stars 110 forks source link

New PlatformIO build - WiFi issues #536

Open jerzyjurgiel opened 4 months ago

jerzyjurgiel commented 4 months ago

Hi! I recently upgraded to the new build using platformio. So much better than Arduino studio. Although ever since new version, I had constant issues with GUI. Frontend is unable to connect using websockets to the ESP8266. It keeps calling onconnect and onclose right away. Sometime I can toggle a setting after clicking few times, but for ex. Console Output is always blank. Earlier arduino build had no such issue and there has not been any HW change on my side. Never happened before. Any advice?

Metaln00b commented 4 months ago

Hi! I recently upgraded to the new build using platformio. So much better than Arduino studio. Although ever since new version, I had constant issues with GUI. Frontend is unable to connect using websockets to the ESP8266. It keeps calling onconnect and onclose right away. Sometime I can toggle a setting after clicking few times, but for ex. Console Output is always blank. Earlier arduino build had no such issue and there has not been any HW change on my side. Never happened before. Any advice?

Pleas look at https://github.com/ramapcsx2/gbs-control/issues/531

So the UI works perfectly for me except for the console. It's quite possible that a few optimization flags need to be added or removed for platformio to get more heap.

jerzyjurgiel commented 4 months ago

Thanks, I looked through issues but didn't flag that one as similar issue. I guess it would be great to disable OLED support on a build or I'll just use rama's suggestion of modyfing the code :D

jerzyjurgiel commented 4 months ago

I also just found USE_NEW_OLED_MENU flag. I'll test it later today.

Metaln00b commented 4 months ago

If you want it would also be possible to place another ifdef statement around the oled code. Then the code is not compiled.

I and maybe a few other experienced people would have to see what the Arduino IDE uses for compiler flags and then add them to PlatformIO. Presumably the heap problems will then disappear. Unfortunately, the problem has only existed since the new OLED menu, although it is not necessarily a programming error.

I hope that my assumptions are related to your problem. The opening and closing of the sockets in the developer tools of the browser only appear if the debug messages for the console have been activated via the debug settings in the gbsc interface and I assume that this is normal. It's just not normal that you don't see any output 😅

jerzyjurgiel commented 4 months ago

I managed to "mitigate" this issue by forking the repo and removing OLED related code (for now, because I don't use it either way) and decreasing heap size in those if (getfreeheap() > xxx). I might try looking into those arduino flags. Building with PlatformIO is so much more streamlined, it would be hard to give it up.

ramapcsx2 commented 4 months ago

This heap mem check is dodgy to begin with. I guess it's trying to create new websockets for loosing connection with the old one (due to the radio issues). Maybe those can be recycled instead, dunno.. But it should be safe to play with the watermark value for free heap, to get the rest working as normal.