ekstrand / ESP8266wifi

ESP8266 Arduino library with built in reconnect functionality
MIT License
450 stars 235 forks source link

WIFI_STATE_CONNECT or WIFI_STATE_IDLE #33

Closed PA0MHE closed 7 years ago

PA0MHE commented 7 years ago

I tried running example "Simple_TCP_Client", however it didn't work.

Looking in the code I found the following: connectTCP() exits with: setRunningState(WIFI_STATE_CONNECT) send() test on if(getRunningState() == WIFI_STATE_IDLE) This is, in my case, always false so nothing is send.

I resolved this by changing in: if(getRunningState() == WIFI_STATE_CONNECT) Then is works !

I'm totally not sure if my findings or solution is the right !!!!!!!

PA0MHE commented 7 years ago

Jonas,

Not sure, but: RunningState WIFI_STATE_IDLE comes after the reception of "SEND OK", this comes in my case only after a successfull send() command, however to do a send() first is tested for WIFI_STATE_IDLE. So first transmission is impossible.

ekstrand commented 7 years ago

Martin it's been a while since I looked at the code. I have around 5 devices online 24/7 soo I know it worked at one time. I can't be 100% certain about the latest version since I have not upgraded the lib with the latest contributed patches.

If you verify that there is a bug I really welcome a patch :)

Regards Jonas

19 okt. 2016 kl. 19:23 skrev MaartenHeuv notifications@github.com:

Jonas,

Not sure, but: RunningState WIFI_STATE_IDLE comes after the reception of "SEND OK", this comes in my case only after a successfull send() command, however to do a send() first is tested for WIFI_STATE_IDLE. So first transmission is impossible.

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub, or mute the thread.

PA0MHE commented 7 years ago

Sorry,

My fault: There is no issue / bug

Maarten

PA0MHE commented 7 years ago

There was no issue