PDA

View Full Version : Embedded ruby and ethernet


snowdall
April 7th, 2008, 01:46 PM
Hello all,

I'm doing some work with a bunch of embedded ARM processor based boards running a slimmed down Debian linux. In my project, I need all these machines to share data ... so I thought this might be a GREAT place to try out DRb's Rinda tuplespace technology. Well, there seems to be a small problem: when Rinda::RingServer is launched, the boards cannot find the RingServer.

I think the problem has to do with the fact there are two ethernet ports. Each one of these boards has two ethernet ports: eth1 is assigned to the main network via DHCP (i.e. can talk to the other boards around it), while eth0 is statically assigned assigned to a different subnet in order to host a web-based camera. I believe my problem is that the ruby run time is latching on to eth0 .... and thus getting on its own internal subnet, rather than using eth1 and being able to see the other boards.

My question then is, is there a way to force the ruby runtime (particularly Rinda) to use a particular ethernet port when starting up?

Thanks,
Snowdall

snowdall
April 8th, 2008, 12:51 PM
Seems I've found my own solution. It lies in how the remote server communicates with the RingServer. In all the examples, the remote server starts with DRb.start_service ... effectively starting a server. Then for the Rinda::RingFinger, it contacts the RingServer via udp with the uri to call back to. I thought this was the step that was failing. Instead it was the callback that was failing. So the way to fix is in the start_service call by giving the uri of the particular ethernet interface you want. This gives the RingServer something to callback to. Viola!!

Snowdall