Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions RemoteIDModule/board_config.h
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
#define PIN_UART_RX 17

#define WS2812_LED_PIN GPIO_NUM_48
#define WS2812_LED_NUM 1

#elif defined(BOARD_ESP32C3_DEV)
#define BOARD_ID 2
Expand All @@ -23,6 +24,7 @@
#define PIN_UART_RX 2

#define WS2812_LED_PIN GPIO_NUM_8
#define WS2812_LED_NUM 1

#elif defined(BOARD_BLUEMARK_DB200)
#define BOARD_ID 3
Expand Down Expand Up @@ -77,6 +79,8 @@
#define PIN_UART_RX 5

#define WS2812_LED_PIN GPIO_NUM_2
#define WS2812_LED_NUM 1

#define CAN_APP_NODE_NAME "mRobotics RemoteID"

#elif defined(BOARD_JWRID_ESP32S3)
Expand All @@ -88,6 +92,7 @@
#define PIN_UART_RX 36

#define WS2812_LED_PIN GPIO_NUM_5
#define WS2812_LED_NUM 1

#define CAN_APP_NODE_NAME "JWRID_ESP32S3"

Expand Down Expand Up @@ -119,6 +124,7 @@
#define BUZZER_PIN GPIO_NUM_39 //at the moment easiest is to have active buzzer support. (Buzzer on if GPIO is high)

#define WS2812_LED_PIN GPIO_NUM_8 //there are two WS2812 LEDs on this GPIO
#define WS2812_LED_NUM 2

#define CAN_APP_NODE_NAME "BlueMark DB210PRO"
//#define PIN_CAN_TERM GPIO_NUM_42 // if set to ON, the termination resistors of the CAN bus are enabled
Expand Down Expand Up @@ -148,6 +154,7 @@
#define PIN_UART_RX 2

#define WS2812_LED_PIN GPIO_NUM_8
#define WS2812_LED_NUM 1

#elif defined(BOARD_CUAV_RID)
#define BOARD_ID 12
Expand All @@ -159,11 +166,15 @@
#define PIN_UART_RX 17

#define WS2812_LED_PIN GPIO_NUM_48
#define WS2812_LED_NUM 1

#define PIN_CAN_TERM GPIO_NUM_37
#define CAN_TERM_EN LOW
#define CAN_APP_NODE_NAME "net.cuav.c-rid"

#define WIFI_SSID_PREFIX "C-RID"
#define WIFI_PASSWORD "cuav12345678"

#else
#error "unsupported board"
#endif
6 changes: 5 additions & 1 deletion RemoteIDModule/led.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -48,12 +48,16 @@ void Led::update(void)
switch (state) {
case LedState::ARM_OK:
ledStrip.setPixelColor(0, ledStrip.Color(0, 255, 0));
ledStrip.setPixelColor(0, ledStrip.Color(1, 255, 0)); //for db210pro, set the second LED to have the same output (for now)
#if WS2812_LED_NUM > 1
ledStrip.setPixelColor(1, ledStrip.Color(0, 255, 0)); //for db210pro, set the second LED to have the same output (for now)
#endif
break;

default:
ledStrip.setPixelColor(0, ledStrip.Color(255, 0, 0));
#if WS2812_LED_NUM > 1
ledStrip.setPixelColor(1, ledStrip.Color(255, 0, 0)); //for db210pro, set the second LED to have the same output (for now)
#endif
break;
}
if (now_ms - last_led_strip_ms >= 200) {
Expand Down
2 changes: 1 addition & 1 deletion RemoteIDModule/led.h
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ class Led {

#ifdef WS2812_LED_PIN
uint32_t last_led_strip_ms;
Adafruit_NeoPixel ledStrip{2, WS2812_LED_PIN, NEO_GRB + NEO_KHZ800}; //the BlueMark db210pro boards has two LEDs, therefore we need to use 2.
Adafruit_NeoPixel ledStrip{WS2812_LED_NUM, WS2812_LED_PIN, NEO_GRB + NEO_KHZ800};
#endif
};

Expand Down
2 changes: 1 addition & 1 deletion RemoteIDModule/parameters.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -346,7 +346,7 @@ void Parameters::init(void)
if (strlen(g.wifi_ssid) == 0) {
uint8_t mac[6] {};
esp_read_mac(mac, ESP_MAC_WIFI_STA);
snprintf(wifi_ssid, 20, "RID_%02x%02x%02x%02x%02x%02x",
snprintf(wifi_ssid, 20, WIFI_SSID_PREFIX "_%02x%02x%02x%02x%02x%02x",
mac[0], mac[1], mac[2], mac[3], mac[4], mac[5]);

}
Expand Down
10 changes: 9 additions & 1 deletion RemoteIDModule/parameters.h
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,14 @@
#define PARAM_FLAG_PASSWORD (1U<<0)
#define PARAM_FLAG_HIDDEN (1U<<1)

#ifndef WIFI_SSID_PREFIX
#define WIFI_SSID_PREFIX "RID"
#endif

#ifndef WIFI_PASSWORD
#define WIFI_PASSWORD "ArduRemoteID"
#endif

class Parameters {
public:
#if defined(PIN_CAN_TERM)
Expand All @@ -37,7 +45,7 @@ class Parameters {
uint8_t webserver_enable;
uint8_t mavlink_sysid;
char wifi_ssid[21] = "";
char wifi_password[21] = "ArduRemoteID";
char wifi_password[21] = WIFI_PASSWORD;
uint8_t wifi_channel = 6;
uint8_t to_factory_defaults = 0;
uint8_t options;
Expand Down
Loading