Closed hohonuuli closed 1 year ago
So this bash script works as expected.
#!/usr/bin/env bash
echo -n '{"url": "http://varsdemo.mbari.org/media/M3/proxy/Ventana/2017/03/4003/V4003_20170301T210458.233Z_t4s4_1280_tc03560915_h264.mp4", "command": "open", "uuid": "5dc0e157-5802-4844-8a7f-71d449a9275e"}' > /dev/udp/localhost/8800
sleep 3
echo -n '{"elapsedTimeMillis": 60000, "command": "seek elapsed time", "uuid": "5dc0e157-5802-4844-8a7f-71d449a9275e"}' > /dev/udp/localhost/8800
echo -n '{"localizations": [{"uuid": "e574ba65-44c2-4758-b558-35bbf9a531ba", "concept": "initial concept", "elapsedTimeMillis": 60000, "durationMillis": 0, "x": 100, "y": 200, "width": 148, "height": 144, "color": "#00ffff" } ], "command": "add localizations", "uuid": "5dc0e157-5802-4844-8a7f-71d449a9275e"}' > /dev/udp/localhost/8800
echo -n '{"localizations": ["e574ba65-44c2-4758-b558-35bbf9a531ba"], "command": "select localizations", "uuid": "5dc0e157-5802-4844-8a7f-71d449a9275e"}' > /dev/udp/localhost/8800
sleep 1
echo -n '{"localizations": [{"uuid": "e574ba65-44c2-4758-b558-35bbf9a531ba", "concept": "20221220T220139Z", "elapsedTimeMillis": 60000, "durationMillis": 0, "x": 100, "y": 200, "width": 148, "height": 144, "color": "#00ffff" } ], "command": "update localizations", "uuid": "5dc0e157-5802-4844-8a7f-71d449a9275e"}' > /dev/udp/localhost/8800
I've checked in 3 tests into vcr4j. And here's what they do:
This does exactly the same thing as the issue28.sh
script above. It works fine and exactly as the script does. Sample logs
2022-12-20 15:26:00 [org.mbari.vcr4j.examples.remote.Issue28b.main()] DEBUG org.mbari.vcr4j.remote.control.RemoteControl$Builder - Building. Listening on port 5555. Sending commands to localhost:8800
2022-12-20 15:26:01 [org.mbari.vcr4j.examples.remote.Issue28b.main()] DEBUG org.mbari.vcr4j.remote.player.PlayerIO - anicca.lan:5555 - Started server's receiver thread: Thread-1
2022-12-20 15:26:01 [org.mbari.vcr4j.examples.remote.Issue28b.main()] DEBUG org.mbari.vcr4j.remote.control.RVideoIO - 5dc0e157-5802-4844-8a7f-71d449a9275e@localhost:8800 - Sending command >>> {
"port": 5555,
"host": "anicca.lan",
"command": "connect"
}
2022-12-20 15:26:01 [org.mbari.vcr4j.examples.remote.Issue28b.main()] DEBUG org.mbari.vcr4j.remote.control.RVideoIO - 5dc0e157-5802-4844-8a7f-71d449a9275e@localhost:8800 - Received response <<< {"response":"connect","status":"ok"}
2022-12-20 15:26:01 [org.mbari.vcr4j.examples.remote.Issue28b.main()] DEBUG org.mbari.vcr4j.remote.control.RVideoIO - 5dc0e157-5802-4844-8a7f-71d449a9275e@localhost:8800 - Sending command >>> {
"url": "http://varsdemo.mbari.org/media/M3/proxy/Ventana/2017/03/4003/V4003_20170301T210458.233Z_t4s4_1280_tc03560915_h264.mp4",
"command": "open",
"uuid": "5dc0e157-5802-4844-8a7f-71d449a9275e"
}
2022-12-20 15:26:01 [org.mbari.vcr4j.examples.remote.Issue28b.main()] DEBUG org.mbari.vcr4j.remote.control.RVideoIO - 5dc0e157-5802-4844-8a7f-71d449a9275e@localhost:8800 - Received response <<< {"response":"open","status":"ok"}
2022-12-20 15:26:01 [Thread-1] DEBUG org.mbari.vcr4j.remote.player.PlayerIO - anicca.lan:5555 - Received command <<< {"command":"open done","status":"ok","uuid":"5dc0e157-5802-4844-8a7f-71d449a9275e"}
2022-12-20 15:26:01 [Thread-1] DEBUG org.mbari.vcr4j.remote.player.PlayerIO - anicca.lan:5555 - Responding >>> {
"response": "open done",
"status": "ok"
}
2022-12-20 15:26:04 [org.mbari.vcr4j.examples.remote.Issue28b.main()] DEBUG org.mbari.vcr4j.remote.control.RVideoIO - 5dc0e157-5802-4844-8a7f-71d449a9275e@localhost:8800 - Sending command >>> {
"elapsedTimeMillis": 60000,
"command": "seek elapsed time",
"uuid": "5dc0e157-5802-4844-8a7f-71d449a9275e"
}
2022-12-20 15:26:04 [org.mbari.vcr4j.examples.remote.Issue28b.main()] DEBUG org.mbari.vcr4j.remote.control.RVideoIO - 5dc0e157-5802-4844-8a7f-71d449a9275e@localhost:8800 - Received response <<< {"response":"seek elapsed time","status":"ok"}
2022-12-20 15:26:04 [org.mbari.vcr4j.examples.remote.Issue28b.main()] DEBUG org.mbari.vcr4j.remote.control.RVideoIO - 5dc0e157-5802-4844-8a7f-71d449a9275e@localhost:8800 - Sending command >>> {
"localizations": [
{
"uuid": "e574ba65-44c2-4758-b558-35bbf9a531ba",
"concept": "initial concept",
"elapsedTimeMillis": 60000,
"durationMillis": 0,
"x": 100,
"y": 200,
"width": 148,
"height": 144,
"color": "#00FFFF"
}
],
"command": "add localizations",
"uuid": "5dc0e157-5802-4844-8a7f-71d449a9275e"
}
2022-12-20 15:26:04 [org.mbari.vcr4j.examples.remote.Issue28b.main()] DEBUG org.mbari.vcr4j.remote.control.RVideoIO - 5dc0e157-5802-4844-8a7f-71d449a9275e@localhost:8800 - Received response <<< {"response":"add localizations","status":"ok"}
2022-12-20 15:26:04 [org.mbari.vcr4j.examples.remote.Issue28b.main()] DEBUG org.mbari.vcr4j.remote.control.RVideoIO - 5dc0e157-5802-4844-8a7f-71d449a9275e@localhost:8800 - Sending command >>> {
"localizations": [
"e574ba65-44c2-4758-b558-35bbf9a531ba"
],
"command": "select localizations",
"uuid": "5dc0e157-5802-4844-8a7f-71d449a9275e"
}
2022-12-20 15:26:04 [org.mbari.vcr4j.examples.remote.Issue28b.main()] DEBUG org.mbari.vcr4j.remote.control.RVideoIO - 5dc0e157-5802-4844-8a7f-71d449a9275e@localhost:8800 - Received response <<< {"response":"select localizations","status":"ok"}
2022-12-20 15:26:05 [org.mbari.vcr4j.examples.remote.Issue28b.main()] DEBUG org.mbari.vcr4j.remote.control.RVideoIO - 5dc0e157-5802-4844-8a7f-71d449a9275e@localhost:8800 - Sending command >>> {
"localizations": [
{
"uuid": "e574ba65-44c2-4758-b558-35bbf9a531ba",
"concept": "20221220T220139Z",
"elapsedTimeMillis": 60000,
"durationMillis": 0,
"x": 100,
"y": 200,
"width": 148,
"height": 144,
"color": "#00FFFF"
}
],
"command": "update localizations",
"uuid": "5dc0e157-5802-4844-8a7f-71d449a9275e"
}
2022-12-20 15:26:05 [org.mbari.vcr4j.examples.remote.Issue28b.main()] DEBUG org.mbari.vcr4j.remote.control.RVideoIO - 5dc0e157-5802-4844-8a7f-71d449a9275e@localhost:8800 - Received response <<< {"response":"update localizations","status":"ok"}
2022-12-20 15:26:05 [org.mbari.vcr4j.examples.remote.Issue28b.main()] DEBUG org.mbari.vcr4j.remote.control.RVideoIO - 5dc0e157-5802-4844-8a7f-71d449a9275e@localhost:8800 - Sending command >>> {
"localizations": [
"e574ba65-44c2-4758-b558-35bbf9a531ba"
],
"command": "select localizations",
"uuid": "5dc0e157-5802-4844-8a7f-71d449a9275e"
}
2022-12-20 15:26:05 [org.mbari.vcr4j.examples.remote.Issue28b.main()] DEBUG org.mbari.vcr4j.remote.control.RVideoIO - 5dc0e157-5802-4844-8a7f-71d449a9275e@localhost:8800 - Received response <<< {"response":"select localizations","status":"ok"}
This listens for add localizations
commands from Sharktopoda. When it receives one, it waits for one second, then sends and update localizations
command that changes the concepts to a timestamp string.
Although the comms logs look fine. The label is not getting changed in Sharktopoda.
2022-12-20 15:27:35 [org.mbari.vcr4j.examples.remote.Issue28a.main()] DEBUG org.mbari.vcr4j.remote.control.RemoteControl$Builder - Building. Listening on port 5555. Sending commands to localhost:8800
2022-12-20 15:27:35 [org.mbari.vcr4j.examples.remote.Issue28a.main()] DEBUG org.mbari.vcr4j.remote.player.PlayerIO - anicca.lan:5555 - Started server's receiver thread: Thread-1
2022-12-20 15:27:35 [org.mbari.vcr4j.examples.remote.Issue28a.main()] DEBUG org.mbari.vcr4j.remote.control.RVideoIO - 711598e8-b260-451b-96bd-dd547ac08e45@localhost:8800 - Sending command >>> {
"port": 5555,
"host": "anicca.lan",
"command": "connect"
}
2022-12-20 15:27:35 [org.mbari.vcr4j.examples.remote.Issue28a.main()] DEBUG org.mbari.vcr4j.remote.control.RVideoIO - 711598e8-b260-451b-96bd-dd547ac08e45@localhost:8800 - Received response <<< {"response":"connect","status":"ok"}
2022-12-20 15:27:35 [org.mbari.vcr4j.examples.remote.Issue28a.main()] DEBUG org.mbari.vcr4j.remote.control.RVideoIO - 711598e8-b260-451b-96bd-dd547ac08e45@localhost:8800 - Sending command >>> {
"url": "http://varsdemo.mbari.org/media/M3/mezzanine/Ventana/2017/03/4003/V4003_20170301T185553.933Z_t2s4_hd_tc01495915_h264.mp4",
"command": "open",
"uuid": "711598e8-b260-451b-96bd-dd547ac08e45"
}
2022-12-20 15:27:35 [org.mbari.vcr4j.examples.remote.Issue28a.main()] DEBUG org.mbari.vcr4j.remote.control.RVideoIO - 711598e8-b260-451b-96bd-dd547ac08e45@localhost:8800 - Received response <<< {"response":"open","status":"ok"}
2022-12-20 15:27:35 [Thread-1] DEBUG org.mbari.vcr4j.remote.player.PlayerIO - anicca.lan:5555 - Received command <<< {"command":"open done","status":"ok","uuid":"711598e8-b260-451b-96bd-dd547ac08e45"}
2022-12-20 15:27:35 [Thread-1] DEBUG org.mbari.vcr4j.remote.player.PlayerIO - anicca.lan:5555 - Responding >>> {
"response": "open done",
"status": "ok"
}
2022-12-20 15:27:43 [Thread-1] DEBUG org.mbari.vcr4j.remote.player.PlayerIO - anicca.lan:5555 - Received command <<< {"command":"add localizations","localizations":[{"color":"#00ffff","concept":"object","durationMillis":0,"elapsedTimeMillis":334455,"height":225,"uuid":"3652ED51-DB5B-44EC-8AC6-038007EE3028","width":266,"x":1525,"y":535}],"uuid":"711598e8-b260-451b-96bd-dd547ac08e45"}
2022-12-20 15:27:43 [Thread-1] DEBUG org.mbari.vcr4j.remote.player.PlayerIO - anicca.lan:5555 - Responding >>> {
"response": "add localizations",
"status": "ok"
}
2022-12-20 15:27:43 [Thread-1] DEBUG org.mbari.vcr4j.remote.player.PlayerIO - anicca.lan:5555 - Received command <<< {"command":"select localizations","localizations":["3652ED51-DB5B-44EC-8AC6-038007EE3028"],"uuid":"711598e8-b260-451b-96bd-dd547ac08e45"}
2022-12-20 15:27:43 [Thread-1] DEBUG org.mbari.vcr4j.remote.player.PlayerIO - anicca.lan:5555 - Responding >>> {
"response": "select localizations",
"status": "ok"
}
2022-12-20 15:27:44 [RxCachedThreadScheduler-1] DEBUG org.mbari.vcr4j.remote.control.RVideoIO - 711598e8-b260-451b-96bd-dd547ac08e45@localhost:8800 - Sending command >>> {
"localizations": [
{
"uuid": "3652ed51-db5b-44ec-8ac6-038007ee3028",
"concept": "20221220T232744Z",
"elapsedTimeMillis": 334455,
"durationMillis": 0,
"x": 1525,
"y": 535,
"width": 266,
"height": 225,
"color": "#00ffff"
}
],
"command": "update localizations",
"uuid": "711598e8-b260-451b-96bd-dd547ac08e45"
}
2022-12-20 15:27:44 [RxCachedThreadScheduler-1] DEBUG org.mbari.vcr4j.remote.control.RVideoIO - 711598e8-b260-451b-96bd-dd547ac08e45@localhost:8800 - Received response <<< {"response":"update localizations","status":"ok"}
Note that I also manually tried to send a response via netcat, to make sure my library isn't the source of the bug. The name still did not visibly change in Sharktopoda
echo -n '{
"localizations": [
{
"uuid": "3652ed51-db5b-44ec-8ac6-038007ee3028",
"concept": "20221220T232744Z",
"elapsedTimeMillis": 334455,
"durationMillis": 0,
"x": 1525,
"y": 535,
"width": 266,
"height": 225,
"color": "#00ffff"
}
],
"command": "update localizations",
"uuid": "711598e8-b260-451b-96bd-dd547ac08e45"
}' | nc -cu localhost 8800
Note that this was obscured by the bug in VARS (#27) that added a duplicate bounding box back to Sharktopda. So in my original testing all updates were done on localizations created outside of Sharktopoda.
I'll look at this more tomorrow, but I just did the following:
add localizations
command sent to the control app and:
update localizations
update command
to SharktopodaBehavior was as expected. I redid the same, also changing another field as well (the color) and again, all was as expected.
Am I misunderstanding the issue, or is this different than what you're seeing?
That is different than what I am seeing. Just to confirm ... are you using the main
branch?
Can you add the recipe
you did so I can repeat your test as a sanity check?
EDIT: Never mind. I followed your steps above and it worked. But I have test apps where it's not working. Digging into this more ...
Closing this issue as the actual cause is in issue #31
This is really weird. I've been running tests for about an hour trying to see fi I'm imagining something. Here's what I'm seeing:
This works:
In this case the label updates in Sharktopoda correctly.
This isn't working
In this case, it responds with an
status: ok
message, but the label doesn't change in Sharktopoda.