UDP Communication using WiFly

All things pertaining to wireless and RF links

Moderator: phalanx

Re: UDP Communication using WiFly

Postby avidan » Tue Aug 02, 2011 11:04 am

thank you for sharing.
do you know if this would make the TouchOSC implementation possible?
are these commands a one time thing, or would we need to send the commands on each boot up?
avidan
 
Posts: 5
Joined: Mon Aug 01, 2011 12:44 am

Re: UDP Communication using WiFly

Postby avidan » Wed Aug 03, 2011 1:31 am

thats great info. but what if the device where we are sending the data is an iPhone (with a changing IP).
also, how are you sending the UDP data, using the spark fun library?
any code samples are greatly appreciated.
thanks!
avidan
 
Posts: 5
Joined: Mon Aug 01, 2011 12:44 am

Re: UDP Communication using WiFly

Postby jam60 » Wed Aug 03, 2011 4:16 am

avidan: see my June 21 post for commands to set up WiFly to receive UDP. Also read that post again to see the issue with receiving OSC commands from iPhone TouchOSC app.

In order to communicate directly between the WiFly and an iPhone, the WiFly is going to have to be the access point. That means the iPhone IP address cannot be "changing". You must configure the iPhone to be on the same network as the WiFly. I can't remember whether the WiFly can be a DHCP server but I think not.
jam60
 
Posts: 7
Joined: Wed Jun 01, 2011 6:54 pm

Re: UDP Communication using WiFly

Postby aposada » Thu Feb 16, 2012 3:17 am

hello,
any news about this topic?
i want to use touchosc with wifly but i cant receive nothing to my terminal.
My hardware is xbee explorer + wifly

My Wifly configaration is:

IF=UP
DHCP=ON
IP=172.26.0.233:9000
NM=255.255.255.0
GW=172.26.0.6
HOST=172.26.0.46:8001
PROTO=UDP,
MTU=1524
FLAGS=0x7
TCPMODE=0x0
BACKUP=0.0.0.0
<2.28>

i use maxmsp to send UDP packets with udpsend object,
i receive something when i send from serial terminal from wifly to max, but nothing in the other direction!

any ideas?
aposada
 
Posts: 2
Joined: Thu Feb 16, 2012 3:13 am

Re: UDP Communication using WiFly

Postby waltermixxx » Fri Mar 02, 2012 10:48 pm

UDP test app for iphone is great at testing sending and receiving datagrams...
it will generate udp datagrams, and will also receive them...

I loaded a blank sketch (the bare minimum) into an arduino with a wireless proto shield (xbee socket) and put my RN-XV in it,
configured it for UDP with a particular ip address and particular port and i was able to use the app to test communication both ways...

the app is free and seems to be pretty cool :)
waltermixxx
 
Posts: 3
Joined: Fri Mar 02, 2012 10:24 pm

Re: UDP Communication using WiFly

Postby waltermixxx » Sun Mar 04, 2012 3:30 pm

Ardumote is also good :)
check out my posts on the arduino forum, same username :)

http://www.flickr.com/photos/66577016@N00/ flicker pics of the app and project...

http://arduino.cc/forum/index.php/topic,94546.0.html link to forum post :)

cheers :)
waltermixxx
 
Posts: 3
Joined: Fri Mar 02, 2012 10:24 pm

Re: UDP Communication using WiFly

Postby blairkelly » Sat Apr 21, 2012 10:17 am

Hey everybody, I've been working on a project that relies heavily on two-way UDP packet transfer between Processing and the Wifly.

In short, after putting the Wifly into UDP mode and applying all the other relevant settings, I use this code to fill up the Spi buffer:

Code: Select all
void ptb(char c)
{
  //prints to SpiSerial (fills up the buffer).
  SpiSerial.print(c, BYTE);
}
void fb()
{
  //FLUSH BUFFER (sends buffer contents to host).
  //a carriage return character (hex 0xd) flushes the WIFLYs buffer and sends the msg
  //where FBC is defined as: char FBC = 0xd;  //carriage return.
  SpiSerial.print(FBC, BYTE);
}


Remember to instantiate your SpiSerial object first:

Code: Select all
SpiSerial.begin();


I hope this helps a bit. For a lot of you I'm sure that wouldn't be hard to figure out. It just wasn't obvious to me :)

I go into more detail on my project's blog post:

http://www.blairkelly.ca/2012/04/20/arduino-wifly-mini/


