Jump to content

IPConnection suggestion: IP hunt group


JavaLaurence
 Share

Recommended Posts

Currently IPConnection lets you connect to one fixed IP address. It would be nice if you could give a range of IP addresses to IPConnection, so that it connects to the first address that accepts a connection and talks Protocol 2.0.

 

Why? Because on most peoples' routers, DHCP will just hand out IP addresses on a first-come, first-served basis. So every time a router resets for whatever reason, a stack can receive a different IP address compared to last time... which doesn't play well with the current static address scheme.

 

I know that some routers can be configured to bind fixed IP addresses to MAC addresses, but I'm in luck: mine does not have that feature.

 

So if IPConnection could hunt for the first IP address that has a stack behind it, that would be very helpful.

 

Link to comment
Share on other sites

How does that setWifiHostname() work exactly?

 

I'm no TCP/IP guru, but I know that non-numerical IP addresses need to be lookup via DNS, or via an etc/hosts file.

 

If my program should be able to always connect to my stack via a stack name instead of a numeric address, then I'd expect setWifiHostname() to have to interact with a DNS server, or edit a hosts file. Sounds unlikely..

 

The online docs are extremely sparse.

 

Link to comment
Share on other sites

Your ap/router has an DHCP server integrated that receives the hostname from the WIFI Extension when it gives out the IP address. You don't have to set up a DNS or do something with your etc/hosts.

 

Just use setWifiHostname and use this name instead of the ip when connecting to the stack.

Link to comment
Share on other sites

Forgive me for not understanding.. but for setWifiHostname() to work, I already need a connection to the AP. No?

 

Does that mean I need to first connect using numeric IP, and then call setWifiHostname(), and from that moment onwards I can in the future just connect via the assigned name? What if the AP suffers a reset?

 

I just don't understand.. maybe a few extra sentences in the docs would help. Plz.

Link to comment
Share on other sites

Personally, the way I would tackle this is not to hide UI elements depending on availability or not of target firmware, but to disable elements, plus add tooltips that give the user a friendly hint, like "Requires Master Brick firmware Vx.y, your Master runs Vz.q".

 

But point taken, I need to disassemble my stack in my cellar, upgrade firmware (on 2nd floor, next Mac), then reassemble. Oh well.. that's good for the legs :-)

 

Thx for the explanation, as usual..  :P

Link to comment
Share on other sites

Borg: OK, Master upgraded to 2.0.5, setWifiHostname() via Brickv. AP clearly honoring this (see screenshot), but if I try to substitute this non-numeric host address in my program, then I get a java.net.UnknownHostException.

 

Also, if I try to ping the name of my stack from the OS command line, then my Mac also does not recognize the name. Am I missing something ?

Screen_Shot_2013-03-04_at_Monday_4_March_2013.thumb.png.85300bec6d08ae55b7012256aa6f0acf.png

Link to comment
Share on other sites

Does your AccessPoint also has a DNS server included?

And do the network clients use your AP as DNS server?

If not, setting only the hostname in the WIFI extension will not help.

 

My FritzBox is also a DNS server. In this case the WIFI ext. registers at the FritzBox AP with the given hostname, the Fritzbox also adds the name + the IP to its DNS mapping.

 

All network client in my network use by FritzBox as DNS server, so I can connect to any other WIFI device using the hostname with was defined during WIFI connect - this was really easy, but a DNS server in the AP is a must have I think.

Link to comment
Share on other sites

I am just trying to follow a) the TinkerForge documentation, and b) any further advice given by the TF guys. So far nobody has mentioned the extra complexities you just did. But reading what you write, I think that there's extra DNS config work to be done.

 

I think it's a shame the TF docs are a bit on the sparse side, and clearly do not explain enough to get certain things to work "off the shelf". I'm used to Sun's javadocs, which are typically more generous on explanation and detail. But I love the TF concept, so.. the docs won't stop me tinkering  :D

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share

×
×
  • Create New...