paperdink / PaperdInk-Library

Arduino Library to interact with Paperd.Ink
MIT License
21 stars 8 forks source link

Quotes example does not compile #13

Closed cimm closed 1 year ago

cimm commented 1 year ago

I freshly installed Arduino 1.8.19 both from the flatpak repositories as directly from the Arduino website on Fedora 36 as on macOS Ventura. I added the additional board URL as explained in the documentation and choose the ESP32 Dev Module. This works fine.

When adding the Paperdink library the Arduino IDE asks if it should install all dependencies, which I accepted. During the library install I get an error. The output is from macOS but it's the same on Fedora.

no protocol:
java.lang.RuntimeException: java.net.MalformedURLException: no protocol:
at
cc.arduino.contributions.libraries.ui.LibraryManagerUI.lambda$onInstallPressed$4(LibraryManagerUI.java:250)
    at java.lang.Thread.run(Thread.java:748)
Caused by: java.net.MalformedURLException: no protocol:
    at java.net.URL.<init>(URL.java:611)
    at java.net.URL.<init>(URL.java:508)
    at java.net.URL.<init>(URL.java:457)
    at
cc.arduino.contributions.DownloadableContributionsDownloader.download(DownloadableContributionsDownloader.java:60)
    at
cc.arduino.contributions.DownloadableContributionsDownloader.download(DownloadableContributionsDownloader.java:56)
    at
cc.arduino.contributions.libraries.LibraryInstaller.performInstall(LibraryInstaller.java:148)
    at
cc.arduino.contributions.libraries.LibraryInstaller.install(LibraryInstaller.java:118)
    at
cc.arduino.contributions.libraries.ui.LibraryManagerUI.lambda$onInstallPressed$4(LibraryManagerUI.java:240)
    ... 1 more

Arduino: 1.8.19 (Mac OS X), Board: "ESP32 Dev Module, Disabled, Default 4MB with spiffs (1.2MB APP/1.5MB SPIFFS), 240MHz (WiFi/BT), QIO, 80MHz, 4MB (32Mb), 921600, None"

I am not sure if this is an indication something went wrong or just some debugging output. I restart the Arduino software to be sure and open the "Quotes" example because this seems like the simplest example and I just want to test if everything works. When I compile the sketch I get:

Multiple libraries were found for "WiFi.h"
Used: /Users/xxx/Library/Arduino15/packages/esp32/hardware/esp32/1.0.6/libraries/WiFi
Not used: /private/var/folders/wj/7dr02y8s1vx92scj6y7tknww0000gn/T/AppTranslocation/F313BE5E-D617-4A1B-9C46-1E8E29FCD9A9/d/Arduino.app/Contents/Java/libraries/WiFi
In file included from /Users/xxx/Documents/Arduino/libraries/Paperdink/src/ui/crypto/crypto.h:5:0,
   from /Users/xxx/Documents/Arduino/libraries/Paperdink/src/Paperdink.h:17,
    from /var/folders/wj/7dr02y8s1vx92scj6y7tknww0000gn/T/arduino_modified_sketch_72738/Quotes.ino:27:/Users/xxx/Documents/Arduino/libraries/Paperdink/src/ui/crypto/../../paperdink_common.h:5:25: fatal error: ArduinoJson.h: No such file or directorycompilation terminated.
exit status 1
Error compiling for board ESP32 Dev Module.

Note that it fails on the crypto.h header while I am trying to compile the "Quotes" example. I am not sure why the Paperdink.h header needs to include unrelated examples?

Maybe related, not sure, but in Arduino 2.0.3 I can find the Paperdink library but the install button does nothing. No output, nothing, even if I install the libraries dependencies manually first.

Any idea what I am doing wrong? Thank you!

haarts commented 1 year ago

I can help with your Arduino 2.0.3 issue. I just ran into that too and fixed it. See: #11

haarts commented 1 year ago

I've just tried it in the 2.x IDE and the quotes example works. Albeit with the fixed library as described in #11 and the associated pull request.

cimm commented 1 year ago

Thank you @haarts. I manually installed the Paperdink Arduino library with your fix from pull request #11 and it does indeed compile in the Arduino 2.0.3 IDE and I can write it to the Paperdink device. Success! Let's hope the pull request gets merged soon.

It does, as far as I can test, not work for the Arduino 1.8,19 IDE but I will test again once #11 gets merged.

cimm commented 1 year ago

Pull request #11 has been merged and a new version of the Paperdink library, version 0.0.5, has been released.

I tested the Quotes example with the new version of the library on both Arduino 1.8.19 and 2.0.3 and the example compiles correctly on both versions. The "no protocol" error during library install and "multiple libraries" error during compile have both been resolved with the fix from #11.

This issue has been resolved.