mysmartgrid / hexabus

The HexaBus Project: An IPv6-based home automation bus. We develop both hard- and software for the future of home automation.
http://hexabus.net
49 stars 15 forks source link

hexabusbridge terminating with "Network is unreachable" #234

Closed kaikrueger closed 10 years ago

kaikrueger commented 10 years ago

In my testing environment the hexabus_msg_bridge is terminating with "Network is unreachable". strace shows: ecvmsg(6, {msg_name(28)={sa_family=AF_INET6, sin6_port=htons(61616), inet_pton(AF_INET6, "fde2:8720:f51a:638:204:23ff:fea8:a23e", &sin6_addr), sin6_flowinfo=0, sin6_scope_id=0}, msg_iov(1)=[{"HX0C\1\0\0\0\0006\3\0\0\0\0\30\222\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"..., 1024}], msg_controllen=0, msg_flags=0}, 0) = 17 gettimeofday({1396859390, 573862}, NULL) = 0 epoll_wait(0x4, 0xbecf29c8, 0x80, 0) = 0 recvmsg(6, {msg_name(28)={sa_family=AF_INET6, sin6_port=htons(61616), inet_pton(AF_INET6, "fd00:a3::50:c4ff:fe04:8149", &sin6_addr), sin6_flowinfo=0, sin6_scope_id=0}, msg_iov(1)=[{"HX0C\1\0\0\0\0\10\5<^\322\211\340\4\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"..., 1024}], msg_controllen=0, msg_flags=0}, 0) = 17 gettimeofday({1396859390, 581094}, NULL) = 0 gettimeofday({1396859390, 586053}, NULL) = 0 sendmsg(7, {msg_name(28)={sa_family=AF_INET6, sin6_port=htons(61616), inet_pton(AF_INET6, "fd00:a3::50:c4ff:fe04:8149", &sin6_addr), sin6_flowinfo=0, sin6_scope_id=0}, msg_iov(1)=[{"HX0C\n\0\0\0\0\0\365\201", 12}], msg_controllen=0, msg_flags=0}, MSG_NOSIGNAL) = -1 ENETUNREACH (Network is unreachable) close(7) = 0 close(6) = 0 close(4) = 0 close(5) = 0 close(3) = 0 write(2, "Network error: ", 15Network error: ) = 15 write(2, "Network is unreachable", 22Network is unreachable) = 22 write(2, "\n", 1

It seems that the primary cause is that one of the Hexaplugs has a second ip6-adress, but the hexabus bridge should be able deal with such a problem and should not just exit. In this case no values are sent to the platform. So we need a better error handling.

ghost commented 10 years ago

A Hexabus device can only have two addresses from two different networks if it was successfully booted in one network and then paired to another network. The only reasonable thing to do then is to forget the device entirely until it has an address we can actually work with. That said, should be fixed in fb00432.

ghost commented 10 years ago

Probably not relevant anymore. If turns out to be relevant, reopen.