JavaLaurence Geschrieben February 23, 2013 at 18:41 Geschrieben February 23, 2013 at 18:41 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. Zitieren
raphael_vogel Geschrieben February 23, 2013 at 20:03 Geschrieben February 23, 2013 at 20:03 Hi Why don't you just use the hostname. In case of a WIFI module ist will be something like Gainspan... Zitieren
remotecontrol Geschrieben February 24, 2013 at 06:49 Geschrieben February 24, 2013 at 06:49 The latest firmware allows to set a hostname to the WIFI extension, so it is even easier to distinguish the stacks if you have more than one in a network. You don't need to know the "gainspana.." number any more if you set a hostname via brickv. Zitieren
JavaLaurence Geschrieben February 24, 2013 at 19:21 Autor Geschrieben February 24, 2013 at 19:21 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. Zitieren
borg Geschrieben February 24, 2013 at 20:46 Geschrieben February 24, 2013 at 20:46 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. Zitieren
JavaLaurence Geschrieben February 27, 2013 at 21:53 Autor Geschrieben February 27, 2013 at 21:53 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. Zitieren
borg Geschrieben February 27, 2013 at 22:11 Geschrieben February 27, 2013 at 22:11 The hostname has to be set once and will work from then on (you can set it with the newest Brick Viewer version). You can restart the AP, thats no problem. It works the same as with the hostname of your Mac . Zitieren
JavaLaurence Geschrieben February 28, 2013 at 20:12 Autor Geschrieben February 28, 2013 at 20:12 I've got the latest Brickv but cannot see any text field where I can define a host name. Where is this? Thanks. Zitieren
photron Geschrieben March 1, 2013 at 10:19 Geschrieben March 1, 2013 at 10:19 From your other brickv screenshot I can see that you have Master Brick firmware 2.0.4. This feature is new in firmware 2.0.5 and brickv hides this option for older firmwares. Zitieren
JavaLaurence Geschrieben March 1, 2013 at 20:40 Autor Geschrieben March 1, 2013 at 20:40 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.. Zitieren
JavaLaurence Geschrieben March 4, 2013 at 18:53 Autor Geschrieben March 4, 2013 at 18:53 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 ? Zitieren
remotecontrol Geschrieben March 4, 2013 at 19:11 Geschrieben March 4, 2013 at 19:11 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. Zitieren
JavaLaurence Geschrieben March 4, 2013 at 19:41 Autor Geschrieben March 4, 2013 at 19:41 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 Zitieren
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.