Reading Wio with Processing

I can read my Wio Link without problems via a web browser, but how do you do it from apps writted in Processing? I want to use Processing for its graphics processing, and its easy installation onto Android phones.

I was able to get JSON data from other https sites, but trying the same code on the Wio’s URLs gives a long error messaage about a javax SSLHandshakeException that goes mostly through Sun’s security URLs. I can’t post the whole thing because, with URLs inside, it “looks too spamy for a new user”. Here are some heavily pared-down excerpts that the validator will let me get away with:

SunCertPathBuilderException: unable to find valid certification path to requested target Caused by: sun security validator ValidatorException: PKIX path building failed: SunCertPathBuilderException: unable to find valid certification path to requested target at sun security validator PKIXValidator doBuild(PKIXValidator.java:387) ... Caused by: sun security provider certpath SunCertPathBuilderException: unable to find valid certification path to requested target at sun security provider certpath SunCertPathBuilder build(SunCertPathBuilder.java:141) ...

Hi,

Basically it’s because Java do not recognize the Root CA. Which server are you connecting? According to this workaround magicmonster.com/kb/prg/java/ssl … ailed.html, I can give you the Root CA and some further steps need to be done by you.

Thanks, that’ll be worth trying. This is the URL I’ve been trying to reach:

https://iot.seeed.cc/v1/node/GroveDigitalLightI2C0/lux?access_token=[i][access token][/i]

Is sending me a certificate just a one-off fix, though, for just this one computer? I’d like this app to be uploaded onto Android phones and tablets, and run simultaneously on lots of them.

I just tried following the instructions on the magicmonster page, using the certificate that iot dot seeed dot cc provides via my web browser. I restarted Processing and the JVM and am still getting what looks like the same error message.

So I’ve imported also the two WoSign certificates and the StartCom root certificate.

Still no success.

What should I be looking at to determine what’s wrong?

Hi Alistair,

don’t know the Java environment, but in my system (SAP) you have to import the whole certificate path (all four certificates):
certificates.PNG

Hello Uwe,

I imported all four certificates and it still isn’t working. (And I don’t know the Java environment either.) I’m wondering whether I need to be more thoughtful about the certificate aliases in the certificate repository. Or perhaps I didn’t export them correctly (I dragged them out of Safari and dropped them into a folder.)

There’s an open-source GUI keystore editor, for those of us who aren’t so comfortable at the CLI. It’s called Keystore Explorer.

I just tried adding those certificates to the keystore of the Java internet plugin, in case that’s where they were meant to be. No improvement.

I’m wondering, though — is this problem unique to just my computer, or is it due to something more general that affects also other devices? If the upshot is that we can’t read these devices using Java without intervention on every individual device, it would make sense to try a different approach.

You may install your own server (for example on a Raspberry Pi viewtopic.php?f=72&t=6973 ), where you can bypass the encryprion by using port 8080.

I just discovered a third jre location. This one’s buried inside the Processing app bundle. Installing the certificates into that well-hidden keystore is the solution, at least for Processing.

Thanks for your suggestion, Uwe, but one of the design parameters for this project is that the parts have to be cheap and accessible. The Raspberry Pi is unfortunately too expensive and intimidatingly hard for the people I’m designing for.

The Wio looked like an excellent way to simplify setup compared with a Launchpad or Arduino system, especially given how quickly the Arduino drains batteries, so I’m hoping to find a way through on this platform.

Processing appeals for more or less the same reasons, plus the quick access to graphics for visualisation.