Hi on esp8266 i have a function that sends messages to other nodes.
struct {
byte IP[4];
} _EEPROM;
void sendMessage(char command[], IPAddress ip, int port) {
Udp.beginPacket(ip, port);
Udp.write(command);
Udp.endPacket();
server.send(200, "text/html", "Okay!");
}
sendMessage("NODECOMMAND", _EEPROM.IP, ServerPort); //send message
but when i try the same thing on esp32 i get error,
invalid conversion from 'byte* {aka unsigned char*}' to 'const char*'
what do i have to do differently?
Change the offending "char*" to "const char*" ?
Im sorry i screwed up. my variables are different. have a look at this error instead please.,
struct {
char IP[4];
} _EEPROM;
void sendMessage(char command[], IPAddress ip, int port) {
Udp.beginPacket(ip, port);
Udp.write(command);
Udp.endPacket();
server.send(200, "text/html", "Okay!");
}
sendMessage("NODECOMMAND", _EEPROM.IP, ServerPort); //send message
i have redefined my variable as char but now it complains
conversion from 'char [20]' to 'IPAddress' is ambiguous
blh64
4
The error message will also tell you where (e.g. line #) this happens but you did not provide that vital piece of information.
Posting all the code as well as all the error message(s) helps greatly too.
I shouldn't have to say that...
What happens if you change the line above to:
system
Closed
7
This topic was automatically closed 120 days after the last reply. New replies are no longer allowed.