Skip to content
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

little info as to how to use private channels #3

Open
michahell opened this issue Jun 12, 2012 · 10 comments
Open

little info as to how to use private channels #3

michahell opened this issue Jun 12, 2012 · 10 comments

Comments

@michahell
Copy link

Mostly concerning the auth_token. Where do we get it from? Is it the CSRF token spoken about here ->
http://pusher.com/docs/client_api_guide/client_connect
or is it just something we choose ourselves?

@michahell
Copy link
Author

Never mind, i now understand that this is simply not possible without a server-side authorisation... really too bad. You can't 'just' send messages from arduino to whatever app you're making. Gets really cumbersome this way, but, let's see if it works.

@michahell michahell reopened this Jun 12, 2012
@michahell
Copy link
Author

Okay, i got my authentication working, that is, on my serverside (my own domain). However, Pusher won't accept arduino as authenticated client, as there seems to be something wrong with the JSON arduino sends.
Screenshot here -> http://s14.postimage.org/4h460cqk1/arduino_wrong_JSON.png

This is my entire arduino sketch -> http://s14.postimage.org/f2o1ccwvl/arduino_sketch.png

This is the arduino sketch line where i authenticate:

client.subscribe("private-hitit", "def7cddb263b06e03ad1:52cd5f19949ac39039a206347baff007d6472464496190c23850cceaabbca382");

And the key is the one that this PHP library provided me with:
https://github.com/squeeks/Pusher-PHP#private-channels

So, why is arduino not getting authenticated?

@michahell
Copy link
Author

I have now got the authentication working for the HTML5 app i'm building, it can succesfully send client events.
However, i needed to authenticate using JSONP using a PHPscript on my own domain. How can this be done in arduino? Or are there any plans to add this functionality to the library? otherwise, it's not possible to send client events!

@chriswhong
Copy link

It took some doing, but I finally got a successful authentication to a private channel from my Arduino. I had to trim down the libraries and add a couple of new functions, things seem to get loopy when dealing with very large strings.

I'd love some feedback... I am a n00b and this is probably very sloppy code.

http://www.charmcitynetworks.com/news/sending-pusher-client-events-from-an-arduino/

@pbouchet
Copy link

pbouchet commented Jul 3, 2012

Nice one! I didn't know you could have two simultaneous sockets with the ethernet shields.

I'm using client-events with a Wifly module. These support multiplexed HTTP too, but require a specific firmware to do so. This specific firmware lacks other functionalities that I need though, so I can't use it.

Instead I do everything on the AVR, which allows me to make it work with only 1 TCP socket (however this means you have to put your secret key on the device, so there can be security issues with this approach).

My implementation is available here.

@fsamir
Copy link

fsamir commented Sep 9, 2012

+1 for for some better support for triggering events from Arduino (with or without private channels).

@michahell
Copy link
Author

i'd like to bump this thread, until Pusher decides to do something about this :) (this is important! help out the IoT community so we can build awesome stuff for you to put on your showcases! How about an indoor hanging garden modular system which uses Pusher? Sound good? Well, i'm about to embark on such a project and i would love to use Pusher for it, but as it stands now... I don't think so!

@pbouchet
Copy link

@michahell
What is it that prevents you from using it? What is your hardware setup? Are you using an Ethernet shield or something else?

@michahell
Copy link
Author

Wait... This is not the actual thread i wanted to post a reaction on. I'm sorry about the reply, it was a bit ment towards the Pusher creators :p I had it bookmarked because it had to do with pusher ><. i'll remove it! But still, i'd love to see your implementation (currently your posted link breaks here). I had a similar hardware setup like you did (WiFi xBee + shield) and i'd love to be able to do the auth on AVR as well, that would solve the issue for me!

@pbouchet
Copy link

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants