Ethernet fails connecting after a while

The EtherTen combines an Uno-equivalent Arduino-compatible board and Wiznet-based Ethernet support, along with a microSD card slot and Power-over-Ethernet support. [Product page]
angusgr
Freetronics Staff
Freetronics Staff
Posts: 853
Joined: Tue Apr 09, 2013 11:19 pm
Location: Melbourne, Australia
Contact:

Re: Ethernet fails connecting after a while

Post by angusgr » Fri Jun 21, 2013 3:25 am

caramell wrote:Hi everybody,
Sleurhutje said in April 2012
When you receive a valid IP-address you can PING your interface using both IP-address and host name. E.g. is your MAC address is like 0x01,0x3a,0xf8,0xb1,0x41,0x30 the host name would be like "WIZ▒A0". That's not a valid host name! It might cause problems on networks. So the easiest way is to use what they call printable characters.
, and as I am recently using networks tools I'm not really sure of knowing what a "printable character" means. :?

Could you please precise what you meant or what you think it meant in this case. Is it only concerning letters and punctuation?
Hi Caramell,

In this case printable characters means "ASCII" printable characters, which is any letters, punctuation and some "standard" symbols like the ones you can type on a US English keyboard.

There's a full list on the Wikipedia page for ASCII here: https://en.wikipedia.org/wiki/ASCII#ASC ... characters

If you look at the table, you'll see each "glyph" (aka character) in the ASCII printable character set corresponds with a number between 32 (hexadecimal 0x20) and 126 (hexadecimal 0x7E). Sleurhutje's post is showing that if you use the MAC address (a sequence of numbers) to generate the host name by using each number as a character in the name, it's possible some of them will be from outside the printable range, so you get something unexpected (and maybe unusable) as the host name.

- Angus

scotto
Posts: 1
Joined: Sat Jan 25, 2014 5:05 am

Re: Ethernet fails connecting after a while

Post by scotto » Sat Jan 25, 2014 5:37 am

I'm having a similar problem that appears to be that data requested by 2 incoming sockets is replied back on a single socket.

I have an etherten with DHT22 which is polled by Zabbix every 15 seconds [poll time has been varied 5 to 30 seconds with no change in the problem].

The zabbix server polls separately for temp and humidity data [using the zabbix.agent item type], and the etherten replies with a numeric reply of format nn.nn. This can work for some time but fails after zabbix receives a response which is is a combination of both temperature and humidity. Zabbix is configured to accept a numeric response and reports the error data as and an illegal value, and then backs off polling for the particular data for a period of time. Mean whilst zabbix will continue polling for the remaining 'good' data as well as sending remote commands to the etherten [see below about remote commands].

I have trapped the data exchange with wireshark and it is clear that the reply contains both values in the data payload.

The main loop and command parsing is below:


