Pages: 1 [2] 3 4 5   Go Down
Author Topic: Arduino Uno + Wireless proto shield + Wifly module  (Read 15167 times)
0 Members and 1 Guest are viewing this topic.
Wellington, New Zealand
Offline Offline
Sr. Member
****
Karma: 1
Posts: 404
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Could you do a " get everything" command using the serial port, and a "show net" command and post the output in a code box here (click on the hash symbol in the formatting options above the post).
Logged


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

Also, with any networking, each client or device every gets a unique IP address. If you configure the same IP address for both your pc and you WiFly, you have a ip conflict on the network. Check if a ip is free on the network before assigning it to the WiFly. You can also let your router play for DHCP server, and let that assign an IP address.

edit:
as an example: the output to dhunt's request would look like this:
(got it through telnet  smiley-razz but through serial you get the same output)
Code:
<2.30> show net
show net

SSid=SaikoWlan
Chan=5
Assoc=OK
Rate=12, 24Mb
Auth=OK
Mode=WPA2
DHCP=OK,renew=62155
Boot=2240
Time=FAIL
Links=1
<2.30> get everything
get everything

WiFly Ver 2.30, 10-26-2011 on RN-171
Beacon=100
Probe=5
Reboot=0
OPEN=*OPEN*
CLOSE=*CLOS*
REMOTE=*HELLO*
FlushSize=64
MatchChar=0
FlushTimer=10
IdleTimer=0
CmdChar=$
IF=UP
DHCP=ON
IP=10.0.0.7:2000
NM=255.255.255.0
GW=10.0.0.1
HOST=0.0.0.0:2000
PROTO=TCP,
MTU=1524
FLAGS=0x7
TCPMODE=0x0
BACKUP=0.0.0.0
DNS=10.0.0.1
Name=server1
Backup=backup2
FTP=208.109.78.34:21
File=wifly-EZX.img
User=roving
Pass=Pass123
Dir=public
Timeout=40
FTP_mode=0x0
SSID=SaikoWlan
Chan=0
ExtAnt=0
Join=1
Auth=WPA2
Mask=0x1fff
Rate=12, 24 Mb
Linkmon=0
Passphrase=<my password be gone  :P>
TxPower=0
SleepTmr=0
WakeTmr=0
Trigger=0x1
Autoconn=0
IoFunc=0x0
IoMask=0x21f0
IoValu=0x0
DebugReg=0x0
PrintLvl=0x1
TimeEna=0
TIMEADR=129.6.15.28:123
Zone=7
Baudrate=9600
Flow=0x0
Mode=0x0
JoinTmr=1000
Replace=0x24
DeviceId=WiFly-EZX
Password=
Format=0x0
Signal=0
Average=5
BCAST=255.255.255.255:55555
Interval=0x7
Sensor=0x0
SensePwr=0x0
---
dhunt, maybe you could help me out some more?
i understand the fact that i don't have to include the library, but instead i can write the commands to the serial link myself.
What i can't seem to figure out though (looked in the manual, on the internet, in the drivers) is how to retrieve the output properly. What kind of type is the output in? doesn't seem to be a simple string.
I have a lcd attached to my arduino, so for example, if i would like to show the ip or mac address:
lcd.print(Serial.print("get ip a")); //shows only ip, not the port nr
i get an 8 on my display?
« Last Edit: February 12, 2012, 10:53:48 am by sponder » Logged

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

hi sponder...i dont think there is any ip conflict as dhcp is "ON" meaning the ip is automatically assigned by the AP(Access Point)....

