SparkFun Forums 

Where electronics enthusiasts find answers.

All things pertaining to wireless and RF links
#107365
seacritter wrote:I can't find that in my SpiUart.cpp. Is there another version of this?

Also, I had a WiFly module mounted onto a breakout board (RN-121) and ordered the SC16IS750 breakout board to adapt it. I've soldered everything in place and it doesn't talk to it.

I had preconfigured it, while it was a breakout board, and it connects perfectly by itself. It's a great little module, I just need it to talk to the arduino...

Thanks...
Just download the alpha 0 library from this thread, I can't find that define frequency in SpiUart.cpp & SpiUart.h, any possible reason for that?
#107373
I found the solution
Code: Select all
struct SPI_UART_cfg SPI_Uart_config = {
  0x60, //0x50,  <- [color=#FF0000]should change this value for new clock[/color]
  0x00,
  0x03,
  // We need to enable flow control or we overflow buffers and
  // lose data when used with the WiFly. Note that flow control 
  // needs to be enabled on the WiFly for this to work but it's
  // possible to do that with flow control enabled here but not there.
  // TODO: Make this able to be configured externally?
  EFR_ENABLE_CTS | EFR_ENABLE_RTS | EFR_ENABLE_ENHANCED_FUNCTIONS
};
value used is calculated base on this page
viewtopic.php?f=13&t=21530&start=0&hilit=wifly+baud
By follower
#107483
lawleo wrote:
seacritter wrote:I can't find that in my SpiUart.cpp. Is there another version of this?
Just download the alpha 0 library from this thread, I can't find that define frequency in SpiUart.cpp & SpiUart.h, any possible reason for that?
Yes, I just discovered the possible reason for that. :oops: So...it turns out I forgot the released version didn't have that separate crystal speed define but I assumed it did. The addition of the define was the first code change I made after I made the release which was long enough ago that I got confused about what the release had in it. Sorry about that. :)

All the more reason for me to get another release of the library out the door.

--Philip;
By racine_20
#108492
Bonjour tout le monde,

I have succeed to use auto-pairing mode with UDP protocol.
I have found a mistake in documentation in section "11.2. UDP Auto-Pairing"
He's writing about flags value 0x80, but it's not 0x80... the right value is 0x40.

But, in chapter "5.6 IP Parameters", section "set ip flags <value>", the values in table are correct, 7th bit is for enable UDP auto pairing

7th bit = > 0100 0000 => 0x40 ( and not 0x80 )

Method for use auto pairing :

- Set "ip flags" with 7th bit enable
- Join any network where a "listener" listen UDP broadcast packets from wifly.
- When listener receive broadcast packet, listener extract ip of the wifly module
- Listener send a udp packet with arbitrary value toward the extracted ip ( the wifly module ) .
- Then, the wifly module will set automatically host ip address with ip address of the listener.

this method make it possible to not hardcode ip value, of the listener or the wifly module. Very helpfull when the ip is attribute from DHCP server or AUTO-IP mode ( Ad-hoc ) for example.

It's maybe helpfull to remind what the udp broadcast packet from wifly module contains many information about him, signal strenght received, battery voltage, MAC addr of AP ( eg. "11.4 Using the UDP broadcast function" )

PS : sorry for my bad english
Last edited by racine_20 on Fri Sep 24, 2010 12:16 pm, edited 1 time in total.
By follower
#109855
Hi again,

I haven't forgotten the requests to have a repository for this hosted publicly--unfortunately wheels turn slowly, even when it's not me turning them. :)

I'll let people know when there's something accessible.

Thanks for your patience.

--Philip;
By bjoerngiesler
#111533
Hi Philip & all,

thanks a lot for this library -- after a bit of experimentation, it works like a charm.

One thing, though: I'm trying to use the library to download data from a FTP server in passive mode, which requires opening two client connections at once, one control and one data connection. Opening the second connection hangs at Client.connect(). Is it possible that the library supports only one connection at a time? Or am I doing something wrong here?

This is the code snippet:
Code: Select all
    Client control(DWD_HOSTNAME, FTP_PORT);
    if(!control.connect()) {
      Serial.println("Could not connect to DWD");
      return false;
    }

    EXPECT("220");    
    
    // login dialog
    SEND("USER " DWD_USERNAME); EXPECT("331");
    SEND("PASS " DWD_PASSWORD); EXPECT("230");

    // open passive-mode connection
    SEND("PASV"); EXPECT("227");
    
    char pasv_ip[20];
    uint16_t pasv_port;
    if(!parsePassive(msg, pasv_ip, pasv_port)) { control.stop(); return false; }
    
    Client data(pasv_ip, pasv_port);
    DEBUG("Trying to connect to "); DEBUG(pasv_ip); DEBUG(":"); DEBUGLN(pasv_port);
    if(!data.connect()) {
      DEBUGLN("Could not connect to passive IP / port");
      control.stop(); return false;
    }
    DEBUGLN("Connected to passive IP / port");
...and this is the relevant console output, with my comments:
Code: Select all
Server says: 220 DWD-FTP-Server: ftp-outgoing.dwd.de [141.38.3.180] (4)    
Message from server OK // EXPECT("220") succeeded
Server says: 331 Password required for gds40131
Message from server OK // EXPECT("331") succeeded
Server says: 230 User gds40131 logged in
Message from server OK // EXPECT("230") succeeded
Server says: 227 Entering Passive Mode (141,38,3,180,132,104).
Message from server OK // EXPECT("227") succeeded
141.38.3.180           // IP number for data connection parsed out of the above reply
33896                  // Port number for data connection parsed out of the above reply (132*256+104)
Trying to connect to 141.38.3.180:33896
...and there it hangs...

Any help is much appreciated!

Regards,
Björn
By follower
#111616
bjoerngiesler wrote:thanks a lot for this library -- after a bit of experimentation, it works like a charm.
Great, thanks for the feedback.
Opening the second connection hangs at Client.connect(). Is it possible that the library supports only one connection at a time?
Unfortunately the library only supports one connection at a time as this is all the module supports.

--Philip;
By CyberPunk
#116136
Hi guys,
I got my Wifly Shield for 2 weeks+ already and i'm still figuring out how to get it to work.
I've read everything in this forum and downloaded all the alpha libraries. (Currently using the alpha 2)
I have my Wifly Shield mounted on a MEGA 1280 and re-circuited the 10,11,12,and 13 pins to 53,51,50,52.
I've tried the WiFly Auto Connect sketch which i got from the SoundBox page and results show that i can't associate with my network.
and i've tried the WiFly library included sketch and still it can't associate with my network.
My router is using WEP 128 encryption. Changed the "set w a" from 3 to 1, even used the command "set w k" and still it didnt work :(

I noticed that he board LED PIO6 (orange) and PIO4 (lime) both are blinking but PIO6 blinks slower. After i uploaded the autoconnect sketch and run it, PIO6 turned off and PIO4 have rapid blinking even faster than before. What does it mean? But either way, it still didnt get to associate with my network.