Pages: 1 2 [3] 4 5   Go Down
Author Topic: Arduino Uno + Wireless proto shield + Wifly module  (Read 14956 times)
0 Members and 1 Guest are viewing this topic.
Offline Offline
Newbie
*
Karma: 0
Posts: 37
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Its clear the problem hugely lies on my netw?ork since no device is appear to ping another...but wouldn't rule out defectiveness of the wifly since I her no response when I.ping da gate away?....can I get what kind of response to expect when you do so from the wifly serial terminal?.....
Logged

Offline Offline
Newbie
*
Karma: 0
Posts: 20
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

I don't have the unit at hand right now, but tried to test is like a week ago, i remember the response was a reply as you would expect.
Being unable to ping other devices on the network is a huge hint though! Try another router, see if you can ping across the network (from laptop to laptop to smartphone etc.) if that works you can bet your WiFly will start responding to ping / telnet / FTP as well.

edit: i did a quick google on DLINK routers and not being able to ping anything besides the router: read 4 stories, all four of them got solved by disabling the windows firewall. Can you check please turn off the firewall on both laptops and try pinging each other?
« Last Edit: February 14, 2012, 05:57:04 am by sponder » Logged

Offline Offline
Newbie
*
Karma: 0
Posts: 37
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

I am using Dlink router DSL-2640B....I guess its something to do with the router blocking the computers from pinging each other since turning off windows firewall hasn't solved the problem....
Logged

Offline Offline
Newbie
*
Karma: 0
Posts: 20
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

I remember reading several users using their WiFly in an adhoc connection with their laptops. Perhaps you could try that to confirm it's your router (before spending money on a new one)
--
Wishing i had more time to spend on this, i'm slowly getting somewhere.
Right now i have a sketch where the arduino puts the WiFly in command mode, sends the command to get the IP address, and puts the serial data received on a lcd.
The sketch works, but, the output (also via serial / telnet) contains:

<2.30>get ip a
get ip a


10.0.0.7

