Monday, February 23, 2015

Sloppy Programming Leads To Confusion

Recently I posted on Google+ about a deal on a Brother laser printer (the HL-L2380DW), and then wrote a blog post about it.  A Google+ user who bought the same printer ran into a problem accessing the web interface of the printer after he got it on the network.  Here's why:

When you set up the brother on your network for the first time, you'll probably let it get assigned an IP address automatically from your home router using dynamic host configuration protocol, or DHCP.  That means you won't necessarily be able to predict what IP address has been assigned.  You might be able to find it by looking at your router if it has a way of displaying what IP addresses it's given out, but most people will simply use the LCD touchscreen on the printer to browse to the information, and therein lies the problem.

Brother displays IP addresses with leading zeros padding the octets of the IP address.  For example, my printer at home has IP address 192.168.0.22.  But on the display, the printer shows it as 192.168.000.022.  If you weren't familiar with the normal notation of an IP address and tried to enter this into a web browser, you might get some odd results.

I have three browsers on my desktop system - Safari, Firefox, and Chrome.  Interestingly, Safari was able to bring up the printer's web interface with no apparent difficulty, while leaving the display on the URL bar showing 192.168.000.022.  Firefox also left the display alone, but was not able to bring up the page.  Chrome interpreted the last octet as being written in octal (base 8) due to the leading zero, and converted it to decimal 18 (presumably it also detected the third octet as octal as well, but since 000 in octal and 0 in decimal are the same thing, it doesn't really matter).  Chrome changed the URL display to read 192.168.0.18, and failed to contact the printer.

A user commenting on the Google+ post commented that this behavior (interpreting an octet in an IP address as octal due to a leading zero) is expected, if perhaps unhelpful.

It would be nice if Brother could correct the display on the LCD to prevent confusion like this from occurring.

1 comment:

Taking the Acer Spin 714 Chromebook for a spin (ouch)

 For nearly a decade now I've been a Chromebook convert.  I don't try to use a Chromebook as a complete desktop replacement, but for...