Best regards,

Blair
blairkelly
 
Posts: 8
Joined: Mon Jan 30, 2012 11:38 pm

Re: UDP Communication using WiFly

Postby questionguy » Fri Aug 03, 2012 11:50 am

aposada wrote:hello,
any news about this topic?
i want to use touchosc with wifly but i cant receive nothing to my terminal.
My hardware is xbee explorer + wifly

My Wifly configaration is:

IF=UP
DHCP=ON
IP=172.26.0.233:9000
NM=255.255.255.0
GW=172.26.0.6
HOST=172.26.0.46:8001
PROTO=UDP,
MTU=1524
FLAGS=0x7
TCPMODE=0x0
BACKUP=0.0.0.0
<2.28>

i use maxmsp to send UDP packets with udpsend object,
i receive something when i send from serial terminal from wifly to max, but nothing in the other direction!

any ideas?


Do you know how to set IF=UP, I have not been able to find out how and find any documentation on it in the datasheet
questionguy
 
Posts: 3
Joined: Fri Aug 03, 2012 7:07 am

Re: UDP Communication using WiFly

Postby INGAme » Tue Aug 14, 2012 1:02 pm

Hey Guys,

this is my first post. As to the last post: I think the simple answer is you can't! As well as you can't set the MTU, for example. (This setting isn't even shown in the Default Settings part of the Datasheet). But the current settings should already show IF=UP. Just issue the 'get ip' command and have a look.


I have another Question about UDP Communication. We're using the WiFly together with a self-created sensor node called INGA and are building a game controller (like the upcoming Wii U controller) that has not only the usual D-Pad and gyro and accelerometer. You can integrate your smartphone (android) into the controller and have a touchscreen for your game. With a library we provide, games can stream video (in realtime!) to this second screen. (Like it is the case in the Wii U Controller).

As we have our own Sensor Node in the controller, we have data from a gyro, accelerometer, temperature, pressure (ok the last two are not really necessary for gaming) and an IR-Cam (disassambled from a WiiMote) that can track up to four ir lightsources.

All together this counts up to 46 Bytes (including a small header) we want to send to the host system (let's say the PC).

We are able to send Packets over UDP, but every 10th to 20th msg doesn't take 15ms to be sent like the other messages but about 350ms.
Now my Question: Has anyone tried sending UDP packages and has evaluated how long it takes to send these messages? I mean have you for example counted the number of packages you were able to send in one second or more important how much time it takes between two messages?

I would be very interested in your results!

Thanks!

(By the way, I'm not an native speaker of the english language, so please forgive me any mistakes in the above text)
INGAme
 
Posts: 1
Joined: Tue Aug 14, 2012 12:42 pm

Re: UDP Communication using WiFly

Postby questionguy » Thu Aug 23, 2012 11:32 am

I have been using a WiFly for about one week transferring data via UDP communication. However, recently, the WiFly has been unable to connect in infrastructure mode and receive data. I have been using a sample UDP Server sketch that was posted earlier on this forum. Here are the symptoms:

- WiFly's green LED blinks fast unable to connect to valid IP Address on network.
- WiFly connects to valid IP Address only to disconnect once I open the Serial monitor for Arduino
- WiFly turns DHCP on and sets an IP address of 192.168.1.5 after I upload the UDP Server sketch and only after I upload this sketch.

The WiFly had been working earlier and I am unsure of what could be occurring, whether it is going to default settings or not, but I have not found anything in the datasheet. Any help would be appreciated.

Code: Select all
#include "WiFly.h"
#include "Credentials.h"
#include "SPI.h"


WiFlyServer server(7778);

void setup() {
  WiFly.begin();

  if (!WiFly.join(ssid, passphrase)) {
    while (1) {
      // Hang on failure.
    }
  }

  Serial.begin(9600);
  Serial.print("IP: ");
  Serial.println(WiFly.ip());
 
  server.begin();
}

void loop() {
  WiFlyClient client = server.available();
  if (client) {
    while (client.connected()) {
      if (client.available()) {
        /*(char c = client.read();
        Serial.print(c);*/
       
         Serial.println("");
       char c;
    }
    client.stop();
  }
}
questionguy
 
Posts: 3
Joined: Fri Aug 03, 2012 7:07 am

Previous

Return to Wireless/RF

Who is online

Users browsing this forum: No registered users and 2 guests