Compiler error when trying to compile "Node" program [solved]

Started by Tom12, December 12, 2022, 11:47:10 AM

Tom12

Hi Everyone,
Moteino newbie here, just getting started with Moteinos, but I have a lot of previous Arduino and general microprocessor experience.  Having a bit of trouble getting the "Node" example program to compile, so I thought I would ask the group for some advice.
Just downloaded the latest Arduino IDE 2.0.3. (I know, I know, I'm probably asking for trouble, using the "bleeding" edge like this, but I thought I would try it.

Hardware: Linux computer running Ubuntu 22.04.1 LTS on an Intel Core i3-10100 CPU, 16GB of RAM
Arduino Software: arduino-ide_2.0.3_Linux_64bit

The IDE seems to come up just fine and I installed the (latest?) LowPowerLab libraries as follows:
RFM69 (Version: 1.5.2)  and SPIFlash (Version 101.1.3)
And installed the (latest?) LowPowerLab boards manager files as follows:
Moteino AVR Boards (Version 1.6.1)

When I try to compile the example LPL "Node" program, with the IDE set up for a "Moteino(-USB)" board, I get a compile error that goes as follows:
   "sutomm1/Arduino/libraries/SPIFlash_LowPowerLab /tmp/arduino-sketch-1A998E693E87028E4D0971E079BE76DF/sketch/Node.ino.cpp -o /tmp/arduino-sketch-1A998E693E87028E4D0971E079BE76DF/sketch/Node.ino.cpp.o
    sorry - this program has been built without plugin support"

You can view the complete compiler output on pastebin.com here:  https://pastebin.com/xCdFAZdh

I can't seem to figure this error out.  Anyone have any suggestions for me?  Thanks in advance everyone and Happy Holidays!
Tom12

Felix

This error seems to refer to the IDE maybe?
"sorry - this program has been built without plugin support"

Can you compile the same example with an Arduino UNO target?

Tom12

OK, compiling the same program with an Arduino Uno target, I don't get the same error but instead a different one, related to the SPIFlash:

/tmp/.arduinoIDE-unsaved20221112-7465-1sgg2e2.pvmo/Node/Node.ino:72:16: error: 'SS_FLASHMEM' was not declared in this scope
SPIFlash flash(SS_FLASHMEM, 0xEF30); //EF30 for 4mbit  Windbond chip (W25X40CL)
                ^~~~~~~~~~~
Complete compiler output at pastebin.com here: https://pastebin.com/eLsvYFW8

Note: there was no actual target board plugged into the computer, either a Moteino in the first case or a Arduino Uno in the second case. But, since I'm only trying to do a *compile*  and not a *download*, that shouldn't make a difference. (should it?)  Maybe, I'll go and try that now, though, just to see.

Tom12

OK, so doing the same compile of the "Node" program with an Arduino Uno target board *AND* with an Arduino Uno board connected to the computer didn't make a difference. Still got the same compile error: 'SS_FLASHMEM' was not declared in this scope'

And, doing the same compile of the "Node" program with an Moteino (-USB) target board *AND* with an Moteino USB board connected to the computer still gave the same errors as I detailed in my very first post: " sorry - this program has been built without plugin support"

Tom12

Another data point:  If I try to compile the standard, built-in, Arduino "Blink" example program, but with a Moteino(-USB) target I get a similar error message:
"/tmp/arduino-sketch-2644C9DCB64384C7CD17F4E80F29BD51/sketch/Blink.ino.cpp -o /tmp/arduino-sketch-644C9DCB64384C7CD17F4E80F29BD51/sketch/Blink.ino.cpp.o
sorry - this program has been built without plugin support"
Complete compiler output at pastebin.com here:  https://pastebin.com/myaBGAKq

Finally, just for the sake of completeness, compiling "Blink" with a standard Arduino Uno target, will compile just fine and will download to a Uno just fine and also run.

Felix

Something's very weird, you have the SPIFlash library so that error should not show.
The other error is also not ringing a bell.
I would suggest trying this on a different computer if you are able.

Tom12

Sorry, Felix, I only have the one Linux desktop computer.
I'll try backing off to a slightly older version of the Arduino IDE and see what that does. 
Thanks for your help!

Tom12

Actually, before trying earlier IDEs, I did a google search for: arduino compile error "sorry - this program has been built without plugin support"
and came up with an entry in the arduino forums from about 6 years ago:   https://forum.arduino.cc/t/1-6-10-plugin-error/402467
in which user "steodor" says:
"The problems appears to be from platform.txt file in the Arduino main install folder.
I am using windows so this is "C:\Program Files\Arduino\hardware\arduino\avr"
When installing additional boards the ar program is switched from avr-ar to avr-gcc-ar, which requires the compiler to enable linker plugins when building.
To fix it I removed -fuse-linker-plugin from the compiler.c.elf.flags= line and replace avr-gcc-ar with avr-ar on the compiler.ar.cmd= line
After this I am able to compile for both Arduino UNO and WeMos D1 R2 boards."

So, I'll try poking around in the arduino IDE files and see if I can find a "platform.txt" file. Hopefully, the newer Linux IDE files are similar to the older Windows files


Tom12

OK, decided to go back to an earlier version of the Arduino IDE: 1.8.19 instead of the newest version I was using: 2.0.3 (Reading up a bit on 2.0.3, I guess it's a *major* change, being based on a new Eclipse Theia framework,and I suppose one should expect some teething problems.)

Anyway, I deleted the main 2.0.3 directory and the two hidden directories it created under my home directory: ".arduino15" and ".arduinoIDE" and installed 1.8.19 and the latest Moteino libraries and board files. 

Now, I can compile the standard Arduino "Blink" program without errors; download it to a Moteino USB and it seems to run just fine.
And when I compile the Moteino "Node" example, I only get a slight syntax error related to SPIFlash ("SS_FLASHMEM' was not declared in this scope", see complete compiler output here: https://pastebin.com/eJQVUJ54).  So, I guess there must be a slight syntax error in the "Node" example. (Which I haven't tried to figure out, as my C/C++ programming skills are very rusty after a long absence.)
Anyway, not having any SPIFlash on any of the Moteinos I recently ordered, I commented out all the SPIFlash code and the "Node" program now compiles just fine and downloads OK as well.
So, I think I'm making progress and I'm ready to start playing around with some Moteino networks (and I'm excited about that!).

Happy Holidays, Everyone!
Tom12

Felix

Good, but the SS_FLASHMEM error is because it cannot find the declaration of it.
This is declared here:

path .. to .. Arduino15/packages/Moteino/hardware/avr/1.6.1/variants/Moteino/pins_arduino.h

When you pick the Moteino board this should automatically be included by the compiler and recognized in sketches that make reference to it.

Tom12

Oh, you're right, you're right.  I tried to compile the sketch with it accidentally set to board = "Arduino Uno" instead of board = "Moteino-USB" (trying too many different things, I guess, and lost track.)
When I set it to the correct board, the "Node" sketch compiles perfectly.  Thank you!