A quick one tonight because I've just spent a good half an hour scratching my head over it!
If you're running an FHEM server, and you'd like to be able to access it via Telnet from a remote box, here are four quick steps you can take to troubleshoot any issues you're having.
- Make sure you can connect to the server from the same box it's installed on, this will prove that it's running correctly.
- Telnet client settings - If you're using PuTTY to connect to your server, when you're configuring your connection make sure:
- In the "Terminal" category, check the box "Implicit CR in every LF"
- In the "Session" category, make sure you check the box to close the window "Only on clean exit", this way if there's an error you'll get a message box pop up to tell you, PuTTY won't just shut itself down.
- Server firewall settings - I'm using Windows Home Server, so for me the process was:
- Remote into the server via Remote Desktop connection
- Open Control Panel, then Windows Firewall
- If your firewall is Off, you shouldn't have any problems with FHEM (but expect all sorts of unpleasant suprises in the future!)
- If your firewall is On, make sure that the box "Don't allow allow exceptions" is not checked. If you do what I did, and accidentally check it, expect to be kicked out of your remote desktop session and have to plug a keyboard and monitor into your server to fix it.
- In the Exceptions tab, add an exception for the port number you've configured your server (the default I believe is 7072) and give it a sensible name, eg FHEM.
- FHEM Configuration - Make sure that your FHEM port number is configured as a global port:
- In your config file, the command to specify the port number must look like "attr global port xxxx global", without that second "global" keyword the port is only accessible from the localhost.
- Because the port is blocked in a Perl Socket module, not in the FHEM application, the FHEM log won't give you any record of failed attempts due to the above problem.
Those things sorted the problem out for me, of course there could be other things to check, for example:
- A firewall configured on the machine you want to connect from
- Router and port-forwarding settings may come into play if you're going across networks
Hope that helps someone out there,