Hello @jimini I want to do the same thing. However I get stuck a bit before this even. I could not find any example of how to embed the key and cert file in my source code. Can you perhaps already inform me of how to do this?
In your example, it might be that the only problem is the name of the IoT service. It should look something like “b4po6n4hpn2bbc.iot.eu-central-1.amazonaws.com” where the endpoint is in fact your accountid.
Your client cert and private key directly replace the example key and cert. I am using my IoT service URL and I chose to emit that specific endpoint for a public post.
There’s no pub/sub that I could see, but I’ve yet to scour through the library… Hoping that somebody in here will share their experience if they’ve made this operable. The Photon is attractive from a price and footprint standpoint, but I’m wheel spinning when I should be focused on our application specifics.
There are other platforms that work out of the box (the Adafruit Feather comes to mind) and it may be opportune to jump ship.