Page 1 of 1

MLP and PlatformIO errors

Posted: Sat Mar 11, 2023 9:25 pm
by Joe
Hi,
how can I use MLP ino code in PlatformIO? Just tried to compile example RequestSingleParameter.ino. Library is installed correctly but I'm getting these errors

Code: Select all

Processing megaatmega2560 (platform: atmelavr; board: megaatmega2560; framework: arduino)
---------------------------------------------------------------------------------------------------------------------------------------------------------------Verbose mode can be enabled via `-v, --verbose` option
CONFIGURATION: https://docs.platformio.org/page/boards/atmelavr/megaatmega2560.html
PLATFORM: Atmel AVR (4.1.0) > Arduino Mega or Mega 2560 ATmega2560 (Mega 2560)
HARDWARE: ATMEGA2560 16MHz, 8KB RAM, 248KB Flash
DEBUG: Current (avr-stub) External (avr-stub, simavr)
PACKAGES:
 - framework-arduino-avr @ 5.1.0
 - toolchain-atmelavr @ 1.70300.191015 (7.3.0)
LDF: Library Dependency Finder -> https://bit.ly/configure-pio-ldf
LDF Modes: Finder ~ chain, Compatibility ~ soft
Found 6 compatible libraries
Scanning dependencies...
Dependency Graph
|-- MegunoLink @ 1.41.0 
|-- SoftwareSerial @ 1.0
Building in release mode
Compiling .pio\build\megaatmega2560\src\main.cpp.o
Compiling .pio\build\megaatmega2560\lib62a\MegunoLink\ArduinoTimer.cpp.o
Compiling .pio\build\megaatmega2560\lib62a\MegunoLink\BlockParser.cpp.o
Compiling .pio\build\megaatmega2560\lib62a\MegunoLink\CommandDispatcherBase.cpp.o
src\main.cpp: In function 'void setup()':
src\main.cpp:24:57: error: 'Cmd_SetOnTime' was not declared in this scope
   SerialCommandHandler.AddCommand(F("numOnTime.Value"), Cmd_SetOnTime);
                                                         ^~~~~~~~~~~~~
src\main.cpp:24:57: note: suggested alternative: 'GotOnTime'
   SerialCommandHandler.AddCommand(F("numOnTime.Value"), Cmd_SetOnTime);
                                                         ^~~~~~~~~~~~~
                                                         GotOnTime
src\main.cpp:25:58: error: 'Cmd_SetOffTime' was not declared in this scope
   SerialCommandHandler.AddCommand(F("numOffTime.Value"), Cmd_SetOffTime);
                                                          ^~~~~~~~~~~~~~
src\main.cpp:25:58: note: suggested alternative: 'GotOffTime'
   SerialCommandHandler.AddCommand(F("numOffTime.Value"), Cmd_SetOffTime);
                                                          ^~~~~~~~~~~~~~
                                                          GotOffTime
src\main.cpp:26:49: error: 'Cmd_ListParameters' was not declared in this scope
   SerialCommandHandler.AddCommand(F("ListAll"), Cmd_ListParameters);
                                                 ^~~~~~~~~~~~~~~~~~
src\main.cpp:26:49: note: suggested alternative: 'SpecialParameters'
   SerialCommandHandler.AddCommand(F("ListAll"), Cmd_ListParameters);
                                                 ^~~~~~~~~~~~~~~~~~
                                                 SpecialParameters
src\main.cpp: In function 'void loop()':
src\main.cpp:41:49: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
     digitalWrite(LED_BUILTIN, (uNow - LastBlink < OnTime) ? HIGH : LOW);
                                ~~~~~~~~~~~~~~~~~^~~~~~~~
src\main.cpp:42:28: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
     if ((uNow - LastBlink) > (OnTime + OffTime))
         ~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~
src\main.cpp:51:5: error: 'RequestParameters' was not declared in this scope
     RequestParameters();
     ^~~~~~~~~~~~~~~~~
src\main.cpp:51:5: note: suggested alternative: 'RequestTimer'
     RequestParameters();
     ^~~~~~~~~~~~~~~~~
     RequestTimer
*** [.pio\build\megaatmega2560\src\main.cpp.o] Error 1
Maybe someone else already solved the problems

Re: MLP and PlatformIO errors

Posted: Thu Mar 30, 2023 8:10 am
by philr
Hi, where did that example come from?

Cheers
Phil

Re: MLP and PlatformIO errors

Posted: Tue Apr 04, 2023 7:31 pm
by Joe
Hi Phil,
this example comes from your GitHub repository
https://github.com/Megunolink/MLP/tree/ ... eParameter

Joe

Re: MLP and PlatformIO errors

Posted: Thu Apr 13, 2023 1:59 pm
by Joe
Any ideas?

Re: MLP and PlatformIO errors

Posted: Thu Apr 27, 2023 7:08 pm
by Joe
Did anybody made the CommandHandler working with PlatformIO?

Re: MLP and PlatformIO errors

Posted: Thu May 11, 2023 7:52 am
by philr
Weird, it builds fine using the arduino IDE. did you have any luck with platform IO? I dont have any experience with that one.

Re: MLP and PlatformIO errors

Posted: Sun Nov 19, 2023 2:08 am
by strud
I think that one of the significant differences with PlaformIO and the Arduino IDE is the requirement for forward declarations in PlatformIO or pretty much anywhere outside the Arduino IDE.

So those errors look like the command handler functions are just out of scope. Forward declarations should resolve that.