Hi, no probs this is the code i have, its probably as basic as it can get as its taken from examples.
Im using the pusherapp library that can be found here:
Ive also tried using just the websocket library & my own server but get the same results:
This is my code, this works when using a normal insternet but not over my GSM router, yet my GSM router works fine and ive tried using my browser to make a connection using the GSM and that too works fine, but put the arduino and GSM together and its a no go.
The code:
#include <SPI.h>
#include <Ethernet.h>
#include <PusherClient.h>
byte mac[] = { 0x00, 0xAA, 0xBB, 0xCC, 0xDE, 0x02 };
//byte ip[] = {192,168,2,1};
//byte gateway[] = {192,168,2,1};
//byte subnet[] = {255,255,255,0};
PusherClient client;
void setup() {
Serial.begin(9600);
Ethernet.begin(mac);
Serial.print("My IP address: ");
for (byte thisByte = 0; thisByte < 4; thisByte++) {
// print the value of each byte of the IP address:
Serial.print(Ethernet.localIP()[thisByte], DEC);
Serial.print(".");
}
Serial.println();
delay(1000);
Serial.print("Connecting to server... ");
Serial.println();
while(client.connect("8bce0224d7dae3e8e75e") == 0){
Serial.println("Cannont Connect, retyring after 2 seconds...");
delay(2000);
}
//connected
Serial.println("connected");
client.bind("forward", moveForward);
client.bind("backward", moveBackward);
client.subscribe("my_channel");
}
void loop() {
if (client.connected()) {
client.monitor();
}
else {
}
}
void moveForward(String data) {
Serial.println("forward");
}
void moveBackward(String data) {
Serial.println("backward");
}
Many thanks
Andy