🐌 The Shell Example

Published on Jan 14, 2023


Seashells

A REPL-like Interface

Each module comes with a Shell example. It provides a command-line REPL-type interface. If a problem can be detected in the hardware or firmware, it will bubble up to an error code.

This is great because it will identify issues and tell you about them without wondering why it is just silently failing or giving you some odd results.

In the Arduino IDE, you’ll find the shell examples with all the rest in the Examples menu. Compile and upload it, then start the serial monitor at 9600 baud. Press ’c’ and you should see the configuration information for the module, ’h’ will give you a list of commands.

A few examples

mod-EC Shell

  • c’ will show you if the module is connected, the calibration data, and the hardware and firmware version
  • h’ gives a list of commands, and their parameters
  • ec’ will perform a measurement using default parameters for fresh/hydroponic water
  • ec 23.1’ will perform a measurement using default freshwater parameters, with the solution-under-test temperature set 23.1 C

mod-pH Shell

  • c’ will show you if the module is connected, the calibration data, and the hardware and firmware version
  • h’ gives a list of commands, and their parameters
  • ph’ will perform a measurement using default parameters
  • ph 23.1’ will perform a measurement using default parameters, with the solution-under-test temperature set to 23.1 C

There are more commands for calibration and taking measurements with less-common parameters. Each sensor module has its own shell.