Comments (27)
Ok, It looks like where you do a void write you need to replace it with a size_t write.
Also it looks like the .print(var,BYTE); needs to be replace with a .write(var); BYTE is not supported in 1.0.
from wifly-shield.
I got the WiFly_Webserver running on my 1.0 wifly board. How does one go about sending the changes to the group?
;-)
from wifly-shield.
The usual process is to fork WiFly-Shield, make your changes to your fork, and then make a pull request. The pull request indicates that you want the maintainer of the WiFly-Shield to review your code and merge your branch from your fork into this fork. Btw, it's good practice to make a branch in your fork and have the changes for just this issue in that branch. Then issue the pull request for this branch into the parent's master and I think you can reference this issue in the pull request. Makes sense?
from wifly-shield.
@genetikayos,
Seeing that I am new to making changes to a git repo. I have cloned the tree, but I am confused on if I do a branch at this point. Guess it's time to "RTFM"
;-)
from wifly-shield.
I suggest that, instead of cloning this project's tree, you first do project fork in github and then git clone your new fork. That will allow you to upload branches to your own fork and make a pull request from your fork to the parent project.
from wifly-shield.
You know, on second thought, if your changes aren't extensive, just post a patch. The process I was suggesting is really more if you decide to be a regular contributor and contribute extensive changes over time. If your changes are simple, a patch is easy.
from wifly-shield.
I have the patch file, but I seem to be running into a timing issue in
the SpiUartDevice::available() function. Under Arduino 0.22 it works
fine on my boards. But when I load it under Arduino 1.0 I never see
the OPEN. When I put a Serial.print(readRegister(RXLVL)); above the
return. I seems to start to work.
I am going to hold on the patch file until I dig a little deeper. Time
to read the data sheet on the uart.....
On a side note, the shield will not work on a MEGA due to pin changes
(newbie issue on my part).
"On the Arduino Duemilanove and other ATmega168 / 328-based boards,
the SPI bus uses pins 10 (SS), 11 (MOSI), 12 (MISO), and 13 (SCK). On
the Arduino Mega, this is 50 (MISO), 51 (MOSI), 52 (SCK), and 53
(SS)."
-James
from wifly-shield.
Any news about this?
I'm trying to convert my current project to 1.0 and everything except the wifly library works fine. I would be really great if you update the library to 1.0 compatibility.
from wifly-shield.
+1 on this
from wifly-shield.
Yet another +1
from wifly-shield.
Been away from my arduino for a while. I will try to put together a patch. I hear your +1's ;-)
-James
from wifly-shield.
I will send you beer :)
from wifly-shield.
Yeah, I've been away from this and busy with life for a long while, too.
from wifly-shield.
Ok,
Here is the "VERY" early version of my patch. Please try it out and let me know issues that you are having.......
Tried to push the patch but the git server declined me so sorry for the long post.....
James
new file mode 100644
@@ -0,0 +1,272 @@
+From 1113203d3be429524e6390c0cb381191184a2b1f Mon Sep 17 00:00:00 2001
+From: unknown [email protected]
+Date: Wed, 21 Dec 2011 09:10:49 -0500
+Subject: [PATCH] Changes for the Arduino 1.0 library interface changes.
- Changes for the .print BYTE to .write in the new IDE
+
+--- - src/WiFly/Client.cpp | 24 ++++++++++++++--
- src/WiFly/Client.h | 6 ++++
- src/WiFly/SpiUart.cpp | 29 ++++++++++++++++---
- src/WiFly/SpiUart.h | 12 +++++++-
- src/WiFly/_Spi.h | 4 +++
- .../HardwareFactoryReset/HardwareFactoryReset.pde | 14 +++++++++-
- .../tools/SpiUartTerminal/SpiUartTerminal.pde | 8 +++++
- 7 files changed, 87 insertions(+), 10 deletions(-)
+
+diff --git a/src/WiFly/Client.cpp b/src/WiFly/Client.cpp
+index 098e46c..b4f91b6 100644
+--- a/src/WiFly/Client.cpp
++++ b/src/WiFly/Client.cpp
+@@ -35,25 +35,43 @@ Client::Client(const char* domain, uint16_t port) : - isOpen = false;
- }
- +-
++#if ARDUINO >= 100
++size_t Client::write(byte value) {
++#else - void Client::write(byte value) {
++#endif - /*
- */
- _WiFly.uart.write(value);
++#if ARDUINO >= 100
++ return (0);
++#endif - }
- +-
++#if ARDUINO >= 100
++size_t Client::write(const char *str) {
++#else - void Client::write(const char *str) {
++#endif - /*
- */
- _WiFly.uart.write(str);
++#if ARDUINO >= 100
++ return (0);
++#endif - }
- +-
++#if ARDUINO >= 100
++size_t Client::write(const uint8_t *buffer, size_t size) {
++#else - void Client::write(const uint8_t *buffer, size_t size) {
++#endif - /*
- */
- _WiFly.uart.write(buffer, size);
++#if ARDUINO >= 100
++ return (0);
++#endif - }
- +diff --git a/src/WiFly/Client.h b/src/WiFly/Client.h
+index 898532e..d164054 100644
+--- a/src/WiFly/Client.h
++++ b/src/WiFly/Client.h
+@@ -18,9 +18,15 @@ class Client : public Print { - boolean connect();
- ++#if ARDUINO >= 100
++ size_t write(byte value);
++ size_t write(const char *str);
++ size_t write(const uint8_t *buffer, size_t size);
++#else - void write(byte value);
- void write(const char *str);
- void write(const uint8_t *buffer, size_t size);
++#endif - int available();
- int read();
+diff --git a/src/WiFly/SpiUart.cpp b/src/WiFly/SpiUart.cpp
+index 309481c..ceccd7e 100644
+--- a/src/WiFly/SpiUart.cpp
++++ b/src/WiFly/SpiUart.cpp
+@@ -166,8 +166,8 @@ byte SpiUartDevice::available() { - */
- // This alternative just checks if there's data but doesn't
- // return how many characters are in the buffer:
+- // readRegister(LSR) & 0x01
+- return readRegister(RXLVL);
++ // readRegister(LSR) & 0x01
++ return (readRegister(RXLVL)); - }
- +@@ -188,8 +188,11 @@ int SpiUartDevice::read() {
- return readRegister(RHR);
- }
- +-
++#if ARDUINO >= 100
++size_t SpiUartDevice::write(byte value) {
++#else - void SpiUartDevice::write(byte value) {
++#endif - /*
-
+@@ -198,11 +201,17 @@ void SpiUartDevice::write(byte value) {
Write byte to UART.
- while (readRegister(TXLVL) == 0) {
-
// Wait for space in TX buffer
- };
+- writeRegister(THR, value);
++ writeRegister(THR, value);
++#if ARDUINO >= 100
++ return (0);
++#endif - }
- +-
++#if ARDUINO >= 100
++size_t SpiUartDevice::write(const char *str) {
++#else - void SpiUartDevice::write(const char *str) {
++#endif - /*
-
+@@ -213,10 +222,17 @@ void SpiUartDevice::write(const char *str) {
Write string to UART.
-
// Wait for empty TX buffer (slow)
-
// (But apparently still not slow enough to ensure delivery.)
- };
++#if ARDUINO >= 100
++ return (0);
++#endif - }
- #if ENABLE_BULK_TRANSFERS
++#if ARDUINO >= 100
++size_t SpiUartDevice::write(const uint8_t *buffer, size_t size) {
++#else - void SpiUartDevice::write(const uint8_t *buffer, size_t size) {
++#endif - /*
-
+@@ -233,6 +249,9 @@ void SpiUartDevice::write(const uint8_t *buffer, size_t size) {
Write buffer to UART.
- transfer_bulk(buffer, size);
- deselect();
++#if ARDUINO >= 100
++ return (0);
++#endif - }
- #endif
- +diff --git a/src/WiFly/SpiUart.h b/src/WiFly/SpiUart.h
+index f00388a..91678f2 100644
+--- a/src/WiFly/SpiUart.h
++++ b/src/WiFly/SpiUart.h
+@@ -59,6 +59,15 @@ class SpiUartDevice : public SpiDevice, public Print { -
void begin(unsigned long baudrate = BAUD_RATE_DEFAULT);
-
byte available();
-
++#if ARDUINO >= 100
int read();
++ size_t write(byte value);
++ size_t write(const char *str);
++#if ENABLE_BULK_TRANSFERS
++ size_t write(const uint8_t *buffer, size_t size);
++#else
++ using Print::write;
++#endif
++#else -
void write(byte value);
-
void write(const char *str);
- #if ENABLE_BULK_TRANSFERS
+@@ -66,7 +75,8 @@ class SpiUartDevice : public SpiDevice, public Print { - #else
-
using Print::write;
- #endif
+- void flush();
++#endif
++ void flush(); -
// These are specific to the SPI UART
-
+diff --git a/src/WiFly/_Spi.h b/src/WiFly/_Spi.h
void ioSetDirection(unsigned char bits);
+index 82eac05..1b71851 100644
+--- a/src/WiFly/_Spi.h
++++ b/src/WiFly/_Spi.h
+@@ -5,7 +5,11 @@ - #ifndef _SPI_H
- #define _SPI_H
- ++#if ARDUINO >= 100
++#include <Arduino.h>
++#else - #include <WProgram.h>
++#endif - #include <pins_arduino.h>
- +diff --git a/src/WiFly/examples/tools/HardwareFactoryReset/HardwareFactoryReset.pde b/src/WiFly/examples/tools/HardwareFactoryReset/HardwareFactoryReset.pde
+index f9a8797..a9dbfeb 100644
+--- a/src/WiFly/examples/tools/HardwareFactoryReset/HardwareFactoryReset.pde
++++ b/src/WiFly/examples/tools/HardwareFactoryReset/HardwareFactoryReset.pde
+@@ -54,7 +54,11 @@ void readResponse(int timeOut = 0 /* millisecond */) { - int target = millis() + timeOut;
- while((millis() < target) || SpiSerial.available() > 0) {
-
++#if ARDUINO >= 100
if (SpiSerial.available()) {
++ Serial.write(SpiSerial.read());
++#else -
++#endif
Serial.print(SpiSerial.read(), BYTE);
-
}
- }
- }
+@@ -158,10 +162,18 @@ void loop() { - // but note that this makes the terminal unresponsive
- // while a response is being received.
- while(SpiSerial.available() > 0) {
++#if ARDUINO >= 100
++ Serial.write(SpiSerial.read());
++#else -
++#endif
Serial.print(SpiSerial.read(), BYTE);
- }
- if(Serial.available()) { // Outgoing data
++#if ARDUINO >= 100
++ SpiSerial.write(Serial.read());
++#else -
++#endif
SpiSerial.print(Serial.read(), BYTE);
- }
+-}
++}
+\ No newline at end of file
+diff --git a/src/WiFly/examples/tools/SpiUartTerminal/SpiUartTerminal.pde b/src/WiFly/examples/tools/SpiUartTerminal/SpiUartTerminal.pde
+index abb928f..5fec0d9 100644
+--- a/src/WiFly/examples/tools/SpiUartTerminal/SpiUartTerminal.pde
++++ b/src/WiFly/examples/tools/SpiUartTerminal/SpiUartTerminal.pde
+@@ -45,10 +45,18 @@ void loop() { - // but note that this makes the terminal unresponsive
- // while a response is being received.
- while(SpiSerial.available() > 0) {
++#if ARDUINO >= 100
++ Serial.write(SpiSerial.read());
++#else -
++#endif
Serial.print(SpiSerial.read(), BYTE);
- }
- if(Serial.available()) { // Outgoing data
++#if ARDUINO >= 100
++ SpiSerial.write(Serial.read());
++#else -
++#endif
SpiSerial.print(Serial.read(), BYTE);
- }
- }
+--
+1.7.8.msysgit.0
+
from wifly-shield.
My system is using a version 1 of the shield. I seem to be getting a problem where the SPI_UART is hanging on the incoming serial stream from the shield.
Let me know if people are seeing something like this with the newer versions of the shield. The odd part is works under the old Arudion IDE. I hope it is not something with the compiler.......
Oh well, Time to RTFM....... ;-)
James
from wifly-shield.
Ok,
It looks like a timing issue going on. To get the webserver example to work.
I had to change the function available() in SpiUart.cpp and add delay(2); It now seems to work ok on my system.
-
James
delay(2);
return (readRegister(RXLVL));
from wifly-shield.
Just did a fork of the git repo, you can find my changes under the jmr13031 fork.......
-James
from wifly-shield.
I submitted a pull request that will resolve this issue. Its currently pending.
from wifly-shield.
@jmr13031 : Your fork is working for me, thanks!
from wifly-shield.
jmr13031 fork is working for me too! many thanks. sparkfun needs to pull this...
from wifly-shield.
I appreciate that. I've tried contacting them, but its been a bit hard, but if you let their customer service know, that would probably help.
Bob Breznak
617 863 0262
On Wednesday, May 16, 2012 at 8:43 PM, daneo wrote:
jmr13031 fork is working for me too! many thanks. sparkfun needs to pull this...
Reply to this email directly or view it on GitHub:
#7 (comment)
from wifly-shield.
I will give them a call....
-James
On Jun 18, 2012 5:32 AM, "Bob Breznak" <
[email protected]>
wrote:
I appreciate that. I've tried contacting them, but its been a bit hard,
but if you let their customer service know, that would probably help.Bob Breznak
617 863 0262On Wednesday, May 16, 2012 at 8:43 PM, daneo wrote:
jmr13031 fork is working for me too! many thanks. sparkfun needs to pull
this...
Reply to this email directly or view it on GitHub:
#7 (comment)
Reply to this email directly or view it on GitHub:
#7 (comment)
from wifly-shield.
Maybe you (@jmr13031) should do a pull-request from your commit? 311156a2ea1226562875e28b40a3d164caa45ada
from wifly-shield.
Just signed up! Hope you don't mind the questions. As I have nothing else to give for a first timer. I have the mega 1280, wifly 2.23 version and hope to connect to cosm. I have make huge progress, but totally need your help. I am using Arduino 1.0.1 but can use anything to get the wifly to work if you know what i mean. Hope you can all help. SO far it just fails to connect using the wifi _SPI library. I am over the most noobie issues such as the pin config and ssid, pphrase. Basically, i am looking for a mentor. Any help would be appreciated. Especially a tutorial.
from wifly-shield.
I'm out of town. I'll try to take a look into this near the end of the
week.
Sent from my iPhone
On Sep 17, 2012, at 12:25 AM, techdetect [email protected] wrote:
Just signed up! Hope you don't mind the questions. As I have nothing else
to give for a first timer. I have the mega 1280, wifly 2.23 version and
hope to connect to cosm. I have make huge progress, but totally need your
help. I am using Arduino 1.0.1 but can use anything to get the wifly to
work if you know what i mean. Hope you can all help. SO far it just fails
to connect using the wifi _SPI library. I am over the most noobie issues
such as the pin config and ssid, pphrase. Basically, i am looking for a
mentor. Any help would be appreciated. Especially a tutorial.
—
Reply to this email directly or view it on
GitHubhttps://github.com//issues/7#issuecomment-8604129.
from wifly-shield.
Thanks for your reply.
Tonight i used arduino IDE 23 with mega 1280. I followed mgisolutions.blogspot.com/2012/05/arduino-wifly-shield-tutorial.html. I did the "send the following commands..." section and instead of using my home router ssid, i used the my_adhoc_network. I was able to see that on my internet connection display, yeah... prior to that i did the get everything and copied the ip address of the wifly. followed everything from there on. Uploaded the IDE code (compiled correctly Yeah) and tried to open a browser to get the LED on. NO go here. Some of my issues may be that i only have tx/rx pins, 10-13 pins vin pin and grd pin connected to the arduino and shield. I know that i am suppose to have the shield ontop without 10-13 conected but that was from an earlier tutorial. I am stuck at changing the ip address of my computer and net mask so that i can connect to the web server the wifly is at. Have some suggestions. I feel that i have broken some ground here on my problem. Thanks for your reply so quickly before. I hope your travel goes well. Take care. Tried to go with IDE 1.0 as well from the site. Maybe i am missing something on the webclient/webserver, it hangs on connecting.? Maybe i need to reset the wifly to factory and start over. Thanks again. Keep up the good work. Techdetect..
----- Original Message -----
From: "Bob Breznak" [email protected]
To: "sparkfun/WiFly-Shield" [email protected]
Cc: "techdetect" [email protected]
Sent: Monday, September 17, 2012 6:58:18 AM
Subject: Re: [WiFly-Shield] does not compile under arduino 1.0 IDE (#7)
I'm out of town. I'll try to take a look into this near the end of the
week.
Sent from my iPhone
On Sep 17, 2012, at 12:25 AM, techdetect [email protected] wrote:
Just signed up! Hope you don't mind the questions. As I have nothing else
to give for a first timer. I have the mega 1280, wifly 2.23 version and
hope to connect to cosm. I have make huge progress, but totally need your
help. I am using Arduino 1.0.1 but can use anything to get the wifly to
work if you know what i mean. Hope you can all help. SO far it just fails
to connect using the wifi _SPI library. I am over the most noobie issues
such as the pin config and ssid, pphrase. Basically, i am looking for a
mentor. Any help would be appreciated. Especially a tutorial.
—
Reply to this email directly or view it on
GitHubhttps://github.com//issues/7#issuecomment-8604129.
—
Reply to this email directly or view it on GitHub .
from wifly-shield.
I'm closing this particular issue as the library has been updated to compile under 1.0+. If you have any additional updates for the library, either submit a pull request or please open a new issue. Thanks all!
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
- Web Client only working with the example file HOT 17
- Timer wrapping in findInResponse HOT 1
- Web Server example only works one time HOT 1
- oops
- Can't use multiple "Clients" HOT 2
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.