void loop()
{
client = server.available();
if (client == true)
{
if (!connected)
{
client.flush();
connected = true;
delay(100);
}

if (client.available() > 0)
{
readTelnetCommand(client.read());
}
}
}
//--------------------------------------------
void readTelnetCommand(char c)
{

cmd += c;

if (c == '\n')
{
if (cmd.length() > 2)
{
// remove \r and \n from the string
cmd = cmd.substring(0,cmd.length() - 1);
if (debug)
Serial.println(cmd);
parseCommand();
}
}
}
//--------------------------------------------
void parseCommand() { //Commands recieved by agent on port 10050 parsing


// AGENT ping
if (cmd.equals("agent.ping"))
{
server.println("1");
client.stop();
delay(100);
}

// AGENT version
else if (cmd.equals("agent.version"))
{
server.println("ArduinZabbixVini.1.0");
client.stop();
delay(50);
}
// AGENT sensor2
else if (cmd.equals("temperature.read"))
{
t = dht.readTemperature();
server.println(t );
if (debug)
{
Serial.print("Temperature: ");
Serial.println(t );
}
client.stop();
delay(50);
}
// AGENT sensor1
else if (cmd.equals("humidity.read"))
{
h = dht.readHumidity();
server.println(h );
if (debug)
{
Serial.print("Humidity: ");
Serial.println(h );
}
client.stop();
delay(50);


Interestingly enough the etherten/wiznet doesn't hang but continues and receives remote commands from the zabbix server. For example a zabbix server trigger detects the lack of temperature data from the etherten and sends a remote command to the etherten which is parsed and sets of a local alarm, similarly another trigger detects over temperature and sends a remote temp.alarm command to the etherten.

Arduino 1.05 IDE and Ethernet2 library which has the the most recent proposed fix applied SnSR::CLOSE to EthernetClient.cpp

What I see on the analyser is that the reply data for humidity and temperature requests [which arrive on separate sockets] are sent back on a single socket.

Rudolphus
Posts: 1
Joined: Fri Apr 29, 2016 9:19 am

Re: Ethernet fails connecting after a while

Post by Rudolphus » Sat Apr 30, 2016 8:50 pm

hello,

is there anyone who solvled this problem. i have the same but have no solution.

JanHalsey
Posts: 1
Joined: Thu Jun 09, 2016 4:19 pm

Re: Ethernet fails connecting after a while

Post by JanHalsey » Thu Jun 09, 2016 5:13 pm

Hi everyone....i am new to this forum. Actually i think I've debugged it to the point where it appears the Wiznet 5100 leaves connections in the CLOSE_WAIT state, even though you called disconnect and there aren't any available bytes on the connection. I'm not 100% sure if that's a bug in the Ethernet Arduino library, or on Wiznet. I'm still working on understanding the Ethernet code enough to be able to confirm further. But when using EthernetClient I have the code change below in the connect method.

pcb turnkey china

jakejeon
Posts: 1
Joined: Tue Nov 08, 2016 8:54 am

Re: Ethernet fails connecting after a while

Post by jakejeon » Tue Nov 08, 2016 11:10 am

Sleurhutje wrote:@mr-russ: You're my hero. :ugeek:

Added the SnSR::CLOSE_WAIT to the EthernetClient.cpp (in Arduino 1.0 Ethernet Library line 44) and the EtherTen is running fine for a continuous 72 hours. Normally it would crash within 24 hours. Even in a high latency network no connection failures. Sometime the wait state takes up 60 seconds but all keeps going on without crashing.
I guess the current version(1.6.12) of Arduino IDE already includes this modification.
however, my Arduino is still hanging for other reason.

sofiakerry
Posts: 1
Joined: Sat Jul 15, 2017 5:08 am
Contact:

Re: Ethernet fails connecting after a while

Post by sofiakerry » Sat Jul 15, 2017 5:23 am

There are a few tutorials on youtube for connecting ethernet with codes. I think you should search them and watch. Hope you will get the best solution you want.

CCcam

vaiybora
Posts: 14
Joined: Mon Sep 25, 2017 3:28 pm

Re: Ethernet fails connecting after a while

Post by vaiybora » Tue Sep 26, 2017 12:51 pm

This page is very good,thank for sharing good topic. :P :P

หนังใหม่

sanpiseth40
Posts: 5
Joined: Tue Nov 14, 2017 7:59 am

Re: Ethernet fails connecting after a while

Post by sanpiseth40 » Wed Nov 15, 2017 4:47 am

Ethernet fails connecting after a while: client.connect() problem [imported] #1068. Closed. cmaglie opened this Issue on Nov 15, 2012 · 6 comments ...


บอลพรุ่งนี้

clibin009
Posts: 329
Joined: Mon Oct 23, 2017 2:57 am

chenjinyan

Post by clibin009 » Fri Jan 12, 2018 2:49 am

mbt shoes
louboutin
ray ban wayfarer
canada goose outlet
ugg outlet
michael kors uk
moncler schweiz
nfl jerseys wholesale
ugg boots on sale
air max
polo shirts
coach outlet online
vibram five fingers
longchamp outlet
adidas football boots
ugg boots
coach outlet
michael kors outlet
swarovski
cheap nfl jerseys
michael kors handbags
nike outlet store
mont blanc
scarpe mbt
the north face
adidas wings
ugg outlet
michael kors outlet
uggs outlet
scarpe hogan
ugg boots
ugg boots
adidas jeremy scott
cheap mlb jerseys
nike sb
nhl jerseys
cheap ray bans
michael kors outlet clearance
cheap nhl jerseys
michael kors
tory burch
pandora rings
canada goose jackets
michael kors handbags
moncler
ugg clearance
giuseppe zanotti shoes
coach outlet online
cheap nfl jerseys
cheap rolex watches
kate spade
michael kors outlet
coach handbags
ugg boots
tory burch
jordans
louboutin
nike air force
jordans
michael kors handbags
nike air
balance shoes
salvatore ferragamo
air max
nike outlet
oakley sunglasses
north face
coach factory outlet online
fitflops
birkenstock
nike football boots
timberland outlet
ralph lauren
ugg australia
michael kors
ugg
nike tn
birkenstock outlet
coach outlet online
pandora charms
nike blazer
ralph lauren outlet
ray ban sunglasses
pandora jewelry
ralph lauren uk
coach factory outlet online
coach outlet online
pandora jewelry
fitflops outlet
ray ban sunglasses
the north face
jordan retro
coach outlet online
timberland boots
hermes
polo ralph lauren
moncler
ugg outlet
coach outlet online
nike free run
nike uk
stan smith shoes
ugg boots sale
pandora jewelry canada
birkenstock sandals
north face uk
burberry scarf
canada goose jackets
longchamp
pandora jewelry
louboutin
coach factory online
ralph lauren
canada goose
air max
polo ralph lauren outlet
michael kors outlet
true religion jeans
oakley sunglasses wholesale
ralph lauren
michael kors outlet online
ugg outlet
burberry outlet
uggs
adidas yeezy
tory burch outlet
ray ban
air jordan 14
supreme outlet
kate spade handbags
ugg boots
nike outlet
north face jackets
ray ban
ray ban
ralph lauren uk
michael kors outlet
longchamp
louboutin
supreme uk
mont blanc pens
true religion jeans
prada
beats by dre
cheap jordans
nike factory outlet
jordan
ugg canada
ugg boots
nike huarache shoes
moncler outlet
coach outlet online
north face outlet
burberry scarf
tommy hilfiger
jordans
ray ban
ugg outlet store
coach factory outlet
nba jerseys
north face
oakley sunglasses
michael kors outlet
nike store uk
oakley sunglasses
louboutin
true religion jeans
flops
cheap mlb jerseys
the north face
under armour outlet
canada goose outlet
michael kors taschen
canada goose outlet
nike air max
pandora charms
tory burch outlet
true religion jeans
coach outlet
christian louboutin
ray ban
ray ban
ugg
jordan shoes
nike air max
ugg outlet
ferragamo outlet
ugg pas cher
moncler pas cher
polo ralph lauren
air jordan
michaelkors outlet online
moncler
coach
basketball shoes
uggs
juicy couture outlet
canada goose jackets
canada goose jackets
pandora uk
mac cosmetics
kate spade
moncler
air jordan
jordans
snapbacks wholesale
hermes outlet
ray ban sunglasses
ralph lauren
canada goose sale
michael kors outlet
cheap ugg boots
cheap ugg boots
polo ralph
manolo blahnik shoes
polo ralph
canada goose jackets
coach handbags
adidas outlet store
moncler outlet
flops
north face outlet
ugg italia
ralph lauren uk
mlb jerseys
coach outlet
ugg boots
north face jackets clearance
ugg outlet
burberry outlet canada
uggs
flip flops
doudoune canada goose
ugg boots
uggs outlet
ugg
coach outlet online
polo ralph lauren
oakley sunglasses
ray ban sunglasses
adidas stan smith shoes
swarovski crystal
uggs outlet
air jordan
flip flops
north face jackets
michael kors outlet
jordan shoes
uggs outlet
nike air max
polo ralph
timberland pro
jordan
north face
uggs outlet
replica watches
ugg boots
longchamp outlet
jordan shoes
canada goose
hermes birkin bags
north face uk
polo ralph lauren
adidas superstar
canada goose
red bottom shoes
jordan shoes
pandora
mcm bags
nike factory outlet
adidas uk
ray ban sunglasses wholesale
ugg
canada goose outlet
adidas shoes
prada handbags
coach factory outlet
supra shoes
burberry outlet online
louboutin
moncler
baseball jerseys
michael kors outlet
kate spade
north face
air max
supreme
uggs outlet
oakley sunglasses
coach factory outlet
adidas outlet
cheap oakley sunglasses
oakley canada
michael kors handbags
ugg boots
mulberry handbags
north face
canada goose jackets
ugg boots
true religion
coach outlet
canada goose
ugg boots
michael kors outlet
north face outlet
coach factory outlet
louboutin
uggs outlet
christian louboutin
timberland boots
ugg
oakley sunglasses
ferragamo shoes
ugg boots
louboutin
prada
kate spade
moncler outlet
hermes uk
canada goose canada
the north face
nike outlet
timberland boots
north face
ugg canada
oakley vault
doudoune canada goose
ugg outlet
coach outlet
oakley sunglasses
cheap nfl jerseys
nfl jerseys wholesale
canada goose sale
moncler jackets
prada bags
moncler
jordan shoes
true religion jeans
moncler
soccer jerseys
canada goose jackets
blackhawks jersey
ray ban sunglasses
longchamp handbags
moncler
coach
moncler jackets
nike air huarache
ralph lauren
pandora jewelry canada
longchamp
mont blanc pens
superdry clothing
converse shoes
louboutin
jordan pas cher
ugg boots
kate spade outlet
canada goose
ugg boots
ralph lauren
cheap nfl jerseys
adidas shoes
20181.12chenjinyan


Post Reply

Who is online

Users browsing this forum: No registered users and 3 guests