dhunt here is result after sending the 2 commands....
Code:
<2.23> get everything
WiFly Ver 2.23, 04-26-2011 on 131C11
Beacon=100
Probe=5
OPEN=*OPEN*
CLOSE=*CLOS*
REMOTE=*HELLO*
FlushSize=64
MatchChar=0
FlushTimer=10
IdleTimer=0
CmdChar=$
IF=UP
DHCP=ON
IP=192.168.1.9:2000
NM=255.255.255.0
GW=192.168.1.1
HOST=192.168.1.2:19999
PROTO=TCP,
MTU=1524
FLAGS=0x7
BACKUP=0.0.0.0
DNS=192.168.1.1
Name=server1
Backup=backup2
FTP=208.109.78.34:21
File=wifly-GSX.img
User=roving
Pass=Pass123
Dir=public
Timeout=40
FTP_mode=0x0
SSID=Alhabsy
Chan=0
ExtAnt=0
Join=1
Auth=WEP
Mask=0x1fff
Rate=12, 24 Mb
Linkmon=0
Keynum=1
Key=.......................................
SleepTmr=0
WakeTmr=0
Trigger=0x1
Autoconn=0
IoFunc=0x0
IoMask=0x20f0
IoValu=0x0
PrintLvl=0x1
TimeEna=0
TIMEADR=129.6.15.28:123
Zone=7
Baudrate=9600
Flow=0x0
Mode=0x0
JoinTmr=1000
Replace=0x24
DeviceId=WiFly-GSX
Password=
Format=0x0
Signal=0
Average=5
BCAST=255.255.255.255:55555
Interval=0x7
Sensor=0x0
SensePwr=0x0
<2.23> show net
SSid=Alhabsy
Chan=1
Assoc=OK
Rate=12, 24Mb
Auth=OK
Mode=WEP
DHCP=OK,renew=64694
Boot=667
Time=FAIL
Links=1
<2.23> show connection
8130

The 3rd command was for checking the connection status....following the reference guide, the result of the command is hexadecimal and its binary equivalent is 1000000100110000...the last 3 bits gives TCP status and judging from my result it is in 'idle' state...shouldn't it be active i mean connected....thanks
« Last Edit: February 12, 2012, 10:53:34 am by mc63 » Logged

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

To answer your question sponder...i came across some one trying to read data from the wifly but they were using the wifly library to do it...they had some function (readFromWifly()...) that reads from the wifly and prints on the serial monitor....

have a look at the code posted by Gary_BSEE on this forum http://forum.sparkfun.com/viewtopic.php?f=32&t=25129   
let me know if it works coz am also planning to read data from the wifly...thanks...
« Last Edit: February 12, 2012, 10:54:33 am by mc63 » Logged

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

dhunt here is result after sending the 2 commands....

The config looks okay, although the firmware version is a bit old - it might pay to update the firmware and see if that helps.

So when you ping 192.168.1.9 you get no response, and telnet 192.168.1.9 2000 does not connect?

If you want to make a tcp connection automatically you will need to set the UART mode to autoconnect. Then when you send write to the WiFly via the serial port it will make a tcp connection to the host address and remote port (192.168.1.2:19999). Do you have something running on 192.168.1.2 to handle the connection?

The wireshark app from http://www.wireshark.org/ can help you monitor the packets sent by the WiFly and the responses from the PC.
Logged


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

Could you try doing a ping from the WiFly to your PC and see if it gets a response (ping 192.168.1.2)? Also can you ping the gateway and see if it responds (ping 192.168.1.1)?
« Last Edit: February 13, 2012, 02:19:30 am by dhunt » Logged


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

Well, my problem lies with the fact that i cannot seem to use any of the WiFly libs. They either spit out a lot of errors when compliling in arduino 1.0, or the sketch compiles, but hangs while executing.
However i found your post, and i could try to modify it:

//displays on lcd what comes out of the serial buffer
void readFromWifly(){
  delay(100);
  while(Serial.available() > 0) {
    lcd.print(Serial.read(), BYTE);
  }
  delay(100);
}

I will try this once i get the chance.
--
Did you have any luck connecting the unit to your network? (as in you can ping and telnet in to the unit)
Perhaps you have some firewall on your pc blocking ping requests / telnet?
Also, i notice in your config that you have:
HOST=192.168.1.2:19999
Doesn't the WiFly try to auto connect to this address?
can you set this to:
HOST=0.0.0.0:2000
see if that does it?
« Last Edit: February 13, 2012, 02:54:22 am by sponder » Logged

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

Hi dhunt
I will try updating da wifly when i get home. When I ping it from da PC i get this message "Destination host unreachable" but when i ping the gate away i get responses back plus some stats on no. of packets sent and round trip time are shown on the cmd...
I tried pinging both the PC (192.168.1.2) and the gate away (192.168.1.1) from the wifly terminal but am not getting any response. I didnt get the part u said i need to change the uart mode to autoconnect as there is no such option but i guessed (judging from the reference guide) u meant setting bit 2 high (DATA TRIGGER makes connection on RX data) and so i did it that but no change...
I have a server program i created using java running on ma PC (192.168.1.2) that will be responsible in sending short messages via the wifly to an arduino with an LCD connected to it...am not familiar with wireshark but it wouldnt be a problem using it to monitor the packets...thanks..
« Last Edit: February 13, 2012, 11:31:00 am by mc63 » Logged

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

