-
Notifications
You must be signed in to change notification settings - Fork 13.3k
Add PlatformIO as alternative option to use ESP8266 core for Arduino #1197
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Hi @igrr, Would be thankful to place some information about [PlatformIO[(http://platformio.org) as alternative cross-platform builder to use ESP8266 core for Arduino on the popular host OS: Mac OS X, Windows, Linux 32/64, Linux ARM (like Raspberry Pi, BeagleBone, CubieBoard). Don't hesitate to modify this PR. Thanks in advance!
Very interesting, how does it work? I tried it with my http://github.com/ohaut/photon project, and I almost got it to work, but it fails to find some floating point functions: xtensa-lx106-elf-g++ -o .pioenvs/esp12e/firmware.elf -nostdlib -Wl,--no-check-sections -u call_user_start -Wl,-static -Wl,--gc-sections -Wl,-wrap,system_restart_local -Wl,-wrap,register_chipv6_phy -Wl,-T /Users/ajo/.platformio/packages/ldscripts/esp8266.flash.4m.ld .pioenvs/esp12e/src/tmp_ino_to.o -L/Users/ajo/.platformio/packages/framework-arduinoespressif/tools/sdk/lib -L.pioenvs/esp12e -Wl,--start-group -lsmartconfig -lpp -lmain -lwpa -llwip -lnet80211 -lwps -lcrypto -lphy -lhal -laxtls -lgcc -lm .pioenvs/esp12e/libFrameworkArduinoVariant.a .pioenvs/esp12e/libFrameworkArduino.a .pioenvs/esp12e/libESP8266WiFi.a .pioenvs/esp12e/libESP8266mDNS.a .pioenvs/esp12e/libArduinoOTA.a .pioenvs/esp12e/libPubSubClient.a .pioenvs/esp12e/libTicker.a .pioenvs/esp12e/libESP8266WebServer.a -Wl,--end-group How does it work?, do you grab the esp8266/Arduino SDK libraries? |
@mangelajo give me a few minutes I'll switch to @igrr toolchain for Mac OS X. I'll report here. |
Ok, let's play with your project. cd /tmp
wget https://github.com/ohaut/photon/archive/master.zip
unzip master.zip
# let's rename folder and init project here
# you can left this photon dir and override `src` dir. See docs for `platformio.ini/src_dir`
mv photon-master/firmware/photon photon-master/firmware/src
# update PlatformIO packages (I've just updated xtensa toolchain)
platformio update
# install dependent libary
# http://platformio.org/#!/lib/show/89/PubSubClient
platformio lib install 89
# init project
platformio init -d photon-master/firmware -b esp12e
# process
platformio run -d photon-master/firmware/
# upload
platformio run -d photon-master/firmware/ -t upload If you want to upload using OTA then you need one of Use development version @platformio 2.5.1.dev0 where OTA is implemented by default. Just specify Use stable PlatformIO 2.5.0 and create from os.path import join
from SCons.Script import DefaultEnvironment
env = DefaultEnvironment()
env.Replace(
UPLOADEROTA=join("$PIOPACKAGES_DIR",
"framework-arduinoespressif", "tools", "espota.py"),
UPLOADCMD='$UPLOADEROTA --debug --progress -i $UPLOAD_PORT -p 8266 -f $SOURCE'
) Specify [env:esp12e]
platform = espressif
framework = arduino
board = esp12e
upload_port = 127.0.0.1
extra_script = platformio_extra_script.py @mangelajo does it work for you? |
wow @ivankravets , thanks for the comprehensive details. With @igrr toolchain it does compile. I tried the dev version and it does upload too. By "how does it work", I was meaning, if platformio does pull the Arduino sdk here in esp8266/Arduino with it's libs, etc, or the stable/stagging version published for the arduino dev env. (just to know which version of the libs does use, how to use master from esp8266/Arduino etc...). I personally prefer cmdline over arduino dev env... :) |
👍 |
@platformio uses stable software. It means that current version of Arduino framework for Espressif is dated Nov 30, 2015. To check version of installed software by PlatformIO Package Manager please go to PlatformIO doesn't depend on Arduino IDE, make, cmake or system package manager. It has own super-fast code builder, built-in package and library managers and CDN Cloud Storage for pre-compiled tools, toolchains, frameworks. It allows PlatformIO to have THE SAME behaviour on the popular host OS (including ARM-based card-sized PC). PlatformIO is totally isolated ecosystem. The only one requirement is Python Interpreter, because PlatformIO is written in Python. I welcome you to read our docs What is PlatformIO? How does it work? |
Add PlatformIO as alternative option to use ESP8266 core for Arduino
Thanks a lot @igrr! 👍 |
@ivankravets /Users/ajo/.platformio/packages/toolchain-xtensa/bin/../lib/gcc/xtensa-lx106-elf/4.8.2/../../../../xtensa-lx106-elf/bin/ld: .pioenvs/esp12e/firmware.elf section I guess I shall report an issue to platformio, Can I see where the ldscripts are?, I'd like to review latest changes to the esp platform Cheers. |
Hi @mangelajo, Do you use the latest PlatformIO 2.6? Also, did you update all packages via The ld scripts are located in |
@mangelajo, Please report this issue to @platformio repository. Thanks. |
@ivankravets, thanks. platformio/platformio-core#377 I did sudo python setup.py install from platformio master, and on the first run it automatically updated the ldscripts. I mean, not where they are stored locally, but does platformio have any git repository for it where we can track changes or submit fixes? |
See previous version http://sourceforge.net/projects/platformio-storage/files/packages/ldscripts-14.tar.gz/download To check version of installed packages use |
Hi @igrr,
Would be thankful to place some information about PlatformIO as alternative cross-platform builder to use ESP8266 core for Arduino on the popular host OS: Mac OS X, Windows, Linux 32/64, Linux ARM (like Raspberry Pi, BeagleBone, CubieBoard).
Don't hesitate to modify this PR.
Thanks in advance!