MTE Mode - Jamal-Ra-Davis/Daftpunk_Speaker_IDF GitHub Wiki

Intro

The system can be flashed with a special MTE image that allows for connecting to the device over WiFi and running commands for testing and provisioning it via a python based command shell.

Note: The EPS32 does not have enough code storage space to included both the Bluetooth Audio and WiFi libraries, as such the MTE functionality was split out into a separate build

Enabling MTE mode

MTE mode can be enabled via menuconfig with the following sequence:

  1. Open menuconfig: idf.py menuconfig
  2. Navigate to MTE Config -> Operation Mode -> Include WIFI in build image image image
  3. Make sure Include WIFI in build is selected and press S to save and then exit

Setup WiFi Credentials

  1. Open menuconfig: idf.py menuconfig
  2. Navigate to WiFi SSID and replace myssid with your networks SSID info image
  3. Navigate to WiFi Password and replace mypassword with your networks SSID info image
  4. Press S to save and then exit

Command Shell

Running Command Shell

While the system is flashed with the MTE image, the system can be connected to via WiFi and execute test/provisioning commands it receives. The command shell can be used as an interface to send these commands. Note: The IP address of the unit will be displayed on the display as it boots.

  • Navigate to Scripts directory inside Daftpunk_Speaker_IDF
  • Run cmd_test.py --ip <IP address of unit> to open command shell
  • Run the help command to see what commands are available. Note: Commands are documented below image

Command Shell APIs

Echo Command

  • Description: Sends string to device and echoes the response back
  • Command Format: echo <echo_string>
  • Arguments:
    • echo_string: String to be echoed back
  • Usage:

image

CRC Command

  • Description: Calculates CRC-16 for a given input buffer
  • Command Format: crc
  • Arguments:
    • input: Input string to be converted to bytearray and used to perform CRC
  • Usage:

image

NVM Write

  • Description: Writes specified file into fixed NVM location on device
  • Command Format: nvm_write <file_path>
  • Arguments:
    • file_path: Path of file to be written to NVM
  • Usage:

image

Write Audio Asset

  • Description: Writes specified audio file to NVM on device.

Note: Audio file must be in raw format (Signed 16-bit PCM, Little Endian, Stereo, 44.1KHz Sample Rate). See below for instructions on converting files with Audacity

  • Command Format: write_audio_asset <Audio ID (0 - 7)> <file_path> <filename_dev>
  • Arguments:
    • Audio ID: Audio reference ID for the audio file.
    • File Path: Path of the audio file to be written to NVM
    • File Name Device: Name of the file saved into NVM's filesystem
  • Usage:

image

Get Audio Meta Data

  • Description: Prints audio metadata for each audio slot
  • Command Format: get_audio_metadata
  • Arguments: None
  • Usage:

image

Play Audio Asset

  • Description: Plays specificed audio file based on Audio ID
  • Command Format: play_audio_asset <Audio ID (0 - 7)>
  • Arguments:
    • Audio ID: Audio reference ID for the audio file
  • Usage:

image

Erase NVM

  • Description: Formats flash storage and erases all NVM data
  • Command Format: nvm_erase_chip
  • Arguments: None
  • Usage:

image

Converting Audio to raw with Audacity

  • Open audio file with Audacity

  • In lower-left corner, set Project Rate (Hz) to 44100

    image

  • Navigate to File -> Export -> Export Audio

    • In the Save as type: dropdown, select Other uncompressed files
    • In the Header: dropdown, select RAW (header-less)
    • In the Encoding: dropdown, select Signed 16-bit PCM
    • Give the file a name and save

    image

⚠️ **GitHub.com Fallback** ⚠️