krohling / arduinopusherclient Goto Github PK
View Code? Open in Web Editor NEWAn Arduino interface to Pusher (pusherapp.com)
An Arduino interface to Pusher (pusherapp.com)
this is an awesome library! I'm trying to use it for a little water turret project (turret.jit.su). I haven't modified any of the connection code from your example, but I'm noticing that after leaving the board on, after roughly an hour it stops responding to messages from Pusher. I'm logging whether or not client.connected() is false in the loop but it it doesn't seem to be the issue (client.connected() is apparently still true while the board is unresponsive).
Do you know what might cause this (where I should start troubleshooting)? Thanks!
I can't get it to connect from arduino to pusher.
Will you help me, maybe you can find what I am doing wrong.
The situation is as follows
I have added all keys in the pusherclient.cpp. between the "" as you had described.
In the example script in IDE, I haven't changed anything, but when I compile I get the following message: Compilation error: no matching function for call to 'PusherClient::connect(const char [18])'.
When I remove the "your-api-key-here"
in the line: if(client.connect("your-api-key-here")) {
I no longer get compile errors. but get as response in the serial monitor:
21:44:16.328 -> Connecting to host.
21:44:16.328 -> Connection to host failed.
21:44:16.361 -> Connection to Pusher failed.
I suspect the error is in that if(client.connect line.
i used an arduino uno, with ethernet shield
I think it's a serious issue this awesome project isn't called 'Pusherino', as in the official greeting e-mail i got from pusher.com!
How can i set authEndpoint?
this is a long shot, but has anyone tried this for ESP8266 or maybe there is a newer version out there somewhere?
Hi,
I get this warning from pusher: "Pusher protocol versions <= 3 have been deprecated. Support will be removed after November 2013"
So you have any plans to update the library?
I'm having some real issues triggering my own events from the Arduino. When I send the sample input:
client.triggerEvent("my-event", "some data about my event");
I get "Client Error" in the debug console type column with a "Received invalid JSON" msg.
Then, when I try to pass in JSON for my data like so...
client.triggerEvent("my-event", "{ \"result\": \"1\" }");
I get this msg: "Unsupported event received on socket: my-event".
Any idea what I might be doing wrong?
Hi there!
Let me start by saying thanks a lot for this library - it's awesome and I use it quite often when hacking on Arduino stuff.
I was wondering if we (I work for Pusher) could fork it under our community libraries org? I notice there hasn't been much activity on it for a while - but I'm personally a big fan and I'm more than happy to maintain it.
Either way is cool! Thanks again :)
Hi,
Is it planned to update the library for a compatibility with the official Arduino WiFi shield ?
Best regards,
Just i wanna ask if it's updated with the current version !
The library works great, my only problem is when i reset my arduino a few seconds after the connection is made, it cannot reconnect. I have to reset it a few times. I think its because pusher thinks there is already a connection. Is there a way to ask for a new connection, or reset any old connection? Or is it a bug in the library?
[UPDATE]
I now have the following code to try again after failing to make a connection (not very clean):
int i = 0;
int times = 4;
while(connectedToPusher == false && i < times){
delay(5*1000);
connectToPusher();
Serial.println("again");
i++;
}
if(connectedToPusher == false){
Serial.println("Could not connect, times tried: "+times);
}
boolean connectToPusher()
{
Serial.println("Try connect to pusher");
if(client.connect("8178511e2ae898735fc3")) {
Serial.println("connected");
connectedToPusher = true;
digitalWrite(7, HIGH);
client.bind("ledon", ledon);
client.bind("pusher:ping", checking);
client.bindAll(handleAllEvents);
client.subscribe("test_channel");
return true;
}
else {
Serial.println("failed");
return false;
while(1) {}
}
}
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?
Hi, i have a simple sketch that connects and outputs its connecton status. (using ethernet sheidl)
If i plug it into my standard internet it works, if i plug it into a working fully connected GSM router (via ethernet) it cannot connect. Yet i can plug a laptop into the GSM router and it works fine, full internet access.
So i can only assume this is either down to timout or something else but its impossible to debug without any real errors?
Have you got any idea why this wont work over a GSM router?
_UPDATE_
Ok, i think i know what the issue is. GSM modems split the packets in order to cope with them and i am assuming that handshake "lines" are being returned and getting split and the library isnt prepared for this and therfore reads part of what it thinks is a line.
Is there a way that this could be fixed, the code in question is:
bool WebSocketClient::readHandshake() {
bool result = false;
char character;
String handshake = "", line;
int maxAttempts = 300, attempts = 0;
while(_client.available() == 0 && attempts < maxAttempts)
{
delay(100);
attempts++;
}
while((line = readLine()) != "") {
handshake += line + '\n';
}
String response = getStringTableItem(6);
result = handshake.indexOf(response) != -1;
if(!result) {
_client.stop();
}
return result;
}
Thanks
Andy
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.