So you're a Noob? Post your questions here until you graduate! Don't be shy.

User avatar
By StefanL38
#69981 Hi,

recently I encountered code-crashing and rebooting of my ESP8266-module with code that should do data-exchange between two ESP8266-modules.

I started with some TCP-server and client-code you can find in the web on several places.
These Lua-codes do work as a demo-example.

I sended back and forth some dozen characters between server and client but after 300 up to 1500 loops the code crashed with an error-message PANIC: unprotected error in call to Lua API: not connected

So can anybody show me how to code consequently in an eventdriven stile to avoid PANIC-crashing?
please do NOT post links to "basic TCP-server-codes. These are the codes I have used and that lead to the crashing if you want to use it for more than one minute of testing.

My main goal is to exchange some hundred bytes between several ESP8266-modules over WiFi
If somebody has other ideas how this data-exchange can be realised (like using UDP instead of TCP etc.)

I'm opened to these other approaches.

I will share my on experience and code-improvements about this here in this forum.

best regards

Stefan