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
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?
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.
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 :-)