Hi all,
I’ve not had much luck with my post in the mysensors forum, so I thought I’d try here as well before I start creating GH issues.
Basically, I used platformio (cli) with an Arduino Nano to build this sketch using these instructions with minimal issues – one private function I had to move around (known issue) but other than that it worked like a charm.
Now I want to make a version of the same sketch using an atmega328p on a breadboard. I’m hoping it should work as it’s the same MCU.
However, I’m running into a slew of errors, mostly “not declared in this scope.” My INO file is unchanged.
In file included from .piolibdeps/MySensors_ID548/MySensors.h:257:0,
from rf24_temp/src/tempsensor.ino:38:
.piolibdeps/MySensors_ID548/core/MyTransport.cpp: In function 'void stInitTransition()':
.piolibdeps/MySensors_ID548/core/MyTransport.cpp:80:45: error: 'hwReadConfigBlock' was not declared in this scope
sizeof(transportConfig_t));
^
.piolibdeps/MySensors_ID548/core/MyTransport.cpp: In function 'void stInitUpdate()':
.piolibdeps/MySensors_ID548/core/MyTransport.cpp:108:61: error: 'hwWriteConfig' was not declared in this scope
hwWriteConfig(EEPROM_NODE_ID_ADDRESS, (uint8_t)MY_NODE_ID);
^
.piolibdeps/MySensors_ID548/core/MyTransport.cpp: In function 'void stUplinkUpdate()':
.piolibdeps/MySensors_ID548/core/MyTransport.cpp:232:43: error: 'hwMillis' was not declared in this scope
_transportSM.lastUplinkCheck = hwMillis();
^
.piolibdeps/MySensors_ID548/core/MyTransport.cpp: In function 'void transportSwitchSM(transportState_t&)':
.piolibdeps/MySensors_ID548/core/MyTransport.cpp:342:37: error: 'hwMillis' was not declared in this scope
_transportSM.stateEnter = hwMillis(); // save time
^
.piolibdeps/MySensors_ID548/core/MyTransport.cpp: In function 'uint32_t transportTimeInState()':
.piolibdeps/MySensors_ID548/core/MyTransport.cpp:347:18: error: 'hwMillis' was not declared in this scope
return hwMillis() - _transportSM.stateEnter;
So far I’ve found a few useful links:
- Won't compile a library that compiles without issue with Arduino IDE · Issue #331 · platformio/platformio-core · GitHub
- Unable to use Souliss library · Issue #298 · platformio/platformio-core · GitHub
- Platformio and MySensors development branch | MySensors Forum
What I’ve tried (with a pio run target=clean
before each attempted build):
- Adding
#include <Arduino.h>
or#include "Arduino.h"
to the top of my sketch- nothing changes
- Specifying
build_flags = -I/path/to/MySensors
- nothing changes
- Specifying
lib_ignore = MySensors
- nothing changes
My platformio.ini:
[env:328p8m]
platform = atmelavr
board = 328p8m
framework = arduino
upload_protocol = usbasp
lib_deps =
MySensors
DallasTemperature
Any ideas? Again, this builds fine with the same code but using a nano as the target platform, just won’t build for the atmega328p for some reason. Thanks for any help you can provide!
- platformio (cli) 3.4.1
- mysensors (lib #548) 2.1.1
- MacOS 10.13.1