Hi all,
I am new to MySensors, and I have only limited experience with platformio and Arduino programming in general.
I was able to get the temperature sensor built with a Nano and an NRF24L01+ I had laying around -- worked great! As usual, I used platformio to manage the dependencies and the build (I don't care much for the Arduino editor or library and board manager).
Now I want to make a version of the same sketch using an atmega328p on a breadboard. I figure 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 identical to the one from the temp sensor tutorial.
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:
What I've tried (with a pio run target=clean
before each attempted build):
- Adding
#include <Arduino.h>
to the top of my sketch (nothing changes)
- Specifying
build_flags = -I/path/to/MySensors
- Specifying
lib_ignore = MySensors
I'm using:
- MacOS 10.13.1
- platformio 3.4.1
- MySensors 2.1.1
My platformio.ini
:
[env:328p8m]
platform = atmelavr
board = 328p8m
framework = arduino
upload_protocol = usbasp
lib_deps =
MySensors
DallasTemperature
build_flags = -I../MySensors
lib_ignore = MySensors
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.
cc @gerritv @Iyad-Nahas