Open remote - how to obtain IP address?

Comments & issues
Plopper
Fresh meat
Posts: 2
Joined: Wed Feb 24, 2010 12:30 pm
Contact:

Open remote - how to obtain IP address?

Postby Plopper » Thu Feb 25, 2010 3:58 am

I recently obtained a SBC with some other Phidget I/O boards and sensors to connect to it. Installing the drivers in Windows 7 and Mac works fine (great even!) and on both platforms I can see the SBC and its connected Phidgets fine through the Bonjour tab of the provided apps.

When I try to achieve the same from custom code or one of the provided examples (I tried C#, VB.NET and VBA code - it al works the same) I have trouble opening PHidgets remotely: when I use the open command with the correct IP Address it all works fine and all objects get all their properties populated (e.g.: I can see that the SBC has 8 analog inputs, etc.). However, when I try to use the open command without an IP Address, using the Server ID or hostname and optional port number, it does not populate all properties on PhidgetInterfaceKit objects.

The same is true for the Manager object: somehow it looks like opening remotely (without IP Address, but with the Server ID) works half-way: it shows my that it found a (correct) number of attached Phidgets (for which I can enumerate devicename, etc.), but it is not populating all properties (I need).

So here are my questions:

- as I can get it all working fine when I use the IP Address, but I would like to have dynamic IPs (DHCP): is there a way I can find out which IP Address my SBC is using? (the manager app that is provided is doing just that: it uses Bonjour, but also is able to display the IP Address of the SBC on the network - how does the app get that address?)
- why is the OpenRemote (=VBA) or open() (VB.NET) command not working OK, populating all properties of objects, when used with only the Server ID (and optional port number), or is this expected behavior?

And finally: is the code with which the (correctly working) control panel app is built available (in C#, VB.NET, or VBA) as example - that would be great too (because that would be the ultimate example?)

Robert

Re: Open remote - how to obtain IP address?

Postby Robert » Thu Feb 25, 2010 9:56 am

How are you trying to open via host name? Are you calling it phidgetsbc, or phidgetsbc.local (Assuming phidgetsbc is the host name).

User avatar
Patrick
Lead Developer
Posts: 3099
Joined: Mon Jun 20, 2005 8:46 am
Location: Canada
Contact:

Re: Open remote - how to obtain IP address?

Postby Patrick » Thu Feb 25, 2010 10:36 am

When you say that it halfway works, what do you mean - what properties are not being filled in? Are you waiting for the attach event or calling waitForAttachment before trying to access anything?

The examples that the control panel uses are available as the C# full examples. The SBC tab gets the IP addresses of the Phidgets by doing a lookup on the bonjour services.

-Patrick

Plopper
Fresh meat
Posts: 2
Joined: Wed Feb 24, 2010 12:30 pm
Contact:

Re: Open remote - how to obtain IP address?

Postby Plopper » Fri Feb 26, 2010 3:11 am

Robert wrote:How are you trying to open via host name? Are you calling it phidgetsbc, or phidgetsbc.local (Assuming phidgetsbc is the host name).


Im am using "phidgetsbc".

Robert

Re: Open remote - how to obtain IP address?

Postby Robert » Fri Feb 26, 2010 9:44 am

Plopper wrote:
Robert wrote:How are you trying to open via host name? Are you calling it phidgetsbc, or phidgetsbc.local (Assuming phidgetsbc is the host name).


Im am using "phidgetsbc".


Try phidgetsbc.local

antoniosarc
Fresh meat
Posts: 1
Joined: Sun Apr 15, 2012 12:10 pm
Contact:

Re: Open remote - how to obtain IP address?

Postby antoniosarc » Sun Apr 15, 2012 12:12 pm

By using C# you can obtain ip address , plz chek this

http://csharp.net-informations.com/comm ... ddress.htm

saar.


Return to “General”

Who is online

Users browsing this forum: No registered users and 1 guest