Github Devices Community Docs Blog

Build error with Arduino Mega + Ethernet Shield + Platformio on Mac

Hi - I am using Platforio for a while on Mac OSX to program ESP32 and 8266 boards, also I programmed ESP32 with OMG 0.9.3 version without issues including RF and BLE modules.

I decided to move away from ESP32 and build OMG 0.9.3 on Arduino Mega + W5100 ethernet shield + Bluetooth + RF 433Mhz modules.

My first attempt to build on a Mac with Platformio failed, ZgatewayBT.ino is missing, however it is in the main folder.

I have received the following errors:

Processing atmega-all (platform: atmelavr@1.13.0; 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 1.13.0 > Arduino Mega or Mega 2560 ATmega2560 (Mega 2560)

HARDWARE: ATMEGA2560 16MHz, 8KB RAM, 248KB Flash

PACKAGES:

  • framework-arduinoavr 3.10623.190424 (1.6.23)

  • toolchain-atmelavr 1.50400.190710 (5.4.0)

Converting main.ino

/Users/balazsadam/Documents/PlatformIO/OpenMQTTGateway-0.9.3-MEGA/main/main.ino:37:0: warning: “array_size” redefined

#define array_size 4

^

/Users/balazsadam/Documents/PlatformIO/OpenMQTTGateway-0.9.3-MEGA/main/main.ino:32:0: note: this is the location of the previous definition

#define array_size 12

^

Unicode decode error has occurred, please remove invalid (non-ASCII or non-UTF8) characters from /Users/balazsadam/Documents/PlatformIO/OpenMQTTGateway-0.9.3-MEGA/main/main.ino.cpp file

LDF: Library Dependency Finder -> http://bit.ly/configure-pio-ldf

LDF Modes: Finder ~ chain, Compatibility ~ soft

Found 50 compatible libraries

Scanning dependencies…

Dependency Graph

|-- 2.7

|-- 5.13.4

|-- 2.0.0

| |-- 1.0

|-- 2.3.3

|--

| |--

| | |-- 1.0

| |-- 1.0

|-- 2.6.2 #90adb34

|-- #8eb980e

|-- 2.0.4

| |-- 1.0

| |-- 1.0

|--

| |-- 1.0

|-- 1.0.2

|-- 1.3.0

| |-- 1.0.2

|-- 1.0.3

| |-- 1.0

| |-- 1.0.2

|-- #68142af

| |-- 1.0

|-- #968a684

| |-- 1.0

|-- 3.3.2

| |-- 1.0

| |-- 1.0

|-- 1.0

|-- 0.16.2

|-- 1.0

|-- 1.0

Building in release mode

Compiling .pio/build/atmega-all/src/main.ino.cpp.o

Compiling .pio/build/atmega-all/lib45b/PubSubClient_ID89/PubSubClient.cpp.o

Archiving .pio/build/atmega-all/libe10/libArduinoJson_ID64.a

Indexing .pio/build/atmega-all/libe10/libArduinoJson_ID64.a

/Users/balazsadam/Documents/PlatformIO/OpenMQTTGateway-0.9.3-MEGA/main/ZgatewayBT.ino:35:18: fatal error: vector: No such file or directory

compilation terminated.

Compiling .pio/build/atmega-all/lib056/SPI/SPI.cpp.o

*** [.pio/build/atmega-all/src/main.ino.cpp.o] Error 1

========================== [FAILED] Took 4.96 seconds ==========================

Environment Status Duration


rfbridge IGNORED

esp32dev-all IGNORED

esp32dev-rf IGNORED

esp32dev-pilight IGNORED

esp32dev-ir IGNORED

esp32dev-ble IGNORED

esp32-m5stick-ble IGNORED

esp32-m5stack-ble IGNORED

esp32-m5stick-c-ble IGNORED

ttgo-lora32-v1 IGNORED

nodemcuv2-all IGNORED

nodemcuv2-ble IGNORED

nodemcuv2-ir IGNORED

nodemcuv2-rf IGNORED

rf-wifi-gateway IGNORED

nodemcuv2-rf2 IGNORED

nodemcuv2-pilight IGNORED

sonoff-basic IGNORED

sonoff-basic-rfr3 IGNORED

atmega-all FAILED 00:00:04.957

uno-rf IGNORED

uno-fastled IGNORED

==================== 1 failed, 0 succeeded in 00:00:04.957 ====================

What do I do wrong?

Thanks,
Balazs

Hello,

Did you modified the atmega-all environment or is it the stock one?

In platformio.ini I enabled this:
default_envs = atmega-all

[env:atmega-all]
platform = ${com.atmelavr_platform}
board = megaatmega2560
lib_deps =
${com-arduino.lib_deps}
${libraries.irremote}
${libraries.rfm69}
${libraries.rc-switch}
${libraries.newremoteswitch}
${libraries.bme280}
${libraries.bmp180}
${libraries.unifiedsensor}
${libraries.dht}
${libraries.tsl2561}
${libraries.a6lib}
${libraries.ina226}
${libraries.fastled}
build_flags =
${com-arduino.build_flags}
‘-DZgatewayRF=“RF”’
;’-DZgatewayRF=“RF315”’
;’-DZgatewayRF2=“RF2”’
;’-DZgatewayIR=“IR”’
‘-DZgatewayBT=“BT”’
‘-DZactuatorONOFF=“ONOFF”’
;’-DZactuatorFASTLED=“FASTLED”’
;’-DZsensorINA226=“INA226”’
;’-DZsensorHCSR501=“HCSR501”’
;’-DZsensorADC=“ADC”’
;’-DZsensorBH1750=“BH1750”’
;’-DZsensorBME280=“BME280”’
;’-DZsensorTSL2561=“TSL2561”’
;’-DZsensorDHT=“DHT”’
;’-DZgatewayRFM69=“RFM69”’
;’-DZsensorGPIOInput=“GPIOInput”’
;’-DZsensorGPIOKeyCode=“GPIOKeyCode”’
‘-DZmqttDiscovery=“HADiscovery”’
‘-DsimplePublishing=true’
‘-DGateway_Name=“OpenMQTTGateway_ATMEGA_ALL”’

Hello,

Could you try maybe to redownload the code, check that atmega-all is building properly. And if yes, remove the unnecessaries gateways and sensors.

Atmega-all with ZgatewayBT added has an issue with missing vector library:

D:/Users/Florian/Documents/GitHub/OpenMQTTGateway/main/ZgatewayBT.ino:35:18: fatal error: vector: No such file or directory
compilation terminated.
*** [.pio\build\atmega-all\src\main.ino.cpp.o] Error 1