PIO Core: build offline (w/o Internet connection)


#1

Maybe I’m not the first one asking this. I have seen similar questions here but no real answer.

I know PIO Core checks every time you run it for updates or whatever. That’s cool if you have Internet connection 'cause you are always up to date.

But sometimes you don’t. Because you are on a roof top or you are “out in the field”, connected to the device you are trying to flash via WIFI and my laptop does not have two wifi interfaces… For several reasons, I would like to be able to build and flash via OTA a device when I don’t have Internet connection.

And I don’t need it because I’m just bug fixing a given code base, I don’t want to update libraries, frameworks, platforms… at that moment. I just want to change a setting, build and flash.

So it would be cool to have a way to bypass the ping to your server and trust what you have locally.


Error: you are not connected to internet
#2

Do you use the latest version of PIO Core? It should be fixed in 3.5.0 version.


#3

I’ve been investigating further. Take this project:

[env:d1_mini]
platform = https://github.com/platformio/platform-espressif8266.git#v1.5.0
board = d1_mini
framework = arduino
build_flags = -g -DMQTT_MAX_PACKET_SIZE=400 ${env.ESPURNA_FLAGS}
lib_ignore =
lib_deps =
    Brzo I2C
    https://github.com/krosk93/espsoftwareserial#a770677
    https://github.com/marvinroger/async-mqtt-client#v0.8.1
extra_scripts = extra_scripts.py

I build the project with internet connection, then I disconnect from the Internet and build it again. It fails with “Error: You are not connected to the Internet. If you build a project first time, we need Internet connection to install all dependencies and toolchain.”.
But then if I remove the async-mqtt-client dependency it works!

Trying with a bigger project (ESPurna) with several dependencies in the lib_deps it works if I comment out the async-mqtt-client and the fauxmoESP libraries:

#    https://github.com/marvinroger/async-mqtt-client#v0.8.1
#    https://bitbucket.org/xoseperez/nofuss.git#0.2.5

If I do so it compiles successfully since those libraries are actually on .piolibdeps. If I enable them it fails…


#4

Thanks! I significantly improved a work in off-line mode in the latest development build. Please run pio upgrade --dev. Does it work now good in off-line mode?


#5

Great!

Sorry for the late reply. Just tested 3.5.1a7 and works a charm in offline. No changes to the project configuration.

Thank you very much!