Software Operation

The software operation is very simple. At power-on it initializes the OLED and displays the “Scope Voice Control” heading at the top. Next it starts the WiFi and attempts to connect to the network, displaying status messages on the OLED as it does so. It will continue trying to do this forever – there’s no timeout. So if you see it never connects to the WiFi, double-check your WiFi SSID & password variables in the code.

Once logged onto the WiFi it attempts to connect to the oscilloscope. Like the WiFi it displays status messages on the OLED and will try forever until it succeeds. So if your scope (Rigol MSO5000 family in this case) is powered on and is on the network, but the unit never connects, double-check your scope IP address variable in the code.

With the network related things out of the way, the ESP32 starts up the Elechouse VR3 module, tells it to load the voice recognizer, and then loops forever listening to the VR3. If the VR3 sends the ESP32 a message, the ESP32 checks to see if it matches the stop, single or run messages. If it finds a match, it displays it on the OLED and transmits the corresponding command to the oscilloscope, then continues listening to the VR3 module once again.

If you want to support a different oscilloscope, you’ll need to look up its programming guide to determine the supported network commands. For the Rigol, there’s no password to connect to the scope – just a basic socket to the correct IP address and port number. Then it’s simple text strings to issue commands, as shown in the code:

const char* scope_stop_msg   = ":STOP\n";
const char* scope_run_msg    = ":RUN\n";
const char* scope_single_msg = ":SINGle\n";

For a different scope, it’s likely the port number would be different, and the command strings might well need changing as well.

The elechouse voice recognition module can support up to 7 simultaneous records, ie words. Currently only 3 are used. If you want to add more words, it’s not difficult. The steps are:

    • Train more records / words using vr_sample_train.
    • Check the training using vr_sample_bridge. You will need to update the load command to load all the voice records.
    • From vr_sample_bridge also record the VR3 responses to your new words.
    • In the scope_control program add your new VR3 responses, the new strings (commands) to send to the scope, and in the “loop” section add the checking & response for the new words. Also update the vr3_load_records_cmd[] variable to include loading the new records.
<< Software Setup Housing & Usage >>