Skip to content

Allow listing other boards in boards manager #3055

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

Merged
merged 12 commits into from
May 4, 2015
Merged

Allow listing other boards in boards manager #3055

merged 12 commits into from
May 4, 2015

Conversation

ffissore
Copy link
Contributor

This PR is a work in progress. Once completed, the IDE built by @ArduinoBot will be able to download additional package_SOMETHING_index.json files and list their contents in Boards Manager

Additional info on dev mailing list: https://groups.google.com/a/arduino.cc/d/msg/developers/w2tOTjh6F5I/Y3Eexp4qeb4J

@ffissore
Copy link
Contributor Author

This first commit adds support for additional package_SOMETHING_index.json files, found at the same location of package_index.json

@ffissore
Copy link
Contributor Author

With the last build, you can:

  1. close the IDE
  2. edit preferences.txt file
  3. add an entry boardsmanager.additional.urls=http://someurl...
  4. reopen the IDE and open boards manager
    and see your custom board(s) listed

@q2dg
Copy link

q2dg commented Apr 30, 2015

The final dev info should be place in wiki, shouldn't it?

@toddtreece
Copy link

@ffissore HTTP custom package index files work great for me on OS X 10.10.3, but HTTPS fails with this error:

 Error downloading https://apt.adafruit.com/proxy_files/package_adafruit_index.json
java.lang.RuntimeException: java.lang.Exception: Error downloading https://apt.adafruit.com/proxy_files/package_adafruit_index.json
    at cc.arduino.contributions.packages.ui.ContributionManagerUI$3.run(ContributionManagerUI.java:155)
    at java.lang.Thread.run(Thread.java:745)
Caused by: java.lang.Exception: Error downloading https://apt.adafruit.com/proxy_files/package_adafruit_index.json
    at cc.arduino.contributions.packages.DownloadableContributionsDownloader.download(DownloadableContributionsDownloader.java:99)
    at cc.arduino.contributions.packages.ContributionInstaller.downloadIndex(ContributionInstaller.java:276)
    at cc.arduino.contributions.packages.ContributionInstaller.downloadIndexAndSignature(ContributionInstaller.java:252)
    at cc.arduino.contributions.packages.ContributionInstaller.updateIndex(ContributionInstaller.java:243)
    at cc.arduino.contributions.packages.ui.ContributionManagerUI$3.run(ContributionManagerUI.java:151)
    ... 1 more
Caused by: javax.net.ssl.SSLHandshakeException: Received fatal alert: handshake_failure
    at sun.security.ssl.Alerts.getSSLException(Alerts.java:192)
    at sun.security.ssl.Alerts.getSSLException(Alerts.java:154)
    at sun.security.ssl.SSLSocketImpl.recvAlert(SSLSocketImpl.java:2011)
    at sun.security.ssl.SSLSocketImpl.readRecord(SSLSocketImpl.java:1113)
    at sun.security.ssl.SSLSocketImpl.performInitialHandshake(SSLSocketImpl.java:1363)
    at sun.security.ssl.SSLSocketImpl.startHandshake(SSLSocketImpl.java:1391)
    at sun.security.ssl.SSLSocketImpl.startHandshake(SSLSocketImpl.java:1375)
    at sun.net.www.protocol.https.HttpsClient.afterConnect(HttpsClient.java:563)
    at sun.net.www.protocol.https.AbstractDelegateHttpsURLConnection.connect(AbstractDelegateHttpsURLConnection.java:185)
    at sun.net.www.protocol.https.HttpsURLConnectionImpl.connect(HttpsURLConnectionImpl.java:153)
    at cc.arduino.utils.network.FileDownloader.download(FileDownloader.java:158)
    at cc.arduino.contributions.packages.DownloadableContributionsDownloader.download(DownloadableContributionsDownloader.java:97)
    ... 5 more

The server it's being hosted on doesn't seem to have any SSL issues:
screen shot 2015-04-30 at 1 35 15 pm

I'm using this file to test, but we can just point people to HTTP if you don't plan to support HTTPS right now: https://apt.adafruit.com/proxy_files/package_adafruit_index.json

@ffissore
Copy link
Contributor Author

@q2dg of course, once merged. Would you like to start working on it?

@ffissore
Copy link
Contributor Author

@toddtreece ahh ssl stuff, I guess it's my fault. I'll fix it this Monday (vacation weekend)

@ffissore
Copy link
Contributor Author

@toddtreece I see that url works also with plain http. Can you use it to test the rest?

@ffissore
Copy link
Contributor Author

ffissore commented May 4, 2015

@toddtreece I dug into that error and I'm sorry to say it's a cipher suite issue: your server is requesting an encryption strength that is subject to US encryption algorithms export limitations.
The standard JVM (the one we bundle with Windows and Mac) misses some encryption algorithms.
Indeed, scrolling down to "handshake simulation" section, you'll see that JVM 6, 7 and 8 can't connect.

Three fixes available:

  1. you can manually download and install Java Cryptography Extension (JCE) Unlimited Strength Jurisdiction Policy Files
    We really can't require that: it will make the installation flow impossible.

  2. you can change your webserver configuration so that it supports weaker algorithms too. I can't really ask you that though.

  3. you can provide a plain http url: this one is the easiest as it already works

@ffissore
Copy link
Contributor Author

ffissore commented May 4, 2015

With 71106ed it's now possible to specify additional urls from File > Preferences. They have to be comma separated