mc, your problem sounds like network related problem. (once i got an IP on my WiFly it responded straight away to ping & telnet, so i guess so should yours..)
"Destination host unreachable" normally occurs when you have a problem routing your network traffic, but this is unlikely since you can ping your gateway in the same subnet.
can you give us the readout from some command line tools just to be sure:
- ipconfig /all (gets all the network settings from your pc)
- tracert <gateway IP address>
- tracert <WiFly IP address>
- route print (show your IP v 4 route table)
this should tell us what path your pc is trying to take to the WiFly module, either there is something wrong here, there could be some software blocking ping / telnet requests (be it on your pc or router) or there are options in the WiFly module i'm not aware of  smiley-zipper.
Also, could you please confirm that your laptop is also connected through a wireless?

like i said, the problem is a network related one, i'm sure once you get that problem out of the way, you can telnet and ping from and to the WiFly straight away. Does (and what pattern) the WiFly blink?
Logged

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

Sponder,
Yah I can confirm that ma PC is connected to the wireless network.
This are the responses for the commands you requested...
Code:
C:\> ipconfig /all
Windows IP Configuration

   Host Name . . . . . . . . . . . . : mc
   Primary Dns Suffix  . . . . . . . :
   Node Type . . . . . . . . . . . . : Hybrid
   IP Routing Enabled. . . . . . . . : No
   WINS Proxy Enabled. . . . . . . . : No

Wireless LAN adapter Wireless Network Connection 2:

   Media State . . . . . . . . . . . : Media disconnected
   Connection-specific DNS Suffix  . :
   Description . . . . . . . . . . . : Microsoft Virtual WiFi Miniport Adapter
   Physical Address. . . . . . . . . : hidden
   DHCP Enabled. . . . . . . . . . . : Yes
   Autoconfiguration Enabled . . . . : Yes

Wireless LAN adapter Wireless Network Connection:

   Connection-specific DNS Suffix  . :
   Description . . . . . . . . . . . : Atheros AR5B93 Wireless Network Adapter
   Physical Address. . . . . . . . . : hidden
   DHCP Enabled. . . . . . . . . . . : Yes
   Autoconfiguration Enabled . . . . : Yes
   Link-local IPv6 Address . . . . . : fe80::e9fc:cc7:322e:4c3e%11(Preferred)
   IPv4 Address. . . . . . . . . . . : 192.168.1.2(Preferred)
   Subnet Mask . . . . . . . . . . . : 255.255.255.0
   Lease Obtained. . . . . . . . . . : Tuesday, 14 February, 2012 11:09:45 AM
   Lease Expires . . . . . . . . . . : Wednesday, 15 February, 2012 11:10:46 AM
   Default Gateway . . . . . . . . . : 192.168.1.1
   DHCP Server . . . . . . . . . . . : 192.168.1.1
   DHCPv6 IAID . . . . . . . . . . . : 184555460
   DHCPv6 Client DUID. . . . . . . . : 00-01-00-01-13-22-BD-89-70-5A-B6-41-2B-51

   DNS Servers . . . . . . . . . . . : 192.168.1.1
   NetBIOS over Tcpip. . . . . . . . : Enabled

Ethernet adapter Local Area Connection:

   Media State . . . . . . . . . . . : Media disconnected
   Connection-specific DNS Suffix  . : hidden
   Description . . . . . . . . . . . : Broadcom NetLink (TM) Gigabit Ethernet
   Physical Address. . . . . . . . . : hidden
   DHCP Enabled. . . . . . . . . . . : Yes
   Autoconfiguration Enabled . . . . : Yes

Tunnel adapter isatap.{E3E27219-19DB-443A-986D-9C4DBAE83E89}:

   Media State . . . . . . . . . . . : Media disconnected
   Connection-specific DNS Suffix  . :
   Description . . . . . . . . . . . : Microsoft ISATAP Adapter
   Physical Address. . . . . . . . . : 00-00-00-00-00-00-00-E0
   DHCP Enabled. . . . . . . . . . . : No
   Autoconfiguration Enabled . . . . : Yes

