Skip to content

customize

Taraqur Rahman edited this page Apr 3, 2024 · 11 revisions

Edit the Duck's

The default Mama Example has a class duck.setupwithdefaults() that sets up the minimum classed needed to use a MamaDuck, is sets up the following methods.

setupRadio(); setupWifi(); setupDns(); setupWebServer(); setupOTA();

You can customize your Mamaduck by using the Custom Mama Example, Pass in the correct values to the methods as shown below.

Change Captive Portal name

You can change the SSID of the duck by passing in a new SSID in the setup.

#include <MamaDuck.h>

// create a MamaDuck Instance
MamaDuck duck = MamaDuck();

void setup(){

  // Change the Duck SSID
  duck.setupWifi(const char * ap = "DUCK CUSTOM SSID");

}

Change the Serial BaudRate

Chnage the baud rate, baudRate default: 115200

#include <MamaDuck.h>

// create a MamaDuck Instance
MamaDuck duck = MamaDuck();

void setup(){

  // Change the Serial BaudRate
  duck.setupRadio(int baudRate = 115200)

}

Change the Lora Radio Configuration

All of our supported development boards are defined in the CDPCFG.h if you want to add another LoRa configuration to the setup us the following method:

#include <MamaDuck.h>

// create a MamaDuck Instance
MamaDuck duck = MamaDuck();

// LORA RF CONFIG
#define LORA_FREQ 915.0 // Frequency Range. Set for US Region 915.0Mhz
#define LORA_TXPOWER 20 // Transmit Power
#define LORA_CS_PIN 18
#define LORA_DIO0_PIN 26
#define LORA_DIO1_PIN -1 // unused
#define LORA_RST_PIN 14

void setup(){

  // Change the Serial BaudRate
  duck.setupRadio(LORA_FREQ, LORA_CS_PIN, LORA_RST_PIN, LORA_DIO0_PIN, LORA_DIO1_PIN, LORA_TXPOWER);	

}