Error compiling sketch on a ESP32

Hi, Sorry if this is the wrong place for this but this is my first post.

I get the following error
"invalid conversion from 'char*' to 'const uint8_t* {aka const unsigned char*}' [-fpermissive]"
when compiling a sketch to my new ttgo esp32 oled board, the code compiles fine and works with Node MCU 8266 but obviously the wifi is a little different here can any one help?

Thanks

#include <FastLED.h>
#include <esp_now.h>
#include <WiFi.h>
//#include <ESP8266WiFi.h>
#include <WiFiUDP.h>
#include "reactive_common.h"
#include <Wire.h>
#include "SSD1306.h"

SSD1306 display(0x3c, 5, 4); 

#define READ_PIN 32
#define BUTTON_PIN 17

#define NUMBER_OF_CLIENTS 1 //change to number of clients

const int checkDelay = 5000;
const int buttonDoubleTapDelay = 200;
const int numOpModes = 3;

unsigned long lastChecked;
unsigned long buttonChecked;
bool buttonClicked = false;
bool queueDouble = false;
bool clickTrigger;
bool doubleTapped;
WiFiUDP UDP;

struct led_command {
  uint8_t opmode;
  uint32_t data;
};

bool heartbeats[NUMBER_OF_CLIENTS];

static int opMode = 1;

void setup()
{
  display.init();
  display.setFont(ArialMT_Plain_24);
  display.drawString(20, 18, "Welcome");
  display.display();
  
  pinMode(READ_PIN, INPUT);
  pinMode(BUTTON_PIN, INPUT);

  /* WiFi Part */
  Serial.begin(115200);
  Serial.println();
  Serial.print("Setting soft-AP ... ");
  WiFi.persistent(false);
  WiFi.mode(WIFI_AP);
  WiFi.softAP("sound_reactive", "123456789");
  Serial.print("Soft-AP IP address = ");
  Serial.println(WiFi.softAPIP());
  UDP.begin(7171); 
  resetHeartBeats();
  waitForConnections();
  lastChecked = millis();
  buttonChecked = 0;
}


void loop()
{
 
  uint32_t analogRaw;
  buttonCheck();
  if (millis() - lastChecked > checkDelay) {
    if (!checkHeartBeats()) {
      waitForConnections();
    }
    lastChecked = millis();
  }

  switch (opMode) {
    case 1:
      analogRaw = analogRead(READ_PIN);
      if (analogRaw <= 3)
        break;
      sendLedData(analogRaw, opMode);
      break;
    case 2:
      sendLedData(0, opMode);
      delay(10);
      break;
    case 3:
      sendLedData(0, opMode);
      delay(10);
      break;
  }
  delay(4);
}

void sendLedData(uint32_t data, uint8_t op_mode) 
{
 struct led_command send_data;
 send_data.opmode = op_mode; 
 send_data.data = data; 
 for (int i = 0; i < NUMBER_OF_CLIENTS; i++) 
 {
    IPAddress ip(192,168,4,2 + i);
    UDP.beginPacket(ip, 7001); 
    UDP.write((char*)&send_data,sizeof(struct led_command)); // Here is where the error appears
    UDP.endPacket();
 }
}

void waitForConnections() {
  while(true) {
      readHeartBeat();
      if (checkHeartBeats()) {
        return;
      }
      delay(checkDelay);
      resetHeartBeats();
  }
}

void resetHeartBeats() {
  for (int i = 0; i < NUMBER_OF_CLIENTS; i++) {
   heartbeats[i] = false;
  }
}

void readHeartBeat() {
  struct heartbeat_message hbm;
 while(true) {
  int packetSize = UDP.parsePacket();
  if (!packetSize) {
    break;
  }
  UDP.read((char *)&hbm, sizeof(struct heartbeat_message));
  if (hbm.client_id > NUMBER_OF_CLIENTS) {
    Serial.println("Error: invalid client_id received");
    continue;
  }
  heartbeats[hbm.client_id - 1] = true;
 }
}

bool checkHeartBeats() {
  for (int i = 0; i < NUMBER_OF_CLIENTS; i++) {
   if (!heartbeats[i]) {
    return false;
   }
  }
  resetHeartBeats();
  return true;
}


void buttonCheck()
{
  int but = digitalRead(BUTTON_PIN);
  if (but == 0) {
    if (millis() - buttonChecked < buttonDoubleTapDelay && buttonClicked == false ) {
      doubleClicked();
      doubleTapped = true;
    }
    clickTrigger = true;
    buttonClicked = true; 
    buttonChecked = millis();
  }

  else if (but == 1) {
    if (millis() - buttonChecked > buttonDoubleTapDelay && clickTrigger) {
      if (!doubleTapped) {
        clicked();
      }
      clickTrigger = false;
      doubleTapped = false;
    }
    buttonClicked = false;
  }
}