Tunnel adapter Teredo Tunneling Pseudo-Interface:

   Connection-specific DNS Suffix  . :
   Description . . . . . . . . . . . : Teredo Tunneling Pseudo-Interface
   Physical Address. . . . . . . . . : 00-00-00-00-00-00-00-E0
   DHCP Enabled. . . . . . . . . . . : No
   Autoconfiguration Enabled . . . . : Yes
   IPv6 Address. . . . . . . . . . . : 2001:0:4137:9e76:30b6:3d4e:506e:9a2a(Pref
erred)
   Link-local IPv6 Address . . . . . : fe80::30b6:3d4e:506e:9a2a%15(Preferred)
   Default Gateway . . . . . . . . . : ::
   NetBIOS over Tcpip. . . . . . . . : Disabled

Tunnel adapter isatap.swinburne.edu.my:

   Media State . . . . . . . . . . . : Media disconnected
   Connection-specific DNS Suffix  . :
   Description . . . . . . . . . . . : Microsoft ISATAP Adapter #2
   Physical Address. . . . . . . . . : 00-00-00-00-00-00-00-E0
   DHCP Enabled. . . . . . . . . . . : No
   Autoconfiguration Enabled . . . . : Yes

Tunnel adapter isatap.{3E168ECB-9D68-4F37-93EF-B6BE5D8AA658}:

   Media State . . . . . . . . . . . : Media disconnected
   Connection-specific DNS Suffix  . :
   Description . . . . . . . . . . . : Microsoft ISATAP Adapter #3
   Physical Address. . . . . . . . . : 00-00-00-00-00-00-00-E0
   DHCP Enabled. . . . . . . . . . . : No
   Autoconfiguration Enabled . . . . : Yes

C:\>tracert 192.168.1.1

Tracing route to 192.168.1.1 over a maximum of 30 hops

  1     2 ms     2 ms     2 ms  192.168.1.1

Trace complete.

C:\>tracert 192.168.1.9

Tracing route to 192.168.1.9 over a maximum of 30 hops

  1  mc [192.168.1.2]  reports: Destination host unreachable.

Trace complete.

C:\>route print
===========================================================================
Interface List
 14...06 17 c4 f0 ca 86 ......Microsoft Virtual WiFi Miniport Adapter
 11...00 17 c4 f0 ca 86 ......Atheros AR5B93 Wireless Network Adapter
 10...70 5a b6 41 2b 51 ......Broadcom NetLink (TM) Gigabit Ethernet
  1...........................Software Loopback Interface 1
 17...00 00 00 00 00 00 00 e0 Microsoft ISATAP Adapter
 15...00 00 00 00 00 00 00 e0 Teredo Tunneling Pseudo-Interface
 18...00 00 00 00 00 00 00 e0 Microsoft ISATAP Adapter #2
 19...00 00 00 00 00 00 00 e0 Microsoft ISATAP Adapter #3
===========================================================================

IPv4 Route Table
===========================================================================
Active Routes:
Network Destination        Netmask          Gateway       Interface  Metric
          0.0.0.0          0.0.0.0      192.168.1.1      192.168.1.2     25
        127.0.0.0        255.0.0.0         On-link         127.0.0.1    306
        127.0.0.1  255.255.255.255         On-link         127.0.0.1    306
  127.255.255.255  255.255.255.255         On-link         127.0.0.1    306
      192.168.1.0    255.255.255.0         On-link       192.168.1.2    281
      192.168.1.2  255.255.255.255         On-link       192.168.1.2    281
    192.168.1.255  255.255.255.255         On-link       192.168.1.2    281
        224.0.0.0        240.0.0.0         On-link         127.0.0.1    306
        224.0.0.0        240.0.0.0         On-link       192.168.1.2    281
  255.255.255.255  255.255.255.255         On-link         127.0.0.1    306
  255.255.255.255  255.255.255.255         On-link       192.168.1.2    281
===========================================================================
Persistent Routes:
  None