thus, the output doesn't only contain the IP address, but also the string we send, a few newline chars, and then the IP address.
The good news is that i can see the string, including a part of the IP address (the lcd isn't big enough to show the complete string of chars lol.)
Once i find the time to read up on parsing incoming serial data, (im sure there are plenty of examples online?..) i can try to parse the data to show only the IP address.
Would you be interested in testing / trying / reviewing / commenting on that code?
Logged

Wellington, New Zealand
Offline Offline
Sr. Member
****
Karma: 1
Posts: 404
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

I did a google search for your router model and it seems that there are a number of hits for the same problem: Google: DSL-2640B unable to ping

I started reading through them but haven't found any solutions yet. Maybe you'd have better luck.
Logged


Offline Offline
Newbie
*
Karma: 0
Posts: 37
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Hi guys...yah as u said the problem is my router not allowing devices to ping each other so i tried to change its configuration and it seems it doesn't support such protocol (icmp)...so i decided to use adhoc mode for the time being before i get hold of another advanced router..thanks guys for the help...let u know how i progress...

Sponder...did da function that u said u gonna use to read from the wifly work correctly i.e readFromWifly()...what do u want to display on the lcd...the commands and the response or the response alone?...if the characters are too long for the lcd you can make them to scroll left to right..(i believe there is such a function in the lcd library) or write a function to scroll up (worked 4 me)....
Logged

Offline Offline
Newbie
*
Karma: 0
Posts: 20
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Well, like i said, i have trouble using any WiFly library. But as DHunt pointed out to me, you can also simply write all the commands to the WiFly module through the serial link.
I would like to display just the IP address on the lcd, but like i said in my previous post, the output of the get ip command is "get ip \n \n <IP address>\n" instead of just the ip.
but hey, at least i can see some output, so it's just a matter of parsing the output before displaying it to the lcd. (right now everything in the serial buffer is shown on the lcd)
I hope to find some hours here and there upcomming weekend, so i can read up on parsing serial data on the arduino. (But since it's carnaval over here i dont think i can find those hours..)
I want the parsing out of the way before i'm even going to try to connect to a server, since once connected to a server i would like to let the server send a command, which in turn gets parsed (and executed) on the arduino.
--
did you allready connect your unit with a adhoc connection?  Where you able to ping /telenet / FTP with it?
« Last Edit: February 16, 2012, 04:30:22 am by sponder » Logged

Offline Offline
Newbie
*
Karma: 0
Posts: 37
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Yah with the adhoc mode i was able to ping and telnet successfully....but will be getting another router soon because am looking to send commands to arduino from quite a long range....

Yah me too am planning to do the same but first i tried to see if the app can be able to send the commands to the arduino but am getting unknownHostException.(Thrown to indicate that the IP address of a host could not be determined.) which is weird since i was able to ping and telnet the host(wifly)..Are you familiar with java?...maybe you can help. I am also looking for opinions in other forums and am also rechecking my code.

Thanks.
Logged

Offline Offline
Newbie
*
Karma: 0
Posts: 37
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

As soon as you solve one problem you run into another..thats the order of the day when dealing electronics...

I was able to ping and telnet successfully but the app couldnt communicate with the wifly shield...i am just running the terminal sketch that allows commands to be sent through the terminal...To implement server/client communication aren't we supposed to upload some kind of server/client sketch to the wifly?....I think my problem could be the wifly not accepting the connection in the first place from the app....hence the app throws unknownHost Exception....am i right?..

Logged

Offline Offline
Newbie
*
Karma: 0
Posts: 37
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

On the app i have this line of code and it seems it cannot get past the first of these two lines below...The output of the second line is never shown as the connection to the host i.e wifly shield is never made... I declared the host name as "WiFly-GSX" ( default device id of wifly) and port  as 2000. I changed the port number but still same result.

Code:
Socket clientSocket = new Socket(host, port);
System.out.println("Connected to " + host + " in port " + port);
Logged

Offline Offline
Newbie
*
Karma: 0
Posts: 37
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Heey guys...i was able to send messages to arduino but now I ran into another problem....I am using the adhoc connection between wifly and my PC but after successful connection the wifly just goes off completely(no LED blinkng)...strange isnt it?......I tried to reset to default factory setting to cancel any unnnecessary commands that i may have passed to the wifly accidentally but the problem still persists...but after leaving it without power for a while it goess on again...what could be the problem?...
Logged

UK
Offline Offline
Newbie
*
Karma: 0
Posts: 2
If at first you don't succeed, try harder!
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

I have been playing with exactly the same config.    I got a bit sick of the wifly lib as it didn't seem to work.    So I went native and just talked to it direct.   Here is some code I am playing with.  Might help?

#include <SoftwareSerial.h>
SoftwareSerial mySerial(2, 3);   // got a display on this....
 
void setup() {
  //setup ports
  Serial.begin(9600);
  mySerial.begin(9600);
 
  delay(2000); // 2 second delay to let the screen initalise if it has only just been powered up
  mySerial.write("Hello Max");

  //exit CMD mode if not already done
  Serial.println("");
  Serial.println("exit");
  delay(1000);
 
  //set into CMD mode
  Serial.print("$$$");
  delay(1000);

  //set authorization level
  Serial.println("set wlan ssid AccessPonteID");
  delay(1000);

  //set passphrase
  Serial.println("set wlan phrase SillyPassword");
  delay(1000);

  //set DHCP
  Serial.println("set ip dhcp 1");
  delay(1000);

  //set join
  Serial.println("set wlan join 1");
  delay(1000);

  //set Auth
  Serial.println("set wlan auth 4");
  delay(1000);

  //set passphrase
  Serial.println("set wlan tx 0");
  delay(1000);
 
  //set localport
  Serial.println("set i l 80");
  delay(1000);
 
  //disable *HELLO* default message on connect
  Serial.println("set comm remote 0");
  delay(1000);

  //save config
  Serial.println("save"); 
  delay(5000);
 
  //exit
  Serial.println("reboot"); 
  delay(1000);
}


void loop() {
   if (mySerial.available()){
       Serial.write(mySerial.read());
   }

   if (Serial.available()){
     Serial.write(":");
     int sl = Serial.read();
     mySerial.write(sl);
     Serial.write(sl);
  }

}
Logged

Offline Offline
Newbie
*
Karma: 0
Posts: 37
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

HI guys,

Thanks Max for the share. I am currently past the connection stage and am dealing with reading data from the wifly to the arduino to be displayed on an LCD. When I open tera term terminal that I used to configure the wifly device, it displays the message that i send from a windows app ( I didn't do anything to let this happen). However, instead of getting the message on the terminal I want it be displayed on the LCD. As shown below is the output on the terminal. The message sent to the wifly is "Testing 1...2...3".
Code:
WiFly Shield Terminal Routine
Bridge initialized successfully!
Rebooting
Entering command mode.
Set wlan join level to 4
Set wlan ssid to wifly-GSX
Set wlan channel to 1
Set ip address to 169.254.1.1
Set ip netmask to 255.255.0.0
Set ip dhcp to 0
Joining 'wifly-GSX'

Associated!
*OPEN*Testing 1...2...3*CLOS*

I tried using SPI_Uart_ReadByte(char address) but couldn't figure out which address to read from SC16IS750 register and also wasn't sure if this is the correct way. I hoped to do something lcd.print(spi_uart.ReadByte(arbitrary value));

Any help?..
Logged

Wellington, New Zealand
Offline Offline
Sr. Member
****
Karma: 1
Posts: 404
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

I tried using SPI_Uart_ReadByte(char address) but couldn't figure out which address to read from SC16IS750 register and also wasn't sure if this is the correct way. I hoped to do something lcd.print(spi_uart.ReadByte(arbitrary value));

I'm a bit confused as to what WiFly hardware you have as I thought you had a serial interface module. Do you have a WiFly module with SPI support?
Logged


Offline Offline
Newbie
*
Karma: 0
Posts: 37
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

I am also a bit confused as I read before that the wifly shield uses spi_uart bridge to communicate with the arduino so i thought I should be dealing with this kind of communication model.

This is my understanding on how the data I am sending would go through, pardon me if I am wrong. When the data is received by the wifly it gets through its uart, spi_uart bridge, arduino's spi then LCD's parallel interface pins.

If the data is already displayed on the terminal, does it mean it has already been passed to arduino and all i should care is finding a way to display it on the LCD?.

I am also trying something similar to the Wifly_Webserver example but the arduino 1.0 doesn't support the LCD library that I am using (LCD4Bit_mod).

Thanks.
Logged

Pages: 1 2 [3] 4 5   Go Up
Jump to: