In this second article on the new communication modes available in leJOS I want to take a look at the configuration options provided by the updated menu. Let’s start by configuring an EV3 as an access point (which is the default configuration).
The first image shows the new menu item used to access the PAN configuration. Selecting it shows the supported modes (USB Client, None, Access Point, Access Point+ and Bluetooth Client). If we select the access point option we get the configuration page for this mode. The top line shows the IP address that will be used for the access point (10.0.1.1), to see the full address you can scroll the item using the left and right arrows. The other options allow you to configure more advanced features (like the netmask, broadcast address etc.), in general you will not need to change these. If you do want to change an address select it and you will be presented with:
This first screen lets you choose to use an automatic address, or to configure the address yourself. If you choose the advanced option you will be presented with the address screen. This lets you enter the IP address using the arrow keys, when you have finished press enter. Finally when you use the back button to exit the PAN menu you will see the restarting screen displayed. This will show a series of status messages as the EV3 reconfigures the PAN.
Now let’s configure a second EV3 as a client to connect to our access point via Bluetooth.
For this we need to select the BT Client option. The next screen allows you to choose which access point to connect to. By default the EV3 will search automatically for any device offering a NAP service (the standard Bluetooth name for a PAN access point). This setting will work fine for most situations. But if your environment (like a school) has many EV3s or if you want to make the connection a little faster, you can choose to select a particular device to connect to. The device menu will list all the Bluetooth devices that have been paired with the EV3. If your access point is not listed you may need to pair with it first.
Finally you can choose the advanced settings. Like the access point settings this option lets you configure many of the low level IP options. In most cases these should probably be left as they are. However you may want to assign a fixed IP address to an EV3 (say 10.0.1.2 to EV2, 10.0.1.3 to EV3 etc.). There are also two additional settings, the first “Persist” allows you to specify that the EV3 should try and connect to the access point on a periodic basis, not just at startup. This setting is useful once you have things setup the way you like them as it means you do not have to power the access point on first, the client will keep trying to connect until it becomes available. The second option allows you select the type of Bluetooth service you wish to connect to. The default NAP is designed to work with an access point, but others like PANU and GN can be used to connect to other devices offering Bluetooth PAN connection services (PANU will allow you to connect to a PC – but you will probably need to configure some of the other advanced settings to get this to work). Finally after completing or changing the configuration the restart screen will be displayed. This time you may see messages as the EV3 searches for the access point and establishes a connection with it.
Configuring a USB client is basically the same as a Bluetooth client except there are fewer options. I’ll leave you to explore that!
The final option is Access Point+. Basically this in an enhanced version of the access point which allows the PAN to be accessed via a WiFi network that is also connected to the EV3 running as an access point. The configuration is very similar to that used for the normal Access Point mode. The key difference is that in this case the access point and each EV3 connected to it must have an address that is valid on your WiFi network. To do this we need to allocate part of your WiFi networks IP address space to the PAN. This process is known as creating a sub-net, in this case the sub-net allows for 16 IP addresses. To cut a long story short (you can read about sub nets with a google search!), the address used for the access point needs to start on a multiple of 16, and this address and the following 15 addresses need to be ones that are not used by other devices on your WiFi network. On my router (and many others) addresses that have a final component above 200 (for instance 192.168.0.200 or 10.0.1.200 etc.) are reserved for static allocation. So by default the first usable address in this range will be used (in my case this is 192.168.0.208). The other difference is that the other advanced settings when set to <auto> will use values picked up from your local WiFi configuration, allowing the EV3 to use your DNS and other settings. It sounds complex, but if you have WiFi and multiple EV3s give it a try!
In the next part of this series I’ll take a look at how the performance of Bluetooth, USB and WiFi based connections compare.