Skip to content

Profiles

wolfen351 edited this page Mar 6, 2024 · 2 revisions

Profiles are a way to define a set of configuration parameters that can be used to configure a module. This is useful when you have a module that can be used in different scenarios, and you want to be able to switch between them easily.

Creating a Profile

Profiles are stored in the profiles folder. You can create a new profile by copying an existing one and modifying it to suit your needs. The profile is a JSON file that contains the following fields by default:

{
    "name": "LilyGo Battery Powered Temp Sensor",
    "shortName": "lilygo-gps",
    "activeModules": ["basic", "mqtt", "ota", "thingsboard", "web", "wifi", "gps", "homeassistant"],
    "cpuSpeed": 160000000,
    "statusLedPin" : 3,
}

The fields are:

  • name - The name of the profile
  • shortName - A short name for the profile
  • activeModules - A list of modules that are active in this profile
  • cpuSpeed - The speed of the CPU in Hz
  • statusLedPin - The pin that the status LED is connected to

Also there are often additional sections to configure the specific modules you have selected. For example, to configure the gps module you would add a section like this:

"gps": {
    "rxPin": 16,
    "txPin": 17
}

This would configure the GPS module to use pins 16 and 17 for the RX and TX pins.

The whole profile will look like this:

{
    "name": "LilyGo Battery Powered Temp Sensor",
    "shortName": "lilygo-gps",
    "activeModules": ["basic", "mqtt", "ota", "thingsboard", "web", "wifi", "gps", "homeassistant"],
    "cpuSpeed": 160000000,
    "statusLedPin" : 3,
    "gps": {
        "rxPin": 16,
        "txPin": 17
    }
}

The profile is used by the sync.ps1 script to send the correct files to the board. It is also used by the web UI to configure the board. Only the modules that are active in the profile will be sent to the board, to save space. The micropython code will also use the profile to load only the specified modules into memory.

Clone this wiki locally