void clicked() {
  if (opMode == numOpModes)
    opMode = 1;
  else
    opMode++;
  Serial.printf("Setting opmode %d \n", opMode);
}

void doubleClicked() {

}

void displayMode(){
display.init();
display.setFont(ArialMT_Plain_24);
display.drawString(25, 18, opMode);
display.display();
}

This basically reads audio signal from analog pin and a variable for the light mode (opMode) and transmits it to listening receivers that control ws2812b led strip

Thanks in advance :smiley:

I get the following error

Which is. . ?

Sorry its this,

invalid conversion from 'char*' to 'const uint8_t* {aka const unsigned char*}' [-fpermissive]

i've googled and can't seem to work it out so here i am, first forum post.

Post the error message.
All of it.

TheMemberFormerlyKnownAsAWOL:
Post the error message.
All of it.

This is everything from the copy error button, hope this helps

Arduino: 1.8.8 (Windows 10), Board: "TTGO LoRa32-OLED V1, 80MHz, 921600, None"

In file included from C:\Users\Administrator\Documents\Arduino\controllermod\controllermod.ino:1:0:

C:\Users\Administrator\Documents\Arduino\libraries\FastLED/FastLED.h:14:21: note: #pragma message: FastLED version 3.003.003

pragma message "FastLED version 3.003.003"

^

In file included from C:\Users\Administrator\Documents\Arduino\libraries\FastLED/FastLED.h:65:0,

from C:\Users\Administrator\Documents\Arduino\controllermod\controllermod.ino:1:

C:\Users\Administrator\Documents\Arduino\libraries\FastLED/fastspi.h:130:23: note: #pragma message: No hardware SPI pins defined. All SPI access will default to bitbanged output

pragma message "No hardware SPI pins defined. All SPI access will default to bitbanged output"

^

C:\Users\Administrator\Documents\Arduino\controllermod\controllermod.ino: In function 'void sendLedData(uint32_t, uint8_t)':

controllermod:105:59: error: invalid conversion from 'char*' to 'const uint8_t* {aka const unsigned char*}' [-fpermissive]

UDP.write((char*)&send_data,sizeof(struct led_command));

^

In file included from C:\Users\Administrator\AppData\Local\Arduino15\packages\esp32\hardware\esp32\1.0.4\libraries\WiFi\src/WiFi.h:39:0,

from C:\Users\Administrator\Documents\Arduino\controllermod\controllermod.ino:3:

C:\Users\Administrator\AppData\Local\Arduino15\packages\esp32\hardware\esp32\1.0.4\libraries\WiFi\src/WiFiUdp.h:65:10: note: initializing argument 1 of 'virtual size_t WiFiUDP::write(const uint8_t*, size_t)'

size_t write(const uint8_t *buffer, size_t size);

^

C:\Users\Administrator\Documents\Arduino\controllermod\controllermod.ino: In function 'void displayMode()':

controllermod:194:34: error: converting to 'String' from initializer list would use explicit constructor 'String::String(int, unsigned char)'

display.drawString(25, 18, opMode);

^

In file included from C:\Users\Administrator\Documents\Arduino\libraries\ESP8266_and_ESP32_OLED_driver_for_SSD1306_displays\src/SSD1306Wire.h:34:0,

from C:\Users\Administrator\Documents\Arduino\libraries\ESP8266_and_ESP32_OLED_driver_for_SSD1306_displays\src/SSD1306.h:33,

from C:\Users\Administrator\Documents\Arduino\controllermod\controllermod.ino:8:

C:\Users\Administrator\Documents\Arduino\libraries\ESP8266_and_ESP32_OLED_driver_for_SSD1306_displays\src/OLEDDisplay.h:233:10: note: initializing argument 3 of 'void OLEDDisplay::drawString(int16_t, int16_t, String)'

void drawString(int16_t x, int16_t y, String text);

^

Multiple libraries were found for "WiFi.h"
Used: C:\Users\Administrator\AppData\Local\Arduino15\packages\esp32\hardware\esp32\1.0.4\libraries\WiFi
Not used: C:\Program Files (x86)\Arduino\libraries\WiFi
exit status 1
invalid conversion from 'char*' to 'const uint8_t* {aka const unsigned char*}' [-fpermissive]

This report would have more information with
"Show verbose output during compilation"
option enabled in File -> Preferences.