Account Options

  1. Sign in
The old Google Groups will be going away soon, but your browser is incompatible with the new version.
Google Groups Home
« Groups Home
uIP stack
There are currently too many topics in this group that display first. To make this topic appear first, remove this option from another topic.
There was an error processing your request. Please try again.
flag
  7 messages - Collapse all  -  Translate all to Translated (View all originals)
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
 
From:
To:
Cc:
Followup To:
Add Cc | Add Followup-to | Edit Subject
Subject:
Validation:
For verification purposes please type the characters you see in the picture below or the numbers you hear by clicking the accessibility icon. Listen and type the numbers you hear
 
Andrew Elwell  
View profile  
 More options Apr 23 2012, 5:21 am
From: Andrew Elwell <andrew.elw...@gmail.com>
Date: Mon, 23 Apr 2012 11:21:48 +0200
Local: Mon, Apr 23 2012 5:21 am
Subject: uIP stack
Hi Folks,

Is anyone out there using the UIP stack on their nanode? I've been
playing with the MQTT port https://github.com/njh/NanodeMQTT but I'm
seeing some wierd setup issues

If I reflash (original nanode5 + ftdi cable, arduino 1.0) with the
mqtt_publish example (IP addresss changed to local IP, added gateway [
 uip.set_gateway_addr(192, 168, 1, 1);
 ]
and setting the broker to be a local machine (
mqtt.set_server_addr(192, 168, 1, 251); ) I see the link up quickly
but the connect often takes an excessive time and seems to hang

tapping the reset button quickly often works and then the thing will
happily publish in loop()

Before I continue digging (tcpdump on broker) has anyone else experienced this?

Andrew


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Ben Laurie  
View profile  
 More options Apr 23 2012, 6:11 am
From: Ben Laurie <b...@links.org>
Date: Mon, 23 Apr 2012 11:11:52 +0100
Local: Mon, Apr 23 2012 6:11 am
Subject: Re: uIP stack

On Mon, Apr 23, 2012 at 10:21 AM, Andrew Elwell <andrew.elw...@gmail.com>wrote:

Ah. I had all sorts of problems with intermittent function on the Ethernet
chip - the problem is that at power up, all SPI chips are enabled. At
least, explicitly disabling them fixes the problem.

Its actually kinda obvious that something is horribly wrong, at least with
the code I'm using: it flashes the lights on the Ethernet port during
initialisation, and when this problem occurs, the flash does not happen
(lights still light up, tho - it seems the default config for the chip has
at least carrier detect...).


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Stephen Early  
View profile  
 More options Apr 23 2012, 1:48 pm
From: Stephen Early <s...@individualpubs.co.uk>
Date: Mon, 23 Apr 2012 10:48:37 -0700 (PDT)
Local: Mon, Apr 23 2012 1:48 pm
Subject: Re: uIP stack

I would recommend having a look using tcpdump.  If you're making
connections from the Nanode, as the MQTT example does, you might run into
problems because it'll use the same port and sequence number each time you
start it up.  tcpdump should let you know if this is what's happening!

Steve


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Nicholas Humfrey  
View profile  
 More options Apr 23 2012, 2:12 pm
From: Nicholas Humfrey <n...@aelius.com>
Date: Mon, 23 Apr 2012 19:12:25 +0100
Local: Mon, Apr 23 2012 2:12 pm
Subject: Re: uIP stack

Yes, the uIP stack gets very confused after a reset when it starts reusing TCP sequence numbers. Apologies, I got a bit distracted with some other projects, I should go back and sort this out.

Was thinking of storing a boot counter in an EEPROM somewhere, that can then be used as a seed.

Sent from my phone

On 23 Apr 2012, at 18:48, Stephen Early <s...@individualpubs.co.uk> wrote:


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Andrew Elwell  
View profile  
 More options Apr 23 2012, 5:13 pm
From: Andrew Elwell <andrew.elw...@gmail.com>
Date: Mon, 23 Apr 2012 23:13:50 +0200
Local: Mon, Apr 23 2012 5:13 pm
Subject: Re: uIP stack

> Yes, the uIP stack gets very confused after a reset when it starts reusing
> TCP sequence numbers. Apologies, I got a bit distracted with some other
> projects, I should go back and sort this out.

Bingo! That seems to be the problem -- got a trace and shows the port
nos wrapping and then MQTT stops as it gets the FIN from an earlier
packet.

So, tcpdump available at http://dl.dropbox.com/u/6594808/tcpdump_nanode

that was taken (with tcpdump -f tcpdump_nanode host nanode) at the
same time as a sub run from another host to get # and $SYS/#

[aelwell@pcitgtelwell ~]$ egrep '(nanode|uptime)' nanode_mqtt_tests
starting a subscriber on laptop and getting all, then resetting nanode:
$SYS/broker/uptime 46179 seconds
$SYS/broker/uptime 46190 seconds
$SYS/broker/uptime 46201 seconds
$SYS/broker/uptime 46212 seconds
nanode I'm Alive!
nanode I'm Alive!
nanode I'm Alive!
nanode I'm Alive!
nanode I'm Alive!
nanode I'm Alive!
nanode I'm Alive!
$SYS/broker/uptime 46223 seconds
nanode I'm Alive!
nanode I'm Alive!
nanode I'm Alive!
nanode I'm Alive!
nanode I'm Alive!
nanode I'm Alive!
nanode I'm Alive!
nanode I'm Alive!
nanode I'm Alive!
nanode I'm Alive!
nanode I'm Alive!
nanode I'm Alive!
nanode I'm Alive!
nanode I'm Alive!
nanode I'm Alive!
nanode I'm Alive!
nanode I'm Alive!
nanode I'm Alive!
nanode I'm Alive!
nanode I'm Alive!
nanode I'm Alive!
nanode I'm Alive!
$SYS/broker/uptime 46234 seconds
nanode I'm Alive!
nanode I'm Alive!
nanode I'm Alive!
nanode I'm Alive!
nanode I'm Alive!
nanode I'm Alive!
nanode I'm Alive!
nanode I'm Alive!
nanode I'm Alive!
nanode I'm Alive!
nanode I'm Alive!
nanode I'm Alive!
nanode I'm Alive!
nanode I'm Alive!
nanode I'm Alive!
nanode I'm Alive!
nanode I'm Alive!
nanode I'm Alive!
nanode I'm Alive!
nanode I'm Alive!
nanode I'm Alive!
nanode I'm Alive!
$SYS/broker/uptime 46245 seconds
nanode I'm Alive!
nanode I'm Alive!
nanode I'm Alive!
nanode I'm Alive!
nanode I'm Alive!
nanode I'm Alive!
nanode I'm Alive!
nanode I'm Alive!
nanode I'm Alive!
$SYS/broker/uptime 46256 seconds
$SYS/broker/uptime 46267 seconds
$SYS/broker/uptime 46278 seconds
... which shows the nanode falling over :-/

Ho Hum. I guess poking in the innards of uip is next then?


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Nicholas Humfrey  
View profile  
 More options Apr 23 2012, 6:06 pm
From: Nicholas Humfrey <n...@aelius.com>
Date: Mon, 23 Apr 2012 23:06:32 +0100
Local: Mon, Apr 23 2012 6:06 pm
Subject: Re: uIP stack

On 23 Apr 2012, at 22:13, Andrew Elwell wrote:

I would be very surprised if there was a problem in the core of uIP - it is very mature code and something like that would have been picket up by now. I did some work to sync up NanodeUip with the latest version of uIP. The only bit I haven't done is a complete update of the DHCP and DNS resolver code.

So I think it is more likely to be a problem with the interaction with the Arduino or ENC28J60 code. I have wondering if tweaking the uIP clock rate / code might help.

nick.


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Andrew Elwell  
View profile  
 More options Apr 23 2012, 6:15 pm
From: Andrew Elwell <andrew.elw...@gmail.com>
Date: Tue, 24 Apr 2012 00:15:42 +0200
Local: Mon, Apr 23 2012 6:15 pm
Subject: Re: uIP stack

> I would be very surprised if there was a problem in the core of uIP - it is very mature code and something like that would have been picket up by now. I did some work to sync up NanodeUip with the latest version of uIP. The only bit I haven't done is a complete update of the DHCP and DNS resolver code.

OK - The sketch I was using is a rate-unlimited version of the example
-- see https://gist.github.com/2470662

I initially was trying to do the once-per-5-sec to test.mosquitto.org
(hence the commented out IP and addition of gateway) but when that
didn't work I hacked it to go to a local broker

> So I think it is more likely to be a problem with the interaction with the Arduino or ENC28J60 code. I have wondering if tweaking the uIP clock rate / code might help.

Pass - this is beyond my comfort zone :-)

 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
End of messages
« Back to Discussions « Newer topic     Older topic »