@toddtreece
Copy link

@ffissore good catch. i'll see if i can configure nginx to work with java without exposing the server to attacks, but HTTP will work fine for now.

The File > Preferences addition works great for me on OS X 10.10.3, but the IDE is reporting this for the main Arduino package index: http://downloads.arduino.cc/packages/package_index.json file signature verification failed. File ignored

@ffissore
Copy link
Contributor Author

ffissore commented May 4, 2015

Have you disabled your proxy? I can't think of anything else atm

@toddtreece
Copy link

@ffissore that was the issue. thanks. everything is looking good here on OS X.

…ere preventing Boards Manager from working on Windows
ffissore added a commit that referenced this pull request May 4, 2015
Allow listing other boards in boards manager
@ffissore ffissore merged commit 87fb45c into arduino:master May 4, 2015
@ffissore ffissore deleted the other-packages branch May 4, 2015 14:55
@Lauszus
Copy link
Contributor

Lauszus commented May 4, 2015

Thanks for working on this @ffissore!

I just tried it with the following json file: http://downloads.balanduino.net/arduino_package/package_tkj_balanduino_index.json and it works fine.

However I am getting the following exception:
invalid header encountered

The full exception is here:

java.io.IOException: invalid header encountered
    at org.bouncycastle.bcpg.BCPGInputStream.readPacket(Unknown Source)
    at org.bouncycastle.openpgp.PGPSignature.<init>(Unknown Source)
    at org.bouncycastle.openpgp.PGPObjectFactory.nextObject(Unknown Source)
    at cc.arduino.contributions.GPGDetachedSignatureVerifier.verify(GPGDetachedSignatureVerifier.java:61)
    at cc.arduino.contributions.packages.ContributionsIndexer.isSigned(ContributionsIndexer.java:153)
    at cc.arduino.contributions.packages.ContributionsIndexer.mergeContributions(ContributionsIndexer.java:100)
    at cc.arduino.contributions.packages.ContributionsIndexer.parseIndex(ContributionsIndexer.java:82)
    at processing.app.BaseNoGui.initPackages(BaseNoGui.java:600)
    at processing.app.Base.openInstallBoardDialog(Base.java:1285)
    at processing.app.Base.access$100(Base.java:74)
    at processing.app.Base$11.actionPerformed(Base.java:1301)
    at javax.swing.AbstractButton.fireActionPerformed(AbstractButton.java:2022)
    at javax.swing.AbstractButton$Handler.actionPerformed(AbstractButton.java:2346)
    at javax.swing.DefaultButtonModel.fireActionPerformed(DefaultButtonModel.java:402)
    at javax.swing.DefaultButtonModel.setPressed(DefaultButtonModel.java:259)
    at javax.swing.AbstractButton.doClick(AbstractButton.java:376)
    at com.apple.laf.ScreenMenuItem.actionPerformed(ScreenMenuItem.java:125)
    at java.awt.MenuItem.processActionEvent(MenuItem.java:669)
    at java.awt.MenuItem.processEvent(MenuItem.java:628)
    at java.awt.MenuComponent.dispatchEventImpl(MenuComponent.java:351)
    at java.awt.MenuComponent.dispatchEvent(MenuComponent.java:339)
    at java.awt.EventQueue.dispatchEventImpl(EventQueue.java:754)
    at java.awt.EventQueue.access$500(EventQueue.java:97)
    at java.awt.EventQueue$3.run(EventQueue.java:702)
    at java.awt.EventQueue$3.run(EventQueue.java:696)
    at java.security.AccessController.doPrivileged(Native Method)
    at java.security.ProtectionDomain$1.doIntersectionPrivilege(ProtectionDomain.java:75)
    at java.security.ProtectionDomain$1.doIntersectionPrivilege(ProtectionDomain.java:86)
    at java.awt.EventQueue$4.run(EventQueue.java:724)
    at java.awt.EventQueue$4.run(EventQueue.java:722)
    at java.security.AccessController.doPrivileged(Native Method)
    at java.security.ProtectionDomain$1.doIntersectionPrivilege(ProtectionDomain.java:75)
    at java.awt.EventQueue.dispatchEvent(EventQueue.java:721)
    at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:201)
    at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:116)
    at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:105)
    at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:101)
    at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:93)
    at java.awt.EventDispatchThread.run(EventDispatchThread.java:82)

Furthermore it would be really nice if one could specify library dependencies, just as one can specify tools dependencies.

In my specific case I would like to add: https://github.com/TKJElectronics/KalmanFilter and https://github.com/felis/USB_Host_Shield_2.0 which are both found in the library manager.

Do you want me to open up a separate issue for it?

@Lauszus
Copy link
Contributor

Lauszus commented May 4, 2015

I got it working by hosting it on Github instead: https://raw.githubusercontent.com/TKJElectronics/Balanduino/master/package_tkj_balanduino_index.json :)

@ffissore
Copy link
Contributor Author

ffissore commented May 5, 2015

Thank you @Lauszus for those two error messages: we now handle those two conditions 060ec30
As for library dependencies, we don't support it yet, so yes please open a separate issue

@Lauszus
Copy link
Contributor

Lauszus commented May 5, 2015

Thanks @ffissore. I just opened up a new issue: #3082.

@ffissore ffissore modified the milestone: Release 1.6.5 May 20, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Component: Board/Lib Manager Boards Manager or Library Manager
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants