HTTPS example error

My weather station code calls anAPI at www.myweather2.com. It worked great using HttpClient until recently when I started getting 303 errors. The URL it says to use is the same but it begins with HTTPS. I read the thread on the HTTPS library, understood very little of it and decided to try the example below first.

https://github.com/glowfishAPI/httpsclient-particle/blob/master/firmware/examples/timeapi-test.cpp

This compiled and loaded onto my Photon OK but the output I got is:

Using 2048 bit RSA private key
Keys Loaded
New Session key!:
free memory: 34464
matrixSslNewClientSession:1
free memory 3: 34464
FAIL: No HTTP

Can someone please help? I have no idea what this means or what to do about it.

Well this is odd. There was apparently a Github issue about this code around the included URL being 404. So I followed the suggestion there and changed it to www.worldclockapi.com. Now when I run this program I get:

Using 2048 bit RSA private key
Keys Loaded
New Session key!:
free memory: 34464

[SOS-10 (assertion failure), followed by a reboot]

Trying it again, I get

Using 2048 bit RSA private key
Keys Loaded
New Session key!:
free memory: 34464
matrixSslNewClientSession:1
free memory 3: 34464
FAIL: No HTTP Response

followed by SOS-10 again.

My Photon is running f/w 1.4.0-rc.1. I also found another thread here with someone asking for a simple HTTPS example. He also received no replies.

UPDATE

Added a few printlns to the code and tried to flash/ This time it failed to flash at all because it couldn’t do OTA flashing, use particle update. Well that didn’t work either. But a reflash Tinker from my phone did work and then the above example code also flashed. Now I get this:

Using 2048 bit RSA private key
Keys Loaded
New Session key!:
Connected to host
free memory: 31576
matrixSslNewClientSession:1
free memory 3: 31576
Bytes sent Successfully?!: 98
matrixSslSentData: 0
Sent Successfully?!, everything good
matrixSslGetReadbuf: 6000
HttpClient>     Done before full len
0
HttpClient>     Done before full len
3894
Received: 3894
certCb invoked: 45
WARNING: Certificate date window validation not implemented
SUCCESS: Validated!
matrixSslReceivedData: Tx: 3894 Len: 0 rc: 1

So now all of a sudden it’s sort of working, I guess. But it still falls into SOS-10 right after that. Why?

Further Update

Apparently others are getting the same SOS-10 problem with this code. I regretfully conclude that the HTTPS library is unusable at this point. I guess I’ll have to find a weather API that does not use HTTPS.

This topic was automatically closed 60 days after the last reply. New replies are no longer allowed.