Page 244 - Hacking Roomba
P. 244

Chapter 11 — Connecting Roomba to the Internet                 225



                             There is no username and password combination on either the web interface or the Telnet
                             interface. You can enable a password on the Telnet configuration interface or disable the
                             Telnet interface entirely. This doesn’t affect the web interface, which has no password protec-
                             tion, but you can also disable that interface too.
                             Be sure to read the XPort documentation thoroughly about configuration, especially if you’re
                             using Windows.




                             Using the XPort

                             When the XPort is configured, using it is just like using the SitePlayer Telenet. The only differ-
                             ence is the Telnet port. SitePlayer Telnet uses the standard port 23, while XPort uses port 10001.
                             In lieu of creating a custom circuit board for the XPort, the evaluation board is small enough to
                             be mounted on the top of Roomba. To supply power, either bring out the 5V from the power
                             supply in the serial tether and attach it to the 5V input of the evaluation board or build a small
                             5V power supply.

                             Going Further with XPort
                             Lantronix did a smart thing in making their line of embedded device server products similar to
                             each other. If you choose not to use the XPort, the Micro or Mini modules might be appropri-
                             ate for you. If you want Wi-Fi connectivity instead of Ethernet, the WiPort or WiMicro mod-
                             ules are replacements for their Ethernet cousins. The WiPort will be covered in detail in the
                             next chapter.


                     Modifying RoombaComm for the Net

                             You now have Roomba on the Net, but all the code you’ve created thus far has been designed
                             for the serial port. In Java, as in most modern languages, dealing with serial ports or Ethernet
                             ports is fairly similar. The RoombaComm library uses that fact to create a new subclass of
                             the RoombaComm base class that knows how to deal with the TCP telnet port that both the
                             SitePlayer Telnet and XPort produce. This new subclass is called RoombaCommTCPClient,
                             and most of it is shown in Listing 11-1.


                               Listing 11-1: RoombaCommTCPClient

                             package roombacomm.net;
                             import roombacomm.*;
                             public class RoombaCommTCPClient extends RoombaComm
                             {
                                 String host = null;
                                                                                              Continued
   239   240   241   242   243   244   245   246   247   248   249