Comunication of RN-171 EK

i have the RN-171 EK conected to my pc. i wold like to send a hello messge from this card to my pc via wifi connection. can someone please help me to relaize this smple cde
thanks in advance

@ hel_rn - Hi, Welcome to the forum,
still no answer, what might be the reason?
Wrong forum?
Wrong language (spelling)?
Task too simple? (Then…, why do you ask?)
To be serious, you should tell a little bit more what you already have done and what you want to do. What are your electronic/programming scills? Are you able to talk with the RN-171 via USB from PC? Do you get answers? What kind of WiFi transmission do you want to use? RN-171 as http-Server? RN-171 as http-Client? Establish a socket connection?
Cheers
Roland

Thanks for your reponse Roshmi,
In my case i would like to send “Hello” message from my RN 171 EK(Emitter) to my pc (Reciver/server) with UDP protocol so i m done this progam in java

import java.io.*;
import java.util.*;
import java.net.*;
//package udp_server;

public class Udp_server extends Thread
{
    public static void main(String args[])
{
        int receivePort=999; // port to receive datagrams from
        InetAddress remoteIPaddress; // IP address of remote host
        int remotePort; // port on remote host to send frames too
        byte[] buffer = new byte[65507]; // array to put datagrams in
        DatagramPacket dp = new DatagramPacket(buffer, buffer.length); // create packet for datagrams
        try
              {
              // open DatagramSocket to receive and a DatagramePacket to hold the datagrams
              DatagramSocket ds = new DatagramSocket(receivePort);
              // loop forever reading datagrams from the DatagramSocket
              while (true)
                {
                 ds.receive(dp); // wait for next datagram
                 byte[] data = dp.getData(); // get datagram contents
                 String s = new String(data, 0, dp.getLength()); // create a string from the data
                 System.out.println("\nFrom IP " + dp.getAddress() + " UDP string received " + s + "\n");
                }
              }
        catch (IOException se) {System.err.println("error " + se);}
        System.exit(1); // exit on failure
}
}

and to configure this module i m using TeraTerm :

scan
<4.00>
SCAN:Found 1
01,11,-76,02,3104,54,40,00:25:53:14:aa:e2,wifi1
END:
set wlan ssid wifi1
AOK
<4.00> set wlan p pass
AOK
<4.00> join
Auto-Assoc wifi1 chan=11 mode=WPA2 SCAN OK
<4.00> Joining wifi1 now…
Associated!
DHCP: Start
DHCP in 1010ms, lease=172800s
IF=UP
DHCP=ON
IP=192.168.1.5:2000
NM=255.255.255.0
GW=192.168.1.254
set ip protocol 1
AOK
<4.00> get ip
IF=UP
DHCP=ON
IP=192.168.1.5:2000
NM=255.255.255.0
GW=192.168.1.254
HOST=0.0.0.0:2000
PROTO=UDP,
MTU=1524
FLAGS=0x7
TCPMODE=0x0
BACKUP=0.0.0.0
<4.00> set ip host 192.168.1.2
AOK
<4.00> set ip remote 999
AOK
<4.00> set ip local 2000
AOK
<4.00> exit
EXIT

then i m writen “Hello” message in teraterm
so i m succed to receive this in my java code
From IP /192.168.1.5 UDP string received H

From IP /192.168.1.5 UDP string received e

From IP /192.168.1.5 UDP string received l

From IP /192.168.1.5 UDP string received l

From IP /192.168.1.5 UDP string received o

So i have this questions plz :

  1. why i can’t receive all my message llike this
    From IP /192.168.1.5 UDP string received Hello
  2. why i can’t see the message in Tera Teerm because when i write exit
    i cant write any message in Tera Term
  3. it is possible to program my Rn171 to send every 20s for example a “Hello” message without using a Tera Term with this cable
  4. i would like to cnnect my rn171 ek to a sensor
    it is possible to done this without using another microcontroller
  5. can yo please explain me wha it is the utility of RN-171 as http-Server? RN-171 as http-Client annd it is important to done this in my case (sensor)
    Thanks in advance

I think you should declare the string s outside the try block and then append the bytes from the byte array “data” in each run of the while loop to the string until you receive a CR ( hex 0x0d) , then you can output the string with System.out.println

In > Settings > Terminal Settings (maybe there are other labels in teraterm) you can activate Local Echo to see what you have typed

I think that RN171 supports such features but I did not use it yet. There are manuals on the microchip Homepage.
Did you see these tutorials?

http://digitaldiy.io/articles/electronics/general/554-rn171-wifly-sensor-network#.VNP6ORF0yUk

Thanks for your reponse.
I have a problm in my card. i can’t receive any letter. i dont know what is the problem because i m doing the same steps
and when i write exit he display me this

<4.00> exit
EXIT
wifly-EZX Ver 4.00.1, Apr 19 2013 11:47:16 on RN-171
MAC Addr=00:06:66:71:5e:bc
*READY

and i cant receive any letter
can you help me please

If I understand your question right, it worked before and now it does not, right?
Does it still get an IP-Address by DHCP?
Do any data arrive in your read loop on the PC?

yes it worked before and now it does not
yes it still get an IP-Address by DHCP and i suucceded to connect to the wifi
but i cant receive any message

Did you try to reboot the PC?

yes i reboot my pc but i have the same problem

<4.00> Joining wifi now..
Associated!
DHCP: Start
DHCP in 4319ms, lease=86400s
IF=UP
DHCP=ON
IP=192.168.1.5:2000
NM=255.255.255.0
GW=192.168.1.1
set ip protocol 1
AOK
<4.00> set ip host 192.168.1.4
AOK
<4.00> set ip remote 999
AOK
<4.00> set ip local 2000
AOK
<4.00> exit
EXIT
ccwifly-EZX Ver 4.00.1, Apr 19 2013 11:47:16 on RN-171
MAC Addr=00:06:66:71:5e:bc
*READY*
ccddddddddddddddddddddd$$^dddd$$$$CMD
$$

:think: Did you try to inactivate the Firewall?

my firewall is inactive

it is possible to send analogic value without using exit and write a message and without using a sensor just to try the communication?

@ hel_rn - I don’t know.

hello, i successed to sendo hello message but now i want to program my card to send any information every 10s so i m trying with this configuration in teraterm
<4.00> Joining wifi now…
Associated!
DHCP: Start
DHCP in 4319ms, lease=86400s
IF=UP
DHCP=ON
IP=192.168.1.5:2000
NM=255.255.255.0
GW=192.168.1.1
set ip protocol 1
AOK
<4.00> set ip host 192.168.1.4
AOK
<4.00> set ip remote 999
AOK
<4.00> set ip local 2000
AOK
set sys auto 10 // Automatically connect every 10 seconds
set option format 7 // Send the header and sampled binary data converted to ASCII
set q sensor 0xFF // Set the sensor mask to sample all channels
save // Save the configuration to the config file
reboot // Reboot so that the settings take effect

and when i pu the battery i dont receive any information
can you help me plz
thanks

@ hel_rn -
the Manual says:
2.3.52 set sys autoconn
This command sets the auto-connect timer in TCP mode, where is a decimal
number from 0 to 255 as shown in Table 2-5. Setting this parameter causes the module
to connect to the stored remote host periodically as specified by .

So it seems to work only in TCP mode. As fare as I see, you are using UDP.

so it should to change my sever code to TCP mode an change my java code to the TCP. so plz can you help me and gve methe code of TCP in ja code

Does the RN 171 EK leds glow when you power it up using usb port of laptop?
the ones on mine dont lit up