On 22/08/17 14:52, Stuart Longland wrote:
> I think I am seeing that with the 0xff in the IPv6 address, which is why
> it is complaining about a multicast bit being set, and various framing
> errors. Question is though, okay we can safely ignore parity errors,
> but how do we handle overruns, breaks or frame errors?
Okay, fixed that problem… mostly… I still get the odd frame error I
notice, but I am able to actually send traffic through the NCP this time:
> wpantund[3773]: Starting wpantund 0.08.00d (Aug 1 2017 14:30:16) . . .
> wpantund[3773]: SOURCE_VERSION = 0.07.01-116-gf26ee8f
> wpantund[3773]: BUILD_VERSION = 0.07.01-116-gf26ee8f
> wpantund[3773]: Configuration file "/usr/local/etc/wpantund.conf" read.
> wpantund[3773]: Ready. Using DBUS bus ":1.0"
> wpantund[3773]: Running as root without dropping privileges!
> wpantund[3773]: SpinelNCPInstance-Protothreads.cpp:412: Requirement Failed (IS_EVENT_FROM_NCP(event) && GetInstance(this)->mInboundHeader == mLastHeader)
> wpantund[3773]: Resetting and trying again... (retry 1)
> wpantund[3773]: [-NCP-]: NCP was reset (STATUS_RESET_POWER_ON, 112)
> wpantund[3773]: [NCP->]: Frame CRC Mismatch: Calc:0xD82D != Frame:0xD97E, Garbage on line?
> wpantund[3773]: [NCP->]: Garbage is not ASCII ([0]=128)
> wpantund[3773]: SpinelNCPInstance-Protothreads.cpp:412: Requirement Failed (IS_EVENT_FROM_NCP(event) && GetInstance(this)->mInboundHeader == mLastHeader)
> wpantund[3773]: Resetting and trying again... (retry 2)
> wpantund[3773]: SpinelNCPInstance-Protothreads.cpp:402: Requirement Failed (event == EVENT_NCP_RESET)
> wpantund[3773]: Resetting and trying again... (retry 3)
> wpantund[3773]: [-NCP-]: NCP was reset (STATUS_RESET_POWER_ON, 112)
> wpantund[3773]: [NCP->]: Frame CRC Mismatch: Calc:0xEAC4 != Frame:0xF1C2, Garbage on line?
> wpantund[3773]: [NCP->]: Garbage is not ASCII ([0]=128)
> wpantund[3773]: SpinelNCPInstance-Protothreads.cpp:412: Requirement Failed (IS_EVENT_FROM_NCP(event) && GetInstance(this)->mInboundHeader == mLastHeader)
> wpantund[3773]: The NCP is misbehaving: Repeatedly unable to initialize NCP. Entering fault state.
> wpantund[3773]: State change: "uninitialized" -> "uninitialized:fault"
> wpantund[3773]: State change: "uninitialized:fault" -> "uninitialized"
> wpantund[3773]: SpinelNCPTask.cpp:70: Requirement Failed (Failure while trying to send command)
> wpantund[3773]: SpinelNCPTaskSendCommand.cpp:322: Requirement Failed ((mRetVal) == 0)
> wpantund[3773]: SendCommand task encountered an error: 7 (0x00000007)
> wpantund[3773]: [-NCP-]: NCP was reset (STATUS_RESET_POWER_ON, 112)
> wpantund[3773]: State change: "uninitialized" -> "offline"
> wpantund[3773]: NCP is running "OPENTHREAD/0.01.00; CC2538; Aug 22 2017 12:07:50"
> wpantund[3773]: Driver is running "0.08.00d (0.07.01-116-gf26ee8f; Aug 1 2017 14:30:16)"
> wpantund[3773]: HARDWARE ADDRESS IS INVALID, MULTICAST BIT IS SET!
> wpantund[3773]: Network is not joinable
> wpantund[3773]: Resetting interface(s). . .
> wpantund[3773]: Finished initializing NCP
> wpantund[3773]: [-NCP-]: NCP was reset (STATUS_RESET_POWER_ON, 112)
> wpantund[3773]: State change: "offline" -> "uninitialized"
> wpantund[3773]: State change: "uninitialized" -> "offline"
> wpantund[3773]: NCP is running "OPENTHREAD/0.01.00; CC2538; Aug 22 2017 12:07:50"
> wpantund[3773]: Driver is running "0.08.00d (0.07.01-116-gf26ee8f; Aug 1 2017 14:30:16)"
> wpantund[3773]: Network is not joinable
> wpantund[3773]: Resetting interface(s). . .
> wpantund[3773]: Finished initializing NCP
> wpantund[3773]: Scan -> Name:WideSky , PanId:0x0000, Ch:11, Joinable:NO , XPanId:0xDEAD00BEEF00CAFE, HwAddr:0x8ACB5F22091366FE, RSSI:4 , LQI:107, ProtoId:3 , Version: 0, ShortAddr:0xFFFF
> wpantund[3773]: State change: "offline" -> "associating"
> wpantund[3773]: State change: "associating" -> "associated"
> wpantund[3773]: Node type change: "unknown" -> "end-device"
> wpantund[3773]: [NCP->]: Frame CRC Mismatch: Calc:0xC11D != Frame:0x082A, Garbage on line?
> wpantund[3773]: [NCP->]: Garbage is not ASCII ([0]=128)
> wpantund[3773]: SpinelNCPTask.cpp:85: Requirement Failed (IS_EVENT_FROM_NCP(event) && GetInstance(this)->mInboundHeader == mLastHeader)
> wpantund[3773]: SpinelNCPTaskSendCommand.cpp:322: Requirement Failed ((mRetVal) == 0)
> wpantund[3773]: SendCommand task encountered an error: 7 (0x00000007)
> wpantund[3773]: NCP => Framing error 6: [80 03 72 68 00 60 02 6B 7E 00 40 3A 01 FE 80 00 00 00 00 00 00 1C 66 DD DA 3A 0C 73 D8 FF 02 00 00 00 00 00 00 00 00 00 00]
> wpantund[3773]: NCP => Framing error 6: [80 03 72 68 00 60 02 6B 7E 00 40 3A 01 FE 80 00 00 00 00 00 00 1C 66 DD DA 3A 0C 73 D8 FF 02 00 00 00 00 00 00 00 00 00 00]
> wpantund[3773]: NCP => Framing error 6: [80 03 72 68 00 60 02 6B 7E 00 40 3A 01 FE 80 00 00 00 00 00 00 1C 66 DD 3A 0C 73 D8 FF 02 00 00 00 00 00 00 00 00 00 00 00]
> wpantund[3773]: NCP => Framing error 6: [80 03 72 68 00 60 02 6B 7E 00 40 3A 01 FE 80 00 00 00 00 00 00 1C 66 DD DA 3A 0C 73 D8 FF 02 00 00 00 00 00 00 00 00 00 00]
> wpantund[3773]: NCP => Framing error 6: [80 03 72 68 00 60 02 6B 7E 00 40 3A 01 FE 80 00 00 00 00 00 00 1C 66 DD DA 3A 0C 73 D8 FF 02 00 00 00 00 00 00 00 00 00 00]
> wpantund[3773]: NCP => Framing error 6: [80 03 72 68 00 60 02 6B 7E 00 40 3A 01 FE 80 00 00 00 00 00 00 1C 66 DD DA 3A 0C 73 D8 FF 02 00 00 00 00 00 00 00 00 00 00]
> wpantund[3773]: NCP => Framing error 6: [80 03 72 68 00 60 02 6B 7E 00 40 3A 01 FE 80 00 00 00 00 00 00 1C 66 DD DA 0C 73 D8 FF 02 00 00 00 00 00 00 00 00 00 00 00]
> wpantund[3773]: NCP => Framing error 6: [80 03 72 68 00 60 02 6B 7E 00 40 3A 01 FE 80 00 00 00 00 00 00 1C DD DA 3A 0C 73 D8 FF 02 00 00 00 00 00 00 00 00 00 00 00]
> wpantund[3773]: NCP => Framing error 6: [80 03 72 68 00 60 02 6B 7E 00 40 3A 01 FE 80 00 00 00 00 00 00 1C 66 DD DA 3A 0C 73 D8 FF 02 00 00 00 00 00 00 00 00 00 00]
> wpantund[3773]: NCP => Framing error 6: [80 03 72 68 00 60 02 6B 7E 00 40 3A 01 FE 80 00 00 00 00 00 00 1C 66 DD DA 3A 0C 73 D8 FF 02 00 00 00 00 00 00 00 00 00 00]
> wpantund[3773]: NCP => Framing error 6: [80 03 72 68 00 60 02 6B 7E 00 40 3A 01 FE 80 00 00 00 00 00 00 1C 66 DA 3A 0C 73 D8 FF 02 00 00 00 00 00 00 00 00 00 00 00]
> wpantund[3773]: NCP => Framing error 6: [80 03 72 68 00 60 02 6B 7E 00 40 3A 01 FE 80 00 00 00 00 00 00 1C 66 DD DA 3A 0C 73 D8 FF 02 00 00 00 00 00 00 00 00 00 00]
> wpantund[3773]: NCP => Framing error 6: [80 03 72 68 00 60 02 6B 7E 00 40 3A 01 FE 80 00 00 00 00 00 00 1C 66 DD DA 3A 0C 73 D8 FF 02 00 00 00 00 00 00 00 00 00 00]
> wpantund[3773]: SpinelNCPTask.cpp:85: Requirement Failed (IS_EVENT_FROM_NCP(event) && GetInstance(this)->mInboundHeader == mLastHeader)
> wpantund[3773]: SpinelNCPTaskSendCommand.cpp:322: Requirement Failed ((mRetVal) == 0)
> wpantund[3773]: SendCommand task encountered an error: 7 (0x00000007)
> wpantund[3773]: SpinelNCPInstance-Protothreads.cpp:232: Requirement Failed (IS_EVENT_FROM_NCP(event) && GetInstance(this)->mInboundHeader == mLastHeader)
> wpantund[3773]: NCP is misbehaving or unresponsive
> wpantund[3773]: State change: "associated" -> "uninitialized"
> wpantund[3773]: Taking interface(s) down. . .
> wpantund[3773]: "fdde:ad00:beef:0:e855:820b:4347:d7fa" was removed from "wpan0"
> wpantund[3773]: "fe80::1c66:ddda:3a0c:73d8" was removed from "wpan0"
> wpantund[3773]: SpinelNCPInstance-Protothreads.cpp:412: Requirement Failed (IS_EVENT_FROM_NCP(event) && GetInstance(this)->mInboundHeader == mLastHeader)
> wpantund[3773]: Resetting and trying again... (retry 1)
> wpantund[3773]: SpinelNCPInstance-Protothreads.cpp:402: Requirement Failed (event == EVENT_NCP_RESET)
> wpantund[3773]: Resetting and trying again... (retry 2)
> wpantund[3773]: SpinelNCPInstance-Protothreads.cpp:402: Requirement Failed (event == EVENT_NCP_RESET)
> wpantund[3773]: Resetting and trying again... (retry 3)
> wpantund[3773]: SpinelNCPInstance-Protothreads.cpp:402: Requirement Failed (event == EVENT_NCP_RESET)
> wpantund[3773]: The NCP is misbehaving: Repeatedly unable to initialize NCP. Entering fault state.
> wpantund[3773]: State change: "uninitialized" -> "uninitialized:fault"
It seems though that the NCP works for a little while, then stops. So
more work it seems. That might be the buffering bug I initially suspected.
At the moment, it ignores bytes that have frame errors, breaks or
overrun status bits flagged. Not sure if that is the best approach, it
would be nice to signal to OpenThread that there's some garbage here and
let it handle the situation (probably by pre-emptively throwing out the
buffer content and waiting for the next frame).
Also, while I'm doing software flow control on my end, I'm still not
sure if `wpantund` implements it, which might be what's happening too,
the buffer gets overrun and that's when it hiccups. Thoughts?
Regards,