Closed uhppoted closed 4 years ago
Hi Rob,
Ref. https://github.com/twystd/uhppote-go/issues/4.
Can you please run the command:
./uhppote-cli --debug get-events 423140069
and let me have the output? I haven't been able to reproduce the problem on my system so it seems like your system is returning an unexpected response.
(BTW, uhppote-cli
expects the global options like --debug and --config before the command)
Reproduced:
./uhppote-cli --debug get-events 423195744
... request
... 00000000 17 b0 00 00 60 74 39 19 00 00 00 00 00 00 00 00 |....`t9.........|
... 00000010 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................|
... 00000020 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................|
... 00000030 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................|
...
... sent 64 bytes to 192.168.1.255:60000
... received 64 bytes from 192.168.1.104:60000
... response
... 00000000 17 b0 00 00 60 74 39 19 00 00 00 00 00 00 00 00 |....`t9.........|
... 00000010 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................|
... 00000020 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................|
... 00000030 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................|
...
panic: Cannot unmarshal field with type 'types.DateTime'
goroutine 1 [running]:
uhppote/encoding/UTO311-L0x.unmarshal(0x24c0000, 0x40, 0x800, 0x1d2e50, 0x2462360, 0x199, 0x1c1, 0x380)
.../uhppote/uhppote-go/src/uhppote/encoding/UTO311-L0x/UT0311-L0x.go:296 +0x105c
uhppote/encoding/UTO311-L0x.Unmarshal(0x24c0000, 0x40, 0x800, 0x1a58e8, 0x2462360, 0x3, 0x3)
.../uhppote/uhppote-go/src/uhppote/encoding/UTO311-L0x/UT0311-L0x.go:165 +0x140
uhppote.(*UHPPOTE).receive(0x240a8a0, 0x240e3c8, 0x1a58e8, 0x2462360, 0x2412444, 0x0)
.../uhppote/uhppote-go/src/uhppote/uhppote.go:246 +0x260
uhppote.(*UHPPOTE).Execute(0x240a8a0, 0x19397460, 0x1c5350, 0x2412444, 0x1a58e8, 0x2462360, 0x0, 0x0)
.../uhppote/uhppote-go/src/uhppote/uhppote.go:108 +0x154
uhppote.(*UHPPOTE).GetEvent(0x240a8a0, 0x19397460, 0x0, 0x1e3b9f, 0x19, 0x19397460)
.../uhppote/uhppote-go/src/uhppote/get_event.go:16 +0x74
uhppote-cli/commands.(*GetEventsCommand).Execute(0x344180, 0x240a8a0, 0x240ac80, 0x0, 0x0)
.../uhppote/uhppote-go/src/uhppote-cli/commands/get_events.go:17 +0x6c
main.main()
.../uhppote/uhppote-go/src/cmd/uhppote-cli/main.go:111 +0x5bc
A controller with no stored events returns a response with an event index
of 0 and no other valid fields.
uhppote-core
uhppoted-api
uhppote-simulator
uhppote-cli
uhppoted-rest
uhppoted-mqtt
Provisional fix pushed to master branch across all modules.
Tested with uhppote-cli
:
./uhppote-cli --debug get-events 423195744
... request
... 00000000 17 b0 00 00 60 74 39 19 00 00 00 00 00 00 00 00 |....`t9.........|
... 00000010 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................|
... 00000020 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................|
... 00000030 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................|
...
... sent 64 bytes to 192.168.1.255:60000
... received 64 bytes from 192.168.1.104:60000
... response
... 00000000 17 b0 00 00 60 74 39 19 00 00 00 00 00 00 00 00 |....`t9.........|
... 00000010 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................|
... 00000020 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................|
... 00000030 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................|
...
... request
... 00000000 17 b0 00 00 60 74 39 19 ff ff ff ff 00 00 00 00 |....`t9.........|
... 00000010 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................|
... 00000020 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................|
... 00000030 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................|
...
... sent 64 bytes to 192.168.1.255:60000
... received 64 bytes from 192.168.1.104:60000
... response
... 00000000 17 b0 00 00 60 74 39 19 00 00 00 00 00 00 00 00 |....`t9.........|
... 00000010 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................|
... 00000020 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................|
... 00000030 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................|
...
423195744 NO EVENTS
Tested with uhppoted-rest
:
curl -X GET "http://127.0.0.1:8080/uhppote/device/303986753/events" -H "accept: application/json"
{
"events": {}
}
Tested with uhppoted-mqtt
:
{"message": {"request": {
"client-id": "QWERTY54",
"device-id": 303986753,
"reply-to": "twystd/uhppoted/reply/97531",
"request-id": "AH173635G3"
}}}
{
"hmac": "ea92d14866802b8804ffa5b8710a6a27d0781fc53321790a7409810f0848419d",
"message": {
"reply": {
"client-id": "QWERTY54",
"device-id": 303986753,
"events": {},
"method": "get-events",
"nonce": 68,
"request-id": "AH173635G3",
"server-id": "twystd-uhppoted"
},
"signature": "lNEo/xc28coJlZk9WfxOYXzrwTnekQwBg4mANcNFx+RaaogTEjqHAIWT8J0LqVYUT1LxgnOzv4KbUMdqo2PXnk2QZbC+YuzQvkE99xWHvy1kqGwJhl4XoaYD88pT34GfPslCgykWiwauytzxszY5lkYbgegwCipXOhuqW+Y1sf3NXnJV3jrE4uFw9u4cTJ7aV27+QSrXvRPJvY6S/Vqln9dIPwM5/gdrPggSbfRZAxbvfLrm0i6kfmVJ3qIp651z+eIIGpA4oFMZ64RiUQoPQy/dMZzoUXA+Io8NBPFy+4u7aaxrbwe5f6rRrJJPG6jR01F0UaIu73+A7LDNDXOavw=="
}
}
Provisionally fixed in master branches, pending release v0.6.2.
Fixed in release v0.6.2
Moved from https://github.com/twystd/uhppote-go/issues/4