remote cameras with >1 computer (token issue)

27 views
Skip to first unread message

Floris van Breugel

unread,
Jan 10, 2024, 7:36:58 PM1/10/24
to multi-camera software from the Straw Lab
Hi Andrew,

We are trying to get a remote strand camera running on a separate computer from the computer where braid is running, and have hit a small snag. 

The documentation here https://strawlab.github.io/strand-braid/braid_remote_cameras.html gives the syntax for remote cameras attached to the local host using addresses like "http://127.0.0.1:3333".

We first tried replacing "http://127.0.0.1:3333" in the remote computer with the IP address of the braid computer. That yielded a tcp connect error.

Then we tried replacing  "http://127.0.0.1:3333" in the braid toml with the ip address of the braid computer, and now get a JWT_SECRET environment error:

"Error: The --jwt-secret argument must be passed or the JWT_SECRET environment variable must be set"


But I need a little help/guide on how to actually implement the JWT_SECRET token stuff. Do you have any documentation that you can share?

Thanks!!

- Floris

Andrew Straw

unread,
Jan 11, 2024, 2:11:42 AM1/11/24
to Floris van Breugel, multi-camera software from the Straw Lab
Hi Floris,

You should be able to run Braid on a public network interface. 127.0.0.1 is a loopback network interface and another computer will not be able to connect to it (unless you do SSH tunneling or similar). To run Braid on all interfaces on your computer, set http_api_server_addr to “0.0.0.0:12345” (instead of “127.0.0.1:12345”). You could also specify the IP address just of the public interface. In addition to that, you will need to set the JWT secret, probably with an environment variable by doing e.g. 'export JWT_SECRET=“my super secret”’ on the command-line before launching braid.

Coincidentally, I have been recently working on the network communication stuff between Braid and (multiple) Strand Camera instances. Largely in an effort to fix https://github.com/strawlab/strand-braid/issues/11 . Because the rust networking ecosystem has matured substantially in the past couple of years, I rebased things on higher-level, widely used libraries and moved away from older and less maintained low-level libraries that I used originally. This seems to be mostly done now and I need to finish this up and run at least some initial tests.) If the above doesn't resolve things for you, it makes sense to finish this work up in the next few days and then go through with you getting it all working. This will help get the new version documented and tested.

-Andrew

--
You received this message because you are subscribed to the Google Groups "multi-camera software from the Straw Lab" group.
To unsubscribe from this group and stop receiving emails from it, send an email to multicams+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/multicams/19489d9b-5d8a-4bcb-861f-52747f0e28f1n%40googlegroups.com.

Floris van Breugel

unread,
Feb 4, 2024, 3:05:05 PM2/4/24
to multi-camera software from the Straw Lab
Since our long discussion didn't end up in the google group, I thought a brief summary here would be good for posterity. This issue was fixed by (a lot) of work on Andrews part and now works in version alpha 0.12.0-alpha.4:


To use this feature, here are a few notes. In the braid toml, cameras should be remote -- include this under each camera definition in the [[cameras]] sections:
name = "Basler-40196690"
start_backend = "remote"

In the [mainbrain] section use:
http_api_server_addr = "PUBLIC.IP:3333"
lowlatency_camdata_udp_addr = "PUBLIC.IP:3333"
model_server_addr = "0.0.0.0:8397"

And when calling strand, give it the braid url, e.g.:
strand-cam-pylon --camera-name Basler-40196690 --braid-url http://PUBLIC.IP:3333

If it's the first time, you may need to use a url with a token -- check the url given by braid run and add that to the url, e.g.
strand-cam-pylon --camera-name Basler-40196690 --braid-url http://PUBLIC.IP:3333/?token=446ada43-3728-4426-a1d6-e08c72ce8e68

After that it should work without supplying the token.


Thanks Andrew!!!

- Floris

Andrew Straw

unread,
Feb 5, 2024, 12:22:27 AM2/5/24
to Floris van Breugel, multi-camera software from the Straw Lab
Hi Floris,

Thanks for the follow-up.

Perhaps a slightly better link for the alpha release is this one: https://github.com/strawlab/strand-braid/releases/tag/0.12.0-alpha.4

Also, thanks for the reminder to write a message here announcing the alpha release. I will do that soon.

Best,
Andrew

Reply all
Reply to author
Forward
0 new messages