ClassicDIY / SkyeTracker

Dual Axis solar tracker
Apache License 2.0
65 stars 19 forks source link

Can't Build Firmware #53

Closed Stein-N closed 6 months ago

Stein-N commented 6 months ago

Hey i tried changing AnemometerVoltageMin and Max Settings to another Value and build the Firmware but i get the Error that SPI.h is missing:

Processing uno (board: nanoatmega328; platform: atmelavr; framework: arduino)
------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
Removing unused dependencies...
Verbose mode can be enabled via `-v, --verbose` option
CONFIGURATION: https://docs.platformio.org/page/boards/atmelavr/nanoatmega328.html
PLATFORM: Atmel AVR (5.0.0) > Arduino Nano ATmega328
HARDWARE: ATMEGA328P 16MHz, 2KB RAM, 30KB Flash
DEBUG: Current (avr-stub) External (avr-stub, simavr)
PACKAGES: 
 - framework-arduino-avr @ 5.2.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 10 compatible libraries
Scanning dependencies...
Dependency Graph
|-- ArduinoJson @ 7.0.4
|-- RTClib @ 2.1.4
|-- ArduinoThread @ 2.1.1
|-- Wire @ 1.0
|-- SoftwareSerial @ 1.0
Building in release mode
Compiling .pio\build\uno\src\Anemometer.cpp.o
Compiling .pio\build\uno\src\Configuration.cpp.o
Compiling .pio\build\uno\src\LinearActuatorNoPot.cpp.o
Compiling .pio\build\uno\src\Sun.cpp.o
Compiling .pio\build\uno\src\Tracker.cpp.o
Compiling .pio\build\uno\src\main.cpp.o
Compiling .pio\build\uno\liba7d\Wire\Wire.cpp.o
Compiling .pio\build\uno\liba7d\Wire\utility\twi.c.o
Compiling .pio\build\uno\lib460\Adafruit BusIO\Adafruit_BusIO_Register.cpp.o
Compiling .pio\build\uno\lib460\Adafruit BusIO\Adafruit_I2CDevice.cpp.o
Compiling .pio\build\uno\lib460\Adafruit BusIO\Adafruit_SPIDevice.cpp.o
Compiling .pio\build\uno\lib1f0\RTClib\RTC_DS1307.cpp.o
Compiling .pio\build\uno\lib1f0\RTClib\RTC_DS3231.cpp.o
Compiling .pio\build\uno\lib1f0\RTClib\RTC_Micros.cpp.o
Compiling .pio\build\uno\lib1f0\RTClib\RTC_Millis.cpp.o
Compiling .pio\build\uno\lib1f0\RTClib\RTC_PCF8523.cpp.o
In file included from .pio\libdeps\uno\Adafruit BusIO/Adafruit_BusIO_Register.h:10:0,
                 from .pio\libdeps\uno\Adafruit BusIO\Adafruit_BusIO_Register.cpp:1:
.pio\libdeps\uno\Adafruit BusIO/Adafruit_SPIDevice.h:9:10: fatal error: SPI.h: No such file or directory

*************************************************************
* Looking for SPI.h dependency? Check our library registry!
*
* CLI  > platformio lib search "header:SPI.h"
* Web  > https://registry.platformio.org/search?q=header:SPI.h
*
*************************************************************

 #include <SPI.h>
          ^~~~~~~
compilation terminated.
In file included from .pio\libdeps\uno\Adafruit BusIO\Adafruit_SPIDevice.cpp:1:0:
.pio\libdeps\uno\Adafruit BusIO\Adafruit_SPIDevice.h:9:10: fatal error: SPI.h: No such file or directory

*************************************************************
* Looking for SPI.h dependency? Check our library registry!
*
* CLI  > platformio lib search "header:SPI.h"
* Web  > https://registry.platformio.org/search?q=header:SPI.h
*
*************************************************************

 #include <SPI.h>
          ^~~~~~~
compilation terminated.
*** [.pio\build\uno\lib460\Adafruit BusIO\Adafruit_BusIO_Register.cpp.o] Error 1
*** [.pio\build\uno\lib460\Adafruit BusIO\Adafruit_SPIDevice.cpp.o] Error 1
src\Tracker.cpp: In member function 'void SkyeTracker::Tracker::ProcessCommand(const char*)':
src\Tracker.cpp:241:3: warning: 'template<unsigned int N> class ArduinoJson::V704L1::StaticJsonDocument' is deprecated [-Wdeprecated-declarations]
   StaticJsonDocument<256> root;
   ^~~~~~~~~~~~~~~~~~
In file included from .pio\libdeps\uno\ArduinoJson\src/ArduinoJson.hpp:53:0,
                 from .pio\libdeps\uno\ArduinoJson\src/ArduinoJson.h:9,
                 from include/Tracker.h:3,
                 from src\Tracker.cpp:1:
.pio\libdeps\uno\ArduinoJson\src/ArduinoJson/compatibility.hpp:63:58: note: declared here
 class ARDUINOJSON_DEPRECATED("use JsonDocument instead") StaticJsonDocument
                                                          ^~~~~~~~~~~~~~~~~~
=========================================================================================== [FAILED] Took 1.58 seconds ===========================================================================================

But when i add SPI as a dependency in the platformio.ini i get the following error:

Processing uno (board: nanoatmega328; platform: atmelavr; framework: arduino)
-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
Verbose mode can be enabled via `-v, --verbose` option
CONFIGURATION: https://docs.platformio.org/page/boards/atmelavr/nanoatmega328.html
PLATFORM: Atmel AVR (5.0.0) > Arduino Nano ATmega328
HARDWARE: ATMEGA328P 16MHz, 2KB RAM, 30KB Flash
DEBUG: Current (avr-stub) External (avr-stub, simavr)
PACKAGES: 
 - framework-arduino-avr @ 5.2.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 10 compatible libraries
Scanning dependencies...
Dependency Graph
|-- ArduinoJson @ 7.0.4
|-- RTClib @ 2.1.4
|-- ArduinoThread @ 2.1.1
|-- Wire @ 1.0
|-- SoftwareSerial @ 1.0
|-- SPI @ 1.0
Building in release mode
Checking size .pio\build\uno\firmware.elf
Advanced Memory Usage is available via "PlatformIO Home > Project Inspect"
RAM:   [=====Error: The program size (31316 bytes) is greater than maximum allowed (30720 bytes)
   *** [checkprogsize] Explicit exit, status 1
  ]  53.1% (used 1087 bytes from 2048 bytes)
Flash: [==========]  101.9% (used 31316 bytes from 30720 bytes)

i was wondering if i miss something

graham22 commented 6 months ago

It looks like it no longer fits in the available memory I'll look into it this weekend...

Stein-N commented 6 months ago

Oh nice thanks, was asked to change that but never used platformio ever before or C++ in general

graham22 commented 6 months ago

Set versions for dependent libraries in platform.ini added include for spi.h