My two Photons arrived! I have to run the Local Cloud at work, since our firewall refuses to open up the CoAP port. My Core has connected to the local cloud since I set it up in 12/2014. However, setting up and connecting a Photon yields this message from the server:
Handshake failed: plaintext was the wrong size: 214
Diving into Handshake.js (in \spark-server\js\node_modules\spark-protocol\lib) I see that the decrypted ‘plaintext’ is expected to contain only a Nonce and CoreID - 52 bytes. It appears that these two elements are in there, with a lot of baggage tacked onto the end. Commenting out the length check allows the connection to succeed.
Did I miss an update? ‘Handshake.js’ doesn’t appear to be part of the spark-server repo.
(Comment - I see this is being discussed here: on GitHub )
+1 to getting this patched for Photons.
Glad I found this, I was going completely down the wrong track and losing a lot of time on it. Just couldnt get it to connect to the local server. "Handshake failed: plaintext was the wrong size: 214"
I commented out the four lines in Handshake.js as suggested above and it now seems to work as it should. The Photon is now “breathing”. Looking forwards to getting the correct fix.
@chuank : yes. Thats the one! All 4 of those lines belong to the same length check.
I just put a simple “//” in front of each of the four lines from 361 to 364.
I imagine the eventual fix would be to add the correct number of additional bytes expected for a Photon into L361. Needs someone who knows exactly what those extra bytes are, how they are defined and how they will behave over time.
Thanks @whorner, after commenting them out the Photons seem to be working fine – variables are visible, and events are getting published on my local cloud.
As reported by others, there are no more OTA firmware upgrades possible – hope that will come soon. I am very impressed with the fast DFU firmware flashing on the Photons!
subscribing to local cloud events are still limited to the global event firehose – subscribing to events on an individual device is still not possible (i.e. /v1/devices/dev_id/events does not work)
OTA firmware upgrades (via particle-cli) for Photons – with more folks attempting to run the local cloud with their new Photons delivered, might this be addressed soon?
I did write / submit a quick pull request to the spark-protocol project that fixes the handshake for the photon on the local cloud ( https://github.com/spark/spark-protocol/pull/8 ), my hope is that it’ll be merged in soon and a new npm version will be deployed, spark-server dependencies updated, etc.
I think right now @nexxy is focusing on the CLI, but I’m guessing the local server will get some love in the near future. I’d love to make sure there are open issues for these on the repo, and group them into a milestone so we can set some expectations, etc.
I have couple of proton which i want to connect to local cloud.
Which Tutorial i can use to install local cloud on my Raspberry pi, I Tried several but with out any luck.