Comments (17)
Why this
#include
#include
?
What is your error?
from wifly-shield.
it's SPI.h and WiFly.h
it's just disconnecting, no data retrieved
from wifly-shield.
But the Wifly module gets ip adress and you can ping that and so on? I have never tried client mode just server. Is any example working?
from wifly-shield.
from wifly-shield.
this the only example thats working for me, i put the IP since the DNS resolution for this website is not great,
from wifly-shield.
oki so try the http get from a telnet client to your host and see what you get.
from wifly-shield.
telnet 54.84.79.112 80
Trying 54.84.79.112...
Connected to 54.84.79.112.
Escape character is '^]'.
GET /api/emotions/primary/totals HTTP/1.1
Host: wefeel.csiro.au
User-Agent: Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 5.1)
HTTP/1.1 200 OK
Content-Type: application/json;charset=UTF-8
Transfer-Encoding: chunked
Server: Jetty(8.1.14.v20131031)
80
{"love":2820658,"other":6660280,"sadness":7162856,"anger":2557674,"joy":21272805,"*":35758370,"surprise":1800489,"fear":1183795}
0
Works for me.
from wifly-shield.
code?
from wifly-shield.
Try this then. I have not tested may not compile. but you need to send hostname.
// (Based on Ethernet's WebClient Example)
#include <SPI.h>
#include <WiFly.h>
#include "Credentials.h"
byte server[] = { 54,84,79,112}; // Google
//Client client(server, 80);
WiFlyClient client("wefeel.csiro.au", 80);
void setup() {
Serial.begin(9600);
WiFly.begin();
if (!WiFly.join(ssid, passphrase)) {
Serial.println("Association failed.");
while (1) {
// Hang on failure.
}
}
Serial.println("connecting...");
if (client.connect()) {
Serial.println("connected");
client.println("GET /api/emotions/primary/totals HTTP/1.1");
client.println("Host: wefeel.csiro.au");
client.println();
} else {
Serial.println("connection failed");
}
}
void loop() {
if (client.available()) {
char c = client.read();
Serial.print(c);
}
if (!client.connected()) {
Serial.println();
Serial.println("disconnecting.");
client.stop();
for(;;)
;
}
}
from wifly-shield.
compiling by connection is failing
from wifly-shield.
oki change
WiFlyClient client("wefeel.csiro.au", 80);
to
WiFlyClient client(server, 80);
and try again
from wifly-shield.
That worked great, thanks for your help
from wifly-shield.
Whooo. Good luck!
from wifly-shield.
sorry, one more question, I'm trying to rerun the script in a loop, but it won't give the same results, any ideas?
from wifly-shield.
Why?
What is your result?
how does your code look like now?
from wifly-shield.
Here is the code, i'm not getting any connection at all
#include <SPI.h>
#include <WiFly.h>
#include "Credentials.h"
byte server[] = { 54,84,79,112}; // Google
//Client client(server, 80);
WiFlyClient client(server, 80);
void setup() {
Serial.begin(9600);
WiFly.begin();
if (!WiFly.join(ssid, passphrase)) {
Serial.println("Association failed.");
while (1) {
// Hang on failure.
}
}
Serial.println("connecting...");
delay(2000);
}
void loop() {
if (client.connect()) {
Serial.println("connected");
Serial.println("Getting the World's Mood");
delay(2000);
client.println("GET /api/emotions/primary/totals HTTP/1.1");
client.println("Host: wefeel.csiro.au");
client.println();
client.read();
} else {
Serial.println("connection failed");
}
while (client.connected())
{
if (client.available()) {
char c = client.read();
Serial.print(c);
delay(25000);
client.flush();
client.stop();
delay(25000);
}
}
setup();
delay(2000);
}
from wifly-shield.
Closing this issue out due to inactivity.
For anyone still looking for support on this product, we have moved this library to here, and have modified the code.
from wifly-shield.
Related Issues (20)
- Arduino is now ready for wifi HOT 1
- Support for Webduino HOT 1
- Baudrate HOT 1
- Add timeouts to sendCommand()/join() HOT 1
- How do I specify the pins for RX and TX? HOT 1
- Upgrade firmware - Roving Network-RN-171 - WiFly-EZX.img / 2:38.3 HOT 3
- After all the recent merges, it does not seem to compile... HOT 57
- Hang on connect HOT 5
- Setting DEBUG_LEVEL to 1 results in compile errors HOT 2
- Bug in SpiUart.cpp
- Support searching for multiple responses in sendInCommand()/findInResponse() HOT 2
- Not working with latest firmware (VERSION 4.00.1 4/19/2013) HOT 3
- Doesn't seem to be working with Arduino mega ATmega1280 HOT 3
- conflict with softSerial HOT 1
- Timer wrapping in findInResponse HOT 1
- Web Server example only works one time HOT 1
- oops
- Can't use multiple "Clients" HOT 2
- does not compile under arduino 1.0 IDE HOT 27
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from wifly-shield.