Windows upload clean project fails

I have been running platformio on my raspberry for quite some time, with very few obstacles. Now I moved to windows and it seems problematic.

I am running 3.5.3b3 in VS Code on Win10, the project builds fine, but the upload fails (see below). Does anyone have hints what the problem might be?

> Executing task: C:\Users\njbuc\.platformio\penv\Scripts\platformio.exe run --target upload <

[05/12/18 21:13:34] Processing sleepypi (platform: atmelavr; board: sleepypi; framework: arduino)
---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
Verbose mode can be enabled via `-v, --verbose` option
PLATFORM: Atmel AVR > SpellFoundry Sleepy Pi 2
SYSTEM: ATMEGA328P 8MHz 2KB RAM (30KB Flash)
Library Dependency Finder -> http://bit.ly/configure-pio-ldf
LDF MODES: FINDER(chain) COMPATIBILITY(light)
Collected 33 compatible libraries
Scanning dependencies...
No dependencies
Configuring upload protocol...
AVAILABLE: arduino
CURRENT: upload_protocol = arduino
Looking for upload port...
Auto-detected: COM3
*** [upload] /sys/class/gpio/export: No such file or directory
=================================================================================================== [ERROR] Took 3.77 seconds ===================================================================================================
The terminal process terminated with exit code: 1

Terminal will be reused by tasks, press any key to close it.

The platform.ini looks like this:

[env:sleepypi]
platform = atmelavr
board = sleepypi
framework = arduino

Can you edit your question to include your exact platformio.ini?

Its there now. Thanks for looking :slight_smile:

As far as I understand it, this is a shield for the Raspberry Pi. Your wiring is exactly the same as here? What USB-UART adapter do you use? If the Arduino Bootloader is on it, you may just treat it as a normal Arduino Uno board over a Serial COM, i.e., use board = uno.

1 Like

Hi buddy, thanks. I changed the board to “fio” and everything went smoothly, code uploads and works flawlessly. Not sure where the bug is though, can you direct towards a meaningful bug-report?

Glad that this workaround works. However, be aware that those two targets are not exactly identical, according to the board.json file they have different fuses set and different Macros set (fio.json vs sleepypi.json):

Yes, this is most definitely a bug. The problem is that PIO assumes that if you want to upload to the sleepy-pi, you are running on the Raspberry Pi. The code that triggers this behaviour is here: platform-atmelavr/main.py at develop · platformio/platform-atmelavr · GitHub

If it sees ‘sleepypi’ it will do _rpi_sysgpio("/sys/class/gpio/export", pin_num). This should not happen if your platform is not the Raspberry Pi.

On one hand you could say that this target should always expect you to run on the sleepy-pi and use an equivalent board when doing outside programming, on the other hand PIO might recognize that itself. You can file an issue on GitHub - platformio/platform-atmelavr: Atmel AVR: development platform for PlatformIO.