A small configuration tool

A small configuration tool

Yoctopuce modules are ideal for building application-specific measuring and automation systems. The end-user of the system doesn't even need to know that their system is based on Yoctopuce modules, since they work without drivers and our communication library can be fully integrated into the measuring and control software. Today, we're going to show you how to create a small, customizable and easy-to-use tool that enables end-users to configure a system to suit their network environment.

The problem

If you're distributing a system based on Yoctopuce modules, your software won't have any trouble accessing the modules when they're plugged in directly via USB. But if you offer the possibility of contacting them via a Wi-Fi network, the user needs to be able to configure the YoctoHub-Wireless-n to connect to their network. There are several ways of doing this:

  1. You can integrate the configuration interface into your software as described in this post, but that's a bit of extra work.
  2. You can document the use of VirtualHub for this task, as shown in this other post, but that makes it a little less transparent for the user.
  3. You can provide a small dedicated configuration tool, and that's the solution we're going to demonstrate.

A dedicated configuration tool

The windowed tool we are providing can be used as is if you only need to configure a YoctoHub-Wireless-n, but you can easily modify it to change texts, to add parameters to configure, or to translate it into another language. It's written in Python and runs on Windows, Linux and macOS. The interface is very simple, with just two windows:


Message as long as the YoctoHub is not plugged in Configuration interface


This program offers more or less the same function as the Wi-Fi network configuration window available through VirtualHub, but without the need for the user to search for this configuration window, or even launch our VirtualHub.

You can find the tool's source code on our sample repository on GitHub.

Configuring the module's "network name"

You may have noticed that in the interface above, the only other module parameter we allow to be configured is the module name. This is saved as the logical name of the module's network function, and is particularly important as it is the identity under which the YoctoHub-Wireless-n Wi-Fi interface announces itself on the local network for all discovery protocols, i.e. NBNS for Windows machines, and mDNS for Linux and macOS machines.

There's a particular advantage in configuring this name, as it can then be used by any machine on the same subnet to contact the module. The only subtlety is that, with mDNS, you need to add the domain suffix ".local". For example, if you give your hub the name "FlyingToaster", you can contact it in your application under Windows using the instruction

YAPI.RegisterHub("FlyingToaster", refmsg)


and under Linux/macOS with the instruction

YAPI.RegisterHub("FlyingToaster.local", refmsg)



Distribution as an executable

To further simplify the use of this tool, you can easily turn it into a stand-alone executable using the PyInstaller tool we mentioned a few weeks ago. As the Yoctopuce library files are located in the same directory as the program, all you need to do is run the following commands (the first of which is a one-time command, used to install PyInstaller itself):

pip install -U pyinstaller
pyinstaller --onefile --add-data cdll:cdll configurator.py


The resulting executable will be located in the dist subdirectory. Note that you'll need to run this command on each platform you wish to support in order to create a platform-specific executable.


Add a comment No comment yet Back to blog












Yoctopuce, get your stuff connected.