![]() |
Morse Micro IoT SDK
2.10.4
|
This overview expands on some of the files and tools used as part of the MM-IoT-SDK.
The following is a brief overview of the contents of the MM-IoT-SDK package as it relates to using the Makefile based framework. Note that there are additional files that are used for PlatformIO that are not covered here.
| Path | Description |
|---|---|
applications/ | Source code for platform-specific applications. |
framework/doc/ | HTML documentation, including Getting Started Guide and API documentation |
framework/mk/ | Makefile fragments for the various SDK components |
framework/morsefirmware/ | Firmware and board configuration files for supported Morse Micro chips and modules |
framework/morselib/ | Headers and .a files for morselib. Libraries can be found under morselib/lib/<architecture> |
framework/src/freertos/ | FreeRTOS source code |
framework/src/hostap/ | WPA Supplicant source code |
framework/src/lwip/ | Lightweight IP source code |
framework/src/platforms/ | Platform-specific code. Includes relevant MCU BSP code, Hardware Abstraction Layer shims, Operating System abstraction layer shim. |
framework/tools/ | Various host tools |
examples/ | Example applications in source form. Note not all platforms support all examples due to memory constraints |
This SDK includes several example applications, source code for which can be found in the mm-iot-sdk-2.10.4/examples/<example> directory. For more detail about each of the example applications see the Example Applications page.
Below is a quick overview of some key files in the ping example application directory. It is not a substitute for reading the source code.
| File | Description |
|---|---|
src/ping.c | This is the main entry point for the application code and contains the core ping logic |
src/mm_app_common.c | This is a common module used by a number of example apps for initializing the network interface |
config.hjson | Configuration file used for populating the Morse Micro Persistent Configuration Store module |
targets/<platform>/Makefile | Makefile to build the example application for the supported platforms |
All the Python scripts in the Morse Micro IoT SDK use Python3.10 (default for Ubuntu 22.04).
As part of the SDK there are a number of Python scripts used as tools (Setting Config Store) or to drive example applications (How to use the Emmet example application). In order to maximise the chances of these scripts working seamlessly on your machine we utilise a tool called Pipenv. It is a tool used to automatically create and manage a virtualenv. The virtualenv used for the SDK is defined by the Pipfile located in the root of the mm-iot-sdk-2.10.4 directory.
You can run Python scripts from the virtualenv in two ways:
pipenv shell. This will drop you into a shell in the virtual env from which you can run your Python scripts as normal.pipenv run ./tools/your-script.py . This will run the script in the virtual env and then exit.The
pipenvcommands must be run from the same directory as the Pipfile that defines the virtualenv. If you do not do this a new virtualenv will be defined without the required packages.
The preferred method of configuring the application is using the Morse Micro Persistent Configuration Store module. The main advantage here is that we only have to build the binary once to get a variety of different combinations. An example might be that you would like to ping a different remote IP, you can just modify the value in the Morse Micro Persistent Configuration Store and reboot the application (by pressing the reset button) - no firmware modification needed.
Instructions for loading values into Morse Micro Persistent Configuration Store can be found in Setting Config Store.
There are a number of configuration parameters that can be used to change how the applications operate. For example, the ping application uses the following configuration variables:
| Configuration Params | Description |
|---|---|
wlan.country_code | Two character country code. For an up-to-date list of supported country codes in the supplied regulatory database, see the reference implementation mmregdb.c. |
wlan.ssid | SSID of the AP to connect to. |
wlan.password | The Wi-Fi password, not required if wlan.security is open. |
wlan.security | The Wi-Fi security to use, valid values are sae, owe and open. |
ping.target | IP address of the remote device (e.g., AP) to ping. |
ping.count | Number of ping packets to send. |
ping.size | Size of ping payload in bytes. |
ping.interval | Interval (in ms) between successive ping requests. |
bcf_file | Board configuration .mbin file to use. |
The full list of configurations can be view in mm-iot-sdk-2.10.4/examples/<application>/config.hjson.
Fields can be modified individually using:
pipenv run ./tools/platform/program-configstore.py -H localhost write-string wlan.ssid <new_ssid>
This also works for integers and boolean values such as ping.size and ip.dhcp_enabled, as they are parsed from strings to their respective types.
The Board Configuration File (BCF) is a configuration file for the Morse Micro chip that provides board-specific information and is required for the system to function properly. BCFs for Morse Micro modules are included in the MM-IoT-SDK package under the mm-iot-sdk-2.10.4/framework/morsefirmware directory. The BCF needed can be identified by inspecting the Morse Micro module on the board you are using, which will have a part number printed on the label in the form MM6108-MFxxxxxx.