Hello!
First post! Please let me know if I commit any faux pas.
I have been using the cmdMessenger library to build communication interfaces for a while now, and am pretty familiar with it. However, it does not seem to want to compile on my ESP32 Thing-Plus. I receive the below error.
Any experience with this, or similar stuff? This library works great for me on any number of other uControllers, so this is a bit of a conundrum for me.
Thanks,
Nate
Arduino/libraries/CmdMessenger/CmdMessenger.cpp: In member function 'char* CmdMessenger::readStringArg()':
Arduino/libraries/CmdMessenger/CmdMessenger.cpp:492:9: error: invalid conversion from 'char' to 'char*' [-fpermissive]
return '\0';
^~~~
exit status 1
Error compiling for board SparkFun ESP32 Thing Plus.
I haven’t seen that before, but almost every time I have a compile error for esp32 it’s because arduino has gotten the board definitions mixed up somehow; try wiping the board def folder like so https://support.arduino.cc/hc/en-us/art … rduino-IDE (delete the add’l files folder and re-install the board definitions) and try again
Howdy!
Thanks for getting back to me. I deleted the contents of my Arduino 15 folder, and removed the ‘espressif’ folder from the ‘hardware’ folder as well. Let me know if this is what you were thinking.
Then, I reinstalled the board definition as shown here: https://learn.sparkfun.com/tutorials/es … okup-guide
I continue to get the same error though, even in a blank sketch with only the #include statement. Let me know if you have any further suggestions! I’d really love to continue to use cmdMessenger, and I have to imagine this is some subtle issue in the compiler.
Some compilers are more strict than others on some definitions. The new 3.0.4. ESP32 has been causing me compiler errors I did not have before.
In the file : Arduino/libraries/CmdMessenger/CmdMessenger.cpp
line 492 change
return '\0';
to
return (char *) '\0';
THAT error message is solved.
But NOW I got the next one :
Arduino/libraries/CmdMessenger/utility/HeaterSim.cpp:73:72: error: no matching function for call to 'max(long unsigned int, int)'
In the file : Arduino/libraries/CmdMessenger/utility/HeaterSim.cpp
change line 73 from
if (currentTime >= _lastTime) _deltams = max(currentTime - _lastTime, 1);
to
if (currentTime >= _lastTime) _deltams = max(currentTime - _lastTime, (unsigned long) 1);
Now it all compiles (for me :-))