IPv6 Route Table
===========================================================================
Active Routes:
 If Metric Network Destination      Gateway
 15     58 ::/0                     On-link
  1    306 ::1/128                  On-link
 15     58 2001::/32                On-link
 15    306 2001:0:4137:9e76:30b6:3d4e:506e:9a2a/128
                                    On-link
 11    281 fe80::/64                On-link
 15    306 fe80::/64                On-link
 15    306 fe80::30b6:3d4e:506e:9a2a/128
                                    On-link
 11    281 fe80::e9fc:cc7:322e:4c3e/128
                                    On-link
  1    306 ff00::/8                 On-link
 15    306 ff00::/8                 On-link
 11    281 ff00::/8                 On-link
===========================================================================
Persistent Routes:
  None

C:\>ping 192.168.1.1

Pinging 192.168.1.1 with 32 bytes of data:
Reply from 192.168.1.1: bytes=32 time=10ms TTL=64
Reply from 192.168.1.1: bytes=32 time=19ms TTL=64
Reply from 192.168.1.1: bytes=32 time=2ms TTL=64
Reply from 192.168.1.1: bytes=32 time=2ms TTL=64

Ping statistics for 192.168.1.1:
    Packets: Sent = 4, Received = 4, Lost = 0 (0% loss),
Approximate round trip times in milli-seconds:
    Minimum = 2ms, Maximum = 19ms, Average = 8ms

C:\>ping 192.168.1.9

Pinging 192.168.1.9 with 32 bytes of data:
Reply from 192.168.1.2: Destination host unreachable.
Reply from 192.168.1.2: Destination host unreachable.
Reply from 192.168.1.2: Destination host unreachable.
Reply from 192.168.1.2: Destination host unreachable.

Ping statistics for 192.168.1.9:
    Packets: Sent = 4, Received = 4, Lost = 0 (0% loss),


Logged

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

The green LED(P104) blinks slowly meaning that its IP address is ok...if i may ask what is the response u get after pinging from the wifly terminal your gate away or host PC because for me am not getting any response (what does this mean?).....

To cancel the effect of unknown commands that may affect the performance of the device i applied factory reset command. I then sent the necessary commands to connect to my network. After successful connection I used the following commands
Code:
<2.23> set wlan ssid habs
AOK
<2.23> set wlan join 1
AOK
<2.23> save
Storing in config
<2.23> reboot
*Reboot*WiFly Ver 2.23, 04-26-2011 on 131C11
MAC Addr=00:06:66:14:a7:c7
Auto-Assoc Alhabsy chan=1 mode=WEP SCAN OK
Joining Alhabsy now..
*READY*
Associated!
DHCP: Start
DHCP in 50ms, lease=86400s
IF=UP
DHCP=ON
IP=192.168.1.9:2000
NM=255.255.255.0
GW=192.168.1.1
Listen on 2000

I also tried to do firmware update over ftp but i am getting the following response....
Code:
<2.23> set ftp user roving
AOK
<2.23> set ftp pass Pass123
AOK
<2.23> set ftp filename wifly-GSX.img
AOK
<2.23> ftp upload
<2.23> FTP connecting to 208.109.78.34
FTP timeout=2

<2.23> ftp update
<2.23> FTP connecting to 208.109.78.34
FTP timeout=2
« Last Edit: February 14, 2012, 01:08:44 am by mc63 » Logged

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

Since you do got a DHCP address, but then can't ping the gateway that the DHCP server gave the WiFly, I'd agree with sponder and guess that there's a network problem.

What kind of router do you have? Have you been able to use any other wireless devices with it ( laptop, smartphone, etc)?
Logged


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

Well, your laptop seems to be ok. (routing is correct etc.) Can you confirm this by pinging a smartphone or other laptop, which is on the same WLAN (and also got an IP address from the same DHCP server)? If this works without any problems, the problem must be the WiFly.
This is probably the case since the test the other way around also fails (letting the WiFly ping the gateway.)
I would first confirm it's not your laptop (by pinging another device) and if that's successfull, i would try a different another WLAN / router / network.
If your findings are the same on another network, i would contact Roving Networks support. You might have a defective unit.
Logged

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

I am using dlink router for my home network and I have other laptops n smartphones on the same network....so I tried pinging one of the PC's n smartphone but am getting da same result of "destination host unreachable"...The same thing happened when I pinged from one of the other PC's  . am going to try on another network
Sponder..what kind of response do u get when u ping your gateaway from da wifly?....this might help to compare with mine....
Logged

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

Do you have the model number of the dlink router?
Logged


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