w4ff3l
June 26, 2019, 9:38am
1
I am trying to develop for a Raspberrypi 3b. Since it doesn’t work for cross-compilation I followed this link tempSol . After running the remote agent on the PI, I use “pio remote run --force-remote” to run the project from my laptop. PIO now tells me I need to put my source files int /src folder. Looking up the directories, my main.cpp was uploaded into /include instead of /src.
I am kind of new to this… How do i tell PIO to keep my project structure for remote compiling?
Thanks for help in advance!
How did you check that? Could you provide some details? Does it work without --force-remote
flag?
w4ff3l
July 25, 2019, 11:39am
3
Srry for taking so long to answer. I cannot just run “remote run” since it tells me PIO doesnt support cross-compilation for WiringPi Framework. However if i run “remote run --force-remote” i get “Error: Nothing to build. Please put your source code files to ‘/home/pi/.platformio/remote/projects/my_project-blabla/src’ folder”. Now if i check the remote folder on my RPi everything was uploaded into ‘/home/pi/.platformio/remote/projects/my_project-blabla/include’ instead of the src folder.
lakid
August 3, 2019, 5:55am
4
Yes, I’m seeing the same behavior with the esp8266 environment as well, files are dropped into /inc not /src. I’ve got an issue open here
opened 11:10AM - 29 Jul 19 UTC
closed 09:38PM - 12 Aug 19 UTC
bug
What kind of issue is this?
- [x ] **PlatformIO Core**.
If you’ve found … a bug, please provide an information below.
*You can erase any parts of this template not applicable to your Issue.*
------------------------------------------------------------------
### Configuration
**Operating system**: MacOS Mojave/RasberryPi Rasbian Linux pio_remote 4.19.57+ #1244 Thu Jul 4 18:42:50 BST 2019 armv6l GNU/Linux
**PlatformIO Version** (`platformio --version`): PlatformIO, version 4.0.0 (both ends)
``
### Description of problem
`pio remote run -e d1_mini_pro -t upload -v --force-remote`
builds on remote RPi but puts source code into /include, not /src which leads to
```
/home/lakidd/.platformio/packages/toolchain-xtensa/bin/../lib/gcc/xtensa-lx106-elf/4.8.2/../../../../xtensa-lx106-elf/bin/ld: .pio/build/d1_mini_pro/libFrameworkArduino.a(core_esp8266_main.cpp.o):(.text._ZL12loop_wrapperv+0x4): undefined reference to `setup'
/home/lakidd/.platformio/packages/toolchain-xtensa/bin/../lib/gcc/xtensa-lx106-elf/4.8.2/../../../../xtensa-lx106-elf/bin/ld: .pio/build/d1_mini_pro/libFrameworkArduino.a(core_esp8266_main.cpp.o):(.text._ZL12loop_wrapperv+0x8): undefined reference to `loop'
/home/lakidd/.platformio/packages/toolchain-xtensa/bin/../lib/gcc/xtensa-lx106-elf/4.8.2/../../../../xtensa-lx106-elf/bin/ld: .pio/build/d1_mini_pro/libFrameworkArduino.a(core_esp8266_main.cpp.o): in function `loop_wrapper()':
core_esp8266_main.cpp:(.text._ZL12loop_wrapperv+0x21): undefined reference to `setup'
/home/lakidd/.platformio/packages/toolchain-xtensa/bin/../lib/gcc/xtensa-lx106-elf/4.8.2/../../../../xtensa-lx106-elf/bin/ld: core_esp8266_main.cpp:(.text._ZL12loop_wrapperv+0x2d): undefined reference to `loop'
collect2: error: ld returned 1 exit status
*** [.pio/build/d1_mini_pro/firmware.elf] Error 1
```
#### Steps to Reproduce
1.`pio remote run -e d1_mini_pro -t upload -v --force-remote`
2. check directory on remote machine (see below)
If i create a /src and move the cpp file into it, it builds fine on the RPi with a
`platformio run -t upload`
### Actual Results
See above, linking fails
### Expected Results
Linking should succeed
### If problems with PlatformIO Build System:
**The content of `platformio.ini`:**
```ini
[env:atmega328pb]
platform = atmelavr
board_build.mcu = atmega328pb
;board = elektor_uno_r4
board = ATmega328PB
framework = arduino
lib_extra_dirs= /Users/lakidd/Documents/Arduino/libraries
upload_protocol= usbasp
upload_flags = -Pusb -u -Uhfuse:w:0xDE:m -Uefuse:w:0xF5:m -Ulfuse:w:0xE2:m
board_build.f_cpu = 8000000L
targets = program
[env:d1_mini_pro]
platform = espressif8266
board = d1_mini_pro
framework = arduino
upload_port = /dev/ttyUSB0
```
**Source file to reproduce issue:**
```cpp
#include <Arduino.h>
/*
Blink
Turns an LED on for one second, then off for one second, repeatedly.
Most Arduinos have an on-board LED you can control. On the UNO, MEGA and ZERO
it is attached to digital pin 13, on MKR1000 on pin 6. LED_BUILTIN is set to
the correct LED pin independent of which board is used.
If you want to know what pin the on-board LED is connected to on your Arduino
model, check the Technical Specs of your board at:
https://www.arduino.cc/en/Main/Products
modified 8 May 2014
by Scott Fitzgerald
modified 2 Sep 2016
by Arturo Guadalupi
modified 8 Sep 2016
by Colby Newman
This example code is in the public domain.
http://www.arduino.cc/en/Tutorial/Blink
*/
void setup(void);
void loop(void);
// the setup function runs once when you press reset or power the board
void setup() {
// initialize digital pin LED_BUILTIN as an output.
pinMode(13, OUTPUT);
Serial.begin(115200);
}
// the loop function runs over and over again forever
void loop() {
digitalWrite(13, HIGH); // turn the LED on (HIGH is the voltage level)
Serial.println("BLINK");
delay(1000); // wait for a second
digitalWrite(13, LOW);
Serial.println("BLONK");// turn the LED off by making the voltage LOW
delay(1000); // wait for a second
}
```
### Additional info
```
lakidd@pio_remote:~/.platformio/remote/projects/Blink_Blonk-c64fc75078561b9c142d275201c2b07d7228527c $ ls
include lib platformio.ini
lakidd@pio_remote:~/.platformio/remote/projects/Blink_Blonk-c64fc75078561b9c142d275201c2b07d7228527c $ ls include/
README main.cpp
lakidd@pio_remote:~/.platformio/remote/projects/Blink_Blonk-c64fc75078561b9c142d275201c2b07d7228527c $ cat include/main.cpp
#include <Arduino.h>
/*
Blink
Turns an LED on for one second, then off for one second, repeatedly.
Most Arduinos have an on-board LED you can control. On the UNO, MEGA and ZERO
it is attached to digital pin 13, on MKR1000 on pin 6. LED_BUILTIN is set to
the correct LED pin independent of which board is used.
If you want to know what pin the on-board LED is connected to on your Arduino
model, check the Technical Specs of your board at:
https://www.arduino.cc/en/Main/Products
modified 8 May 2014
by Scott Fitzgerald
modified 2 Sep 2016
by Arturo Guadalupi
modified 8 Sep 2016
by Colby Newman
This example code is in the public domain.
http://www.arduino.cc/en/Tutorial/Blink
*/
void setup(void);
void loop(void);
// the setup function runs once when you press reset or power the board
void setup() {
// initialize digital pin LED_BUILTIN as an output.
pinMode(13, OUTPUT);
Serial.begin(115200);
}
// the loop function runs over and over again forever
void loop() {
digitalWrite(13, HIGH); // turn the LED on (HIGH is the voltage level)
Serial.println("BLINK");
delay(1000); // wait for a second
digitalWrite(13, LOW);
Serial.println("BLONK");// turn the LED off by making the voltage LOW
delay(1000); // wait for a second
}
```
The issue was fixed. Please re-run pio update
.