Getting Python Examples to work With UDP Multicast Between 2 Computers

251 views
Skip to first unread message

Christian Pasca

unread,
Feb 1, 2020, 1:24:12 PM2/1/20
to Lightweight Communications and Marshalling
Hi, I'm trying to figure out how to use LCM's UDP Multicast functionality. My goal is to send LCM messages wirelessly between two computers using Python and LCM, and I figured that the best place to start would be by modifying the send-message.py and listener.py examples to develop a sense of how UDP Multicast works in LCM. From what I've read, it seems that the lcm_create() function must be used to connect to a UDP Multicast port, but I'm having trouble figuring out how to use it properly. I'm not quite sure I understand the lcm_t* struct and its relation to lcm_create(), and I'm still learning Python, so maybe it's just a small syntax error. Any recommendations? I've tried just adding
lcm_create("udpm://239.255.76.67:7667?ttl=1")
to both the send-message.py and listener.py files, but I don't think that's done anything.

Also, I may've missed it, but are there any current examples that demonstrate the UDP Multicast functionality?

Thanks in advance.

Chad Schaffer

unread,
Feb 4, 2020, 8:53:02 AM2/4/20
to Lightweight Communications and Marshalling
Hi Christian,

you need to use an extra tool on both computers called bot-lcm-tunnel, its a non-obvious hang-up and got me when I first started using LCM as well. 

A google search of the tool name should give you enough information to proceed.

Christian

unread,
Feb 14, 2020, 8:38:33 AM2/14/20
to Lightweight Communications and Marshalling
Hi Chad,

I've installed the libbot2 library with the bot-lcm-tunnel tool, but I'm a bit confused on implementing with LCM. For instance, to use this tool with the Python send-message.py and listener.py examples, would I have to use a function analogous to lcm_create(), or is it just a matter of running the tool at the same time of the program?

Thanks,
Christian

Chad Schaffer

unread,
Feb 14, 2020, 8:45:05 AM2/14/20
to lcm-...@googlegroups.com
Christian,

bot-lcm-tunnel is its own executable. 

You'll need to run it on both systems in the network. One is the Primary, any others will be Replicas,

 for the Primary: just run "bot-lcm-tunnel" in command line.

for the Replicas: run "bot-lcm-tunnel <ip of the Primary>"

there are more options with bot-lcm-tunnel, you can setup acceptance masks for specific channels for instance, but this is all you need to get started. 

--
You received this message because you are subscribed to the Google Groups "Lightweight Communications and Marshalling" group.
To unsubscribe from this group and stop receiving emails from it, send an email to lcm-users+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/lcm-users/33ef430a-47bf-4cb3-b222-e36c7c75943b%40googlegroups.com.

Matthew Parrilla

unread,
Feb 14, 2020, 5:11:27 PM2/14/20
to lcm-...@googlegroups.com
Is bot-lcm-tunnel multicast or unicast?

I've always just followed the UDP Multicast Setup instructions [1] and been able to publish LCM on one machine and see it by running LCM spy on another machine. Certain switches seem to block UDP multicast, but the linked setup works for most dumb switches for me.


Reply all
Reply to author
Forward
0 new messages