Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

An interesting bug in the example dht22-data-loger or in netcon? #51

Open
gerey73 opened this issue Jul 11, 2019 · 0 comments
Open

An interesting bug in the example dht22-data-loger or in netcon? #51

gerey73 opened this issue Jul 11, 2019 · 0 comments

Comments

@gerey73
Copy link

gerey73 commented Jul 11, 2019

I changed the example a little:

exception: EGAVEUP
variable: data
variable: server
variable: ecnt
 : measure ( -- temperature humidity | throws:EGAVEUP )
    10 0 do
        ['] dht-measure catch ?dup if ex-type cr 5000 ms else unloop exit then
    loop
    EGAVEUP throw ;
 : data! ( temperature humidity -- ) 16 lshift swap or data ! ;
 : connect ( -- ) 8005 "192.168.1.6" TCP netcon-connect server ! ; 
 : dispose ( -- ) server @ netcon-dispose ;
 : send ( -- ) server @ data 4 netcon-write-buf ;
 : log ( temperature humidity -- ) data! connect ['] send catch dispose throw ;
 : log-measurement ( -- ) { measure log } catch ?dup if  ex-type  1 ecnt +! ecnt @ space . cr then ; 
\ : main ( -- ) log-measurement 50 ms 120000000 deep-sleep ;
: main begin log-measurement 2000 ms again ;    

As long as the "server" receiving the information is working, everything seems fine.
But if you stop the server and wait for> 70 attempts to connect to the server and start the server again, then (esp8266) can no longer connect. Up to 70 attempts a connection is restored.
Failed to connect to 192.168.1.6:8005. Error: -14 NETCON error: -14 ENETCON 67 Failed to connect to 192.168.1.6:8005. Error: -14 NETCON error: -14 ENETCON 68 Failed to connect to 192.168.1.6:8005. Error: -14 NETCON error: -14 ENETCON 69 Failed to connect to 192.168.1.6:8005. Error: -14 NETCON error: -14 ENETCON 70 Failed to connect to 192.168.1.6:8005. Error: -14 NETCON error: -14 ENETCON 71 ENETCON 72 ENETCON 73 ENETCON 74 ENETCON 75 ENETCON 76 ENETCON 77

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant