Asturias
Posts: 11
Joined: Tue Jan 12, 2016 7:52 pm
Location: France

Net client Error:\0x09-10

Sat Jun 18, 2016 12:48 pm

Hello,

I have a server with esp8266 that send adc value and millis() just for testing

WifiMcu is client .. here is the program

Code: Select all

-- Error:\0x09-10
-- ** Start wifi in station mode and wait for connection ***
local wifiok = wifi.startsta()
if wifiok == false then
   print("Waiting for wifi connection...")
   local wifiok = wifi.startsta({ssid="ESP8266 Thing 685B", pass="nardino26", wait=12})
   
   if wifiok == false then
      print("Wifi not connected!")
      return
   end
end

-- Create new socket
if tcpskt ~= nil then
   -- close the socket if it existed
   net.close(tcpskt)
   tmr.delayms(100)
end
tcpskt = net.new(net.TCP,net.CLIENT)
if tcpskt < 0 then
   print("Error creating socket")
   return
end

-- setup  tcp server port and IP/domain

if tcp_server == nil then
   tcp_server = "192.168.4.1"
   
end
tcp_port = 80

while true do
stat = net.start(tcpskt, tcp_port, tcp_server, {wait=4})
print(net.status(tcpskt)) -- debug
if stat == 0 then
    stat, res = net.send(tcpskt, "/read")
   if (stat == 0) and (res ~= nil) then
      print(res)
   else
      print("Nok")
   end
else
   print("Error:", stat)
   return
end

fm,tas,mtas,fc=mcu.mem()
print(fm,tas,mtas,fc)     -- debug
print(net.status(tcpskt)) -- debug
tmr.delayms(200)
end



It is based on tcp client example from Loboris

After some good info displayed I get :

Code: Select all

1
Temp = 1 Aux = 454216
35968\0x0933664\0x0969632\0x0916
4
1
Temp = 1 Aux = 455525
35840\0x0933792\0x0969632\0x0914
4
1
Temp = 1 Aux = 456842
35944\0x0933688\0x0969632\0x0917
4
0
Error:\0x09-10


What does this error message mean ?
Thank you in advance for some help
Salutations

loboris
Posts: 40
Joined: Tue Sep 15, 2015 7:47 am
Location: Zagreb, Croatia

Re: Net client Error:\0x09-10

Sat Jun 18, 2016 9:55 pm

You can set net.debug(1) to get more info about operations and errors in net module.

Error code -10 in net.start means the socket is not connected, you can try to increase the wait time in net.start.
You can also put the net.start command before the while, and check the socket status inside the loop and reconnect only if necessary.

By the way, "0x09" is not part of the error code, it is the tab character which is not interpreted correctly by your terminal program.

Asturias
Posts: 11
Joined: Tue Jan 12, 2016 7:52 pm
Location: France

Re: Net client Error:\0x09-10

Wed Jun 22, 2016 11:48 am

Hi,

Thank you Loboris

I use cutecom because it has ymodem feature.
I am still experiencing same problems and considering my microcontrollers level I am not able to solve the problem :oops:
A memory problem? .. perhaps it would be better using callbak functions .
here is the last error message :

Code: Select all

Temp = 2 Aux = 7104819
cpt1447
0
Temp = 1 Aux = 7106429
cpt1448
0
Temp = 1 Aux = 7108037
cpt1449
0
Temp = 2 Aux = 7109647
cpt1450
0
[NET snd] Error: -1<>5
[NET clt] Error sending data: -2
Data not sent (err: -2)
Nok
0
[NET snd] Error: -1<>5
[NET clt] Error sending data: -2
Data not sent (err: -2)
Nok
0

Salutations


Return to “WiFiMCU”

Who is online

Users browsing this forum: No registered users and 3 guests