Skip to content
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

ESP8266 problem #152

Closed
Lightwell-bg opened this issue Apr 22, 2020 · 23 comments
Closed

ESP8266 problem #152

Lightwell-bg opened this issue Apr 22, 2020 · 23 comments

Comments

@Lightwell-bg
Copy link

RTClib@1.4.2 version doesn't work with ESP8266

fatal error: avr/interrupt.h: No such file or directory

@edgar-bonet
Copy link
Contributor

Please, provide the detailed steps to reproduce the error.

There are nine example sketches bundled with the library. All of them have been successfully compiled for ESP8266 by the automated test script.

@Lightwell-bg
Copy link
Author

Before update to 1.4.2 all was ok.
After I cant compile sketch (fatal error: avr/interrupt.h: No such file or directory in USI_TWI_Master.cpp) .
I use PLATFORMIO.

@edgar-bonet
Copy link
Contributor

Try removing the last line from RTClib/library.properties:

diff --git a/library.properties b/library.properties
index 44a50c4..97b70be 100644
--- a/library.properties
+++ b/library.properties
@@ -7,4 +7,3 @@ paragraph=A fork of Jeelab's fantastic RTC library
 category=Timing
 url=https://github.com/adafruit/RTClib
 architectures=*
-depends=TinyWireM, OneWire

Alternatively, try this version: it's just 1.4.2 that line removed.

Tell us if it fixes the issue for you. If that's the case, I'll submit a pull request.

@ladyada
Copy link
Member

ladyada commented Apr 22, 2020

@ivankravets hihi - taggin you to see another example that platform-unique dependencies cause compilation issues. tinywirem is referenced here:

#ifdef __AVR_ATtiny85__

@ivankravets
Copy link

Hi @ladyada, thanks for tagging me. Yes, yes, this is a known issue. There are a few solutions:

  1. Using library.json and set build.libLDFMode to chain+. However, I remember that you would like to have only library.properties in a repository. See solution 2
  2. Update LDF mode per PlatformIO project as described here https://docs.platformio.org/en/latest/projectconf/section_env_library.html#lib-ldf-mode

We have some ideas about how to improve our Library Dependency Finder but it will need some efforts. The current LDF behavior is to follow your declarations. It allows PlatformIO Core to build project crazy fast.

@Lightwell-bg
Copy link
Author

Try removing the last line from RTClib/library.properties:

diff --git a/library.properties b/library.properties
index 44a50c4..97b70be 100644
--- a/library.properties
+++ b/library.properties
@@ -7,4 +7,3 @@ paragraph=A fork of Jeelab's fantastic RTC library
 category=Timing
 url=https://github.com/adafruit/RTClib
 architectures=*
-depends=TinyWireM, OneWire

Alternatively, try this version: it's just 1.4.2 that line removed.

Tell us if it fixes the issue for you. If that's the case, I'll submit a pull request.

It doesnt work

@ivankravets
Copy link

@Lightwell-bg does it work if you add to platformio.ini

[env]
lib_ldf_mode = chain+

@Lightwell-bg
Copy link
Author

lib_ldf_mode = chain+

Sorry, and it doesnt work
^
.pio\libdeps\d1_mini\TinyWireM_ID797\USI_TWI_Master.cpp:22:27: fatal error: avr/interrupt.h: No such file or directory
#include <avr/interrupt.h>

@ivankravets
Copy link

@valeros, please help

@valeros
Copy link

valeros commented Apr 22, 2020

Hi @Lightwell-bg ! The error is caused by a misleading dependency specified in library.properties (TinyWireM is not supposed to work with esp8266). The best solution is to add the following lines to your platformio.ini:

[env:myenv]
framework = arduino
platform = espressif8266
board = ...

# explicitly ignore TinyWireM
lib_ignore =
    TinyWireM
# Resolve hidden dependencies under ifdef
lib_ldf_mode = deep+

@Lightwell-bg
Copy link
Author

Hi @valeros
Thank you, it's work.

@ladyada ladyada closed this as completed Apr 23, 2020
@rgl
Copy link

rgl commented Jul 19, 2020

Isn't there a better way to solve this issue?

Using lib_ignore in our platform.ini file feels dirty.

@ivankravets
Copy link

Hey @ladyada ,

Would you like to have library.json which resolves these conflicts? We will explain in manifest when to use particular dependencies. You don't need to maintain it later, just increment "version" field (the same what you do for library.properties)

@ladyada
Copy link
Member

ladyada commented Jul 20, 2020

hihi @ivankravets - as other library developers such as @PaulStoffregen have mentioned, folks usually forget or neglect to update both on the libs they maintain. adafruit/DHT-sensor-library#118 (comment)

as more libraries add dependencies, some of which are for specific platforms, we recommend only compiling code that is referenced/included in the projects.

@rgl
Copy link

rgl commented Jul 20, 2020

@ivankravets, If I understood correctly, we cannot express a conditional library dependency using library.properties but we can in a library.json file? If so, can you provide an example of this?

Maybe we can automatically generate a library.properties from the library.json file? that way we only need to maintain one of them?

@PaulStoffregen

This comment has been minimized.

@PaulStoffregen

This comment has been minimized.

@ivankravets

This comment has been minimized.

@ivankravets

This comment has been minimized.

@PaulStoffregen

This comment has been minimized.

@ivankravets

This comment has been minimized.

@drak7

This comment has been minimized.

@adafruit adafruit locked as too heated and limited conversation to collaborators Jul 27, 2020
@tannewt
Copy link
Member

tannewt commented Jul 27, 2020

FYI, I've hidden the heated conversation as off-topic. It's not helpful.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

9 participants