Netduino home hardware projects downloads community

Jump to content


The Netduino forums have been replaced by new forums at community.wildernesslabs.co. This site has been preserved for archival purposes only and the ability to make new accounts or posts has been turned off.
Photo

Wifly rn-xv + XBee shield


  • Please log in to reply
28 replies to this topic

#1 Ttxouras

Ttxouras

    New Member

  • Members
  • Pip
  • 6 posts

Posted 17 February 2012 - 01:36 PM

Hi all! I'm new to the forums and to the netduino world, so please be kind. I've started a wifi + regular netduino project and I'm using the Wifly rn-xv atached to a breakout board for XBee Module. I'm able to send and receive files via ftp to a ftp server (I've also probe with success Html to Pachube,but that's not important) and everything works well. However, when I use the XBee Shield I've got some problems. I can't communicate with the Wifly and that's why I can't enter command mode. Has anyone an idea abaout what I'm doing wrong? I've also tested the uart Rx and Tx of the XBee shield, and surprisingly it works!!!! If anyone could help me it would be gratefull! Thank you in advance.

#2 Stefan

Stefan

    Moderator

  • Members
  • PipPipPip
  • 1965 posts
  • LocationBreda, the Netherlands

Posted 17 February 2012 - 02:35 PM

Hi Ttxouras and welcome to the forums! I have used the setup you want to use, I think, in this thread: http://forums.netdui...-module-driver/ and for me it worked. What's the problem with your setup?
"Fact that I'm a moderator doesn't make me an expert in things." Stefan, the eternal newb!
My .NETMF projects: .NETMF Toolbox / Gadgeteer Light / Some PCB designs

#3 Ttxouras

Ttxouras

    New Member

  • Members
  • Pip
  • 6 posts

Posted 17 February 2012 - 03:26 PM

Hi Stefan!! Thank you so much for your fast reply. I made a WPF application to control a room's tenperature, and I want to control it via wifi of course. I had plenty of ideas how to communicate the netduino with the WPF app and one (probably it's not the best) was with an online ftp server, where the netduino storages the Tº to upload to the server. As I said in my previous post, this procedure works with the XBee breakout board, but not with the XBee shield. I've written a program with simple code following the Wifly manual, the only things that the netduino program does is to send to the uart pings "puts" and "gets" to download or upload the files to the server, because I've previously configured my Wifly to accept tcp connections. As I know(which is no much), both of the shields are compatible with the Wifly module, but I can't understand why one (the breakout board) works and the other(the XBee shield) no!!? I've made some many probes and I think that the Netduino is able to communicate with the XBee shield, but the shield can't write to the Wifly. If anybody knows what I'm doing wrong please be so kind to explain to me. Again, thank you in advance and sorry for my bad english.

#4 Stefan

Stefan

    Moderator

  • Members
  • PipPipPip
  • 1965 posts
  • LocationBreda, the Netherlands

Posted 17 February 2012 - 03:39 PM

On my XBee Shield I had a damaged trace (at least, I think so). When I measured the resistance between the XBee serial I/O pins and pins 0/1 on the Netduino, I found that there was no contact. I soldered a wire to fix this problem. Could this be the case with you as well?
"Fact that I'm a moderator doesn't make me an expert in things." Stefan, the eternal newb!
My .NETMF projects: .NETMF Toolbox / Gadgeteer Light / Some PCB designs

#5 Ttxouras

Ttxouras

    New Member

  • Members
  • Pip
  • 6 posts

Posted 21 February 2012 - 02:59 PM

Hi! First off all thank you for answering and I am sorry for answering so late, but I've been doing a lot of things. I soldered a wire but unfortunately that's not the solution, because now the Din led of the XBee shield lights, but nothing it's received or written on the Wifly. I've done an app to communicate a pc with the netduino with sockets and it works, but only with the Wifly connected to D0 and D1 pins, not directly atached to the XBee shield (where it's suposed to be). When it's directly connected to the shield I see that the netduino receives the data but the XBee shield continues not writing on the Wifly.... This is so annoying. I've no more ideas, so please, if you can help me with one it would be nice.

#6 Stefan

Stefan

    Moderator

  • Members
  • PipPipPip
  • 1965 posts
  • LocationBreda, the Netherlands

Posted 21 February 2012 - 03:28 PM

I soldered a wire but unfortunately that's not the solution, because now the Din led of the XBee shield lights, but nothing it's received or written on the Wifly.

Was your board damaged? I just told you my experience, not to actually solder a thing. Not sure which contact you just made? ;)

It sounds like your shield is broken in some way though. Lets test some stuff first.

  • First, stack your Netduino, XBee Shield and Wifly module. Don't put power on it just yet.
  • Now measure the resistance between Netduino pin D0 and pin 2 (DOUT) of the wifly module. This should be close to 0.
  • Do the same for pin D1 on the Netduino and pin 3 (DIN) on the wifly. Should also be close to 0.
  • Now measure the resistance between Ground on the Netduino and pin 10 (Gnd) on the wifly. Should be close to 0.
  • Next, the resistance between pins D0 and D1 should be infinite.
  • Now power on your Netduino
  • Measure the voltage between pins 1 and 10 on the Wifly module. Should be approx. 3.3V

Just to be sure everything is working fine.
"Fact that I'm a moderator doesn't make me an expert in things." Stefan, the eternal newb!
My .NETMF projects: .NETMF Toolbox / Gadgeteer Light / Some PCB designs

#7 Ttxouras

Ttxouras

    New Member

  • Members
  • Pip
  • 6 posts

Posted 21 February 2012 - 03:43 PM

I know that yo didn't told me to sold, but I think it was a good idea to see anoher posibilitie. I soldered the D1 pin to the Din one, because the D0 an D1 pins work fine for me! Now I can't do the conprobations but I hope tomorrow I will have enough time. Let's see if with your help, which is appreciated, can we find a solution to this problem.

#8 Ttxouras

Ttxouras

    New Member

  • Members
  • Pip
  • 6 posts

Posted 22 March 2012 - 01:26 PM

Hi all, I know it's been a loot of time since the last reply, however nothing works to the shield problem. I tried a lot of things but no ones worked until this morning!! I've tried bypassing the diode on pin 3 (I did it because some guy wrote a comment about this problem on the sparkfun web)and FINALLY IT WORKS!http://forums.netdui...t/biggrin.gif(I think it is not only my problem, more than one has written abaout it) I know that having a wire bypassing the diode it's not the ideal solution, but that is enough for me. I'm really happy because right now my netduino is able to communicate via socket and that's amazing. So again, sorry for my late replay and thank you Stefan for all the help you provide me.

#9 Stefan

Stefan

    Moderator

  • Members
  • PipPipPip
  • 1965 posts
  • LocationBreda, the Netherlands

Posted 22 March 2012 - 01:47 PM

So again, sorry for my late replay and thank you Stefan for all the help you provide me.

Ohh that's interesting, do you have a direct link to the issue? Perhaps others could experience the same thing.
Thanks for posting!
"Fact that I'm a moderator doesn't make me an expert in things." Stefan, the eternal newb!
My .NETMF projects: .NETMF Toolbox / Gadgeteer Light / Some PCB designs

#10 Ttxouras

Ttxouras

    New Member

  • Members
  • Pip
  • 6 posts

Posted 22 March 2012 - 02:46 PM

Here is the link: http://www.sparkfun.com/products/9976 The comment that's brought me the idea to bypass the diode on pin3 was boulderjoe's one. I hope it helps!

#11 fritzE

fritzE

    Member

  • Members
  • PipPip
  • 11 posts

Posted 11 June 2012 - 05:52 PM

Hi Stefan, i'm just finished doing the retrofit to the sparkfun sheild, and am about to light it up. one question i had was how to deal with a proxy server. do you know how i can set that up? thanks

#12 Stefan

Stefan

    Moderator

  • Members
  • PipPipPip
  • 1965 posts
  • LocationBreda, the Netherlands

Posted 11 June 2012 - 05:57 PM

HI fritzE and welcome to the forums :)

Hi Stefan,
i'm just finished doing the retrofit to the sparkfun sheild, and am about to light it up.
one question i had was how to deal with a proxy server. do you know how i can set that up?
thanks

Depends on the type.
Many proxy servers would work like this:
HTTP_Client WebSession = new HTTP_Client(new IntegratedSocket("proxyhost", 8080));

// Requests the latest source
HTTP_Client.HTTP_Response Response = WebSession.Get("http://www.netmftoolbox.com/helloworld/");

"Fact that I'm a moderator doesn't make me an expert in things." Stefan, the eternal newb!
My .NETMF projects: .NETMF Toolbox / Gadgeteer Light / Some PCB designs

#13 fritzE

fritzE

    Member

  • Members
  • PipPip
  • 11 posts

Posted 22 June 2012 - 12:53 PM

HI fritzE and welcome to the forums :)


Depends on the type.
Many proxy servers would work like this:

HTTP_Client WebSession = new HTTP_Client(new IntegratedSocket("proxyhost", 8080));

// Requests the latest source
HTTP_Client.HTTP_Response Response = WebSession.Get("http://www.netmftoolbox.com/helloworld/");

Hi Stefan,
that works. Thanks. I cat do a HTTP put to cosm. i tried your http_client class to get from cosm, and got some funny behaviors. Looks like the connection is retrying a couple of times. the symptom is that the cookies gets scrogged because it is taking the first header info, not the latest which is corect. here is a trace of the ResponseData in _doRequest:
HTTP/1.1 200 OK
Date: Fri, 22 Jun 2012 12:42:55 GMT
Content-Type: text/plain; charset=utf-8
Connection: close
Last-Modified: Thu, 21 Jun 2012 02:14:12 GMT
X-Runtime: 65
X-Pachube-Logging-Key: logging.pxLV3knPodCwvjx73Nis
Content-Length: 408
X-PachubeRequestId: d4537ff8cf384d60c00283b4fee6c080492e0222
Set-Cookie: _pachcore_app_session=BAh7BjoPc2Vzc2lvbl9pZCIlZjBjNmFkZDU4ZTFmZWJlNWEHTTP/1.1 200 OK
Date: Fri, 22 Jun 2012 12:42:55 GMT
Content-Type: text/plain; charset=utf-8
Connection: close
Last-Modified: Thu, 21 Jun 2012 02:14:12 GMT
X-Runtime: 65
X-Pachube-Logging-Key: logging.pxLV3knPodCwvjx73Nis
Content-Length: 408
X-PachubeRequestId: d4537ff8cf384d60c00283b4fee6c080492e0222
Set-Cookie: _pachcore_app_session=BAh7BjoPc2Vzc2lvbl9pZCIlZjBjNmFkZDU4ZTFmZWJlNWE5YmEzNWJiNmExZDUxN2M%3D--596913f0ea16c484f53571bc02d23b6083b62416; domain=.cosm.com; path=/; expires=Fri, 06-Jul-2012 12HTTP/1.1 200 OK
Date: Fri, 22 Jun 2012 12:42:55 GMT
Content-Type: text/plain; charset=utf-8
Connection: close
Last-Modified: Thu, 21 Jun 2012 02:14:12 GMT
X-Runtime: 65
X-Pachube-Logging-Key: logging.pxLV3knPodCwvjx73Nis
Content-Length: 408
X-PachubeRequestId: d4537ff8cf384d60c00283b4fee6c080492e0222
Set-Cookie: _pachcore_app_session=BAh7BjoPc2Vzc2lvbl9pZCIlZjBjNmFkZDU4ZTFmZWJlNWE5YmEzNWJiNmExZDUxN2M%3D--596913f0ea16c484f53571bc02d23b6083b62416; domain=.cosm.com; path=/; expires=Fri, 06-Jul-2012 12:42:52 GMT; HttpOnly
Age: 3
Cache-Control: max-age=86400
Vary: Accept-Encoding

30,2012-06-21T01:03:54.979682Z,38
60,2012-06-21T01:03:54.979682Z,90
90,2012-06-21T01:03:54.979682Z,6
120,2012-06-21T01:03:54.979682Z,61
150,2012-06-21T01:03:54.979682Z,53
GO,2012-06-21T01:03:54.979682Z,1
30,2012-06-21T02:14:12.401906Z,58
60,2012-06-21T02:14:12.401906Z,91
90,2012-06-21T02:14:12.401906Z,69
120,2012-06-21T02:14:12.401906Z,75
150,2012-06-21T02:14:12.401906Z,93
GO,2012-06-21T02:14:12.401906Z,0

ANy ideas?? Thanks.

#14 fritzE

fritzE

    Member

  • Members
  • PipPip
  • 11 posts

Posted 22 June 2012 - 02:18 PM

Hi Stefan,
that works. Thanks. I cat do a HTTP put to cosm. i tried your http_client class to get from cosm, and got some funny behaviors. Looks like the connection is retrying a couple of times. the symptom is that the cookies gets scrogged because it is taking the first header info, not the latest which is corect. here is a trace of the ResponseData in _doRequest:
HTTP/1.1 200 OK
Date: Fri, 22 Jun 2012 12:42:55 GMT
Content-Type: text/plain; charset=utf-8
Connection: close
Last-Modified: Thu, 21 Jun 2012 02:14:12 GMT
X-Runtime: 65
X-Pachube-Logging-Key: logging.pxLV3knPodCwvjx73Nis
Content-Length: 408
X-PachubeRequestId: d4537ff8cf384d60c00283b4fee6c080492e0222
Set-Cookie: _pachcore_app_session=BAh7BjoPc2Vzc2lvbl9pZCIlZjBjNmFkZDU4ZTFmZWJlNWEHTTP/1.1 200 OK
Date: Fri, 22 Jun 2012 12:42:55 GMT
Content-Type: text/plain; charset=utf-8
Connection: close
Last-Modified: Thu, 21 Jun 2012 02:14:12 GMT
X-Runtime: 65
X-Pachube-Logging-Key: logging.pxLV3knPodCwvjx73Nis
Content-Length: 408
X-PachubeRequestId: d4537ff8cf384d60c00283b4fee6c080492e0222
Set-Cookie: _pachcore_app_session=BAh7BjoPc2Vzc2lvbl9pZCIlZjBjNmFkZDU4ZTFmZWJlNWE5YmEzNWJiNmExZDUxN2M%3D--596913f0ea16c484f53571bc02d23b6083b62416; domain=.cosm.com; path=/; expires=Fri, 06-Jul-2012 12HTTP/1.1 200 OK
Date: Fri, 22 Jun 2012 12:42:55 GMT
Content-Type: text/plain; charset=utf-8
Connection: close
Last-Modified: Thu, 21 Jun 2012 02:14:12 GMT
X-Runtime: 65
X-Pachube-Logging-Key: logging.pxLV3knPodCwvjx73Nis
Content-Length: 408
X-PachubeRequestId: d4537ff8cf384d60c00283b4fee6c080492e0222
Set-Cookie: _pachcore_app_session=BAh7BjoPc2Vzc2lvbl9pZCIlZjBjNmFkZDU4ZTFmZWJlNWE5YmEzNWJiNmExZDUxN2M%3D--596913f0ea16c484f53571bc02d23b6083b62416; domain=.cosm.com; path=/; expires=Fri, 06-Jul-2012 12:42:52 GMT; HttpOnly
Age: 3
Cache-Control: max-age=86400
Vary: Accept-Encoding

30,2012-06-21T01:03:54.979682Z,38
60,2012-06-21T01:03:54.979682Z,90
90,2012-06-21T01:03:54.979682Z,6
120,2012-06-21T01:03:54.979682Z,61
150,2012-06-21T01:03:54.979682Z,53
GO,2012-06-21T01:03:54.979682Z,1
30,2012-06-21T02:14:12.401906Z,58
60,2012-06-21T02:14:12.401906Z,91
90,2012-06-21T02:14:12.401906Z,69
120,2012-06-21T02:14:12.401906Z,75
150,2012-06-21T02:14:12.401906Z,93
GO,2012-06-21T02:14:12.401906Z,0

ANy ideas?? Thanks.

This seemed to have fixed it:
private HTTP_Response _DoRequest(string RequestData)
        {

            // Opens the connection
            this._Socket.Connect();
            // Sends out the request
            this._Socket.Send(RequestData);
            // Fetches the returned data
            string ResponseData = "";
            string tmp = "";
            while (this._Socket.IsConnected || this._Socket.BytesAvailable > 0)
            {
                tmp = this._Socket.Receive();
                if (tmp.IndexOf("HTTP/1.1 200 OK") >= 0)
                {
                    Debug.Print("found OK HEADER at " + tmp.IndexOf("HTTP/1.1 200 OK") + ", resetting input string");
                    ResponseData = tmp;
                }
                else
                    ResponseData += tmp;
            }
            // Closes the connection
            this._Socket.Close();

            // Parses the response data
            HTTP_Response RetVal = new HTTP_Response(ResponseData);
            // Parses cookies and such
            this._ParseHeaders(RetVal.GetAllHeaders());

            return RetVal;
        }

Edited by Stefan, 22 June 2012 - 02:48 PM.
Added [code] tags


#15 Stefan

Stefan

    Moderator

  • Members
  • PipPipPip
  • 1965 posts
  • LocationBreda, the Netherlands

Posted 22 June 2012 - 02:41 PM

Interesting find, I've opened a ticket about it: http://netmftoolbox....om/workitem/731 My guess is that it's not just with the wifly combination. I won't have time this week to fix this, but I will absolutely dive into it in a later point. I'm glad you found a solution, so you're not encountering any problems right now?
"Fact that I'm a moderator doesn't make me an expert in things." Stefan, the eternal newb!
My .NETMF projects: .NETMF Toolbox / Gadgeteer Light / Some PCB designs

#16 fritzE

fritzE

    Member

  • Members
  • PipPip
  • 11 posts

Posted 22 June 2012 - 02:45 PM

quick other issue... in the _SerialPort_DataReceived routine, the *CLOS* issue is confusing my WiFly.
in this case:
else if (_SerialPort_EndStreamCheck == this._SocketCloseString)
                {
                    this._Mode = Modes.Idle;
                    _DebugPrint('D', "2 Left streaming mode");
                    NewBuffer = "";
                }
                this._SerialPort_StreamBuffer = NewBuffer;
when the new $$$ is sent, the response has an extra <2.32>... any ideas here? see below:
I: 2.401906Z,93\nG
I: O,2012-06-21
I: T02:14:12.40
I: 1906Z,0*CLOS
I: *
D: 2 Left streaming mode


30,2012-06-21T01:03:54.979682Z,38
60,2012-06-21T01:03:54.979682Z,90
90,2012-06-21T01:03:54.979682Z,6
120,2012-06-21T01:03:54.979682Z,61
150,2012-06-21T01:03:54.979682Z,53
GO,2012-06-21T01:03:54.979682Z,1
30,2012-06-21T02:14:12.401906Z,58
60,2012-06-21T02:14:12.401906Z,91
90,2012-06-21T02:14:12.401906Z,69
120,2012-06-21T02:14:12.401906Z,75
150,2012-06-21T02:14:12.401906Z,93
GO,2012-06-21T02:14:12.401906Z,0*CLOS
O: $$$
I: <2.32> CMD\r\n

Thanks!

Edited by Stefan, 22 June 2012 - 02:48 PM.
Added [code] tags


#17 Stefan

Stefan

    Moderator

  • Members
  • PipPipPip
  • 1965 posts
  • LocationBreda, the Netherlands

Posted 22 June 2012 - 02:51 PM

The <2.32> is the prompt of the wifly module. It's not really ment to be just a wifi module, it's ment as a serial to wifi socket bridge. I just abuse it to be able to do other stuff.
The closing of a stream was somewhat buggy. Not sure if you noticed this comment?
// The closing string (default: "*CLOS*") is many times sent in multiple packets.
                // This causes annoying issues of connections not shutting down well.
                // This fixes that issue, but it's possible the last few bytes of the stream contain something like "*CL" or something.

"Fact that I'm a moderator doesn't make me an expert in things." Stefan, the eternal newb!
My .NETMF projects: .NETMF Toolbox / Gadgeteer Light / Some PCB designs

#18 fritzE

fritzE

    Member

  • Members
  • PipPip
  • 11 posts

Posted 22 June 2012 - 03:53 PM

The <2.32> is the prompt of the wifly module. It's not really ment to be just a wifi module, it's ment as a serial to wifi socket bridge. I just abuse it to be able to do other stuff.
The closing of a stream was somewhat buggy. Not sure if you noticed this comment?

// The closing string (default: "*CLOS*") is many times sent in multiple packets.
                // This causes annoying issues of connections not shutting down well.
                // This fixes that issue, but it's possible the last few bytes of the stream contain something like "*CL" or something.

Yes, I did. the reason i brought it up is that the WiFly is hanging after i get that response. my guess was that it wasn't finding CMD in response to $$$, but didn't get that far. I'm trying to do 100 loops of HTTP Get from Cosm. it gets to 10-15 before failing....

#19 Stefan

Stefan

    Moderator

  • Members
  • PipPipPip
  • 1965 posts
  • LocationBreda, the Netherlands

Posted 22 June 2012 - 04:30 PM

Yes, I did. the reason i brought it up is that the WiFly is hanging after i get that response. my guess was that it wasn't finding CMD in response to $$$, but didn't get that far. I'm trying to do 100 loops of HTTP Get from Cosm. it gets to 10-15 before failing....

Very interesting! As I said, I'm short in time currently, and the toolbox is 'just a hobby project', so it doesn't have high priority for now. But as soon as I have some free time, I'll look into it.

If you find a solution, please let me know, I'll add it in and give you proper credits for it of course! :)
"Fact that I'm a moderator doesn't make me an expert in things." Stefan, the eternal newb!
My .NETMF projects: .NETMF Toolbox / Gadgeteer Light / Some PCB designs

#20 fritzE

fritzE

    Member

  • Members
  • PipPip
  • 11 posts

Posted 22 June 2012 - 11:51 PM

Very interesting! As I said, I'm short in time currently, and the toolbox is 'just a hobby project', so it doesn't have high priority for now. But as soon as I have some free time, I'll look into it.

If you find a solution, please let me know, I'll add it in and give you proper credits for it of course! :)

Though I feel like I'm masking symptoms, this seems to correct that particular problem:
private void _SerialPort_LineReceived(string Text)
        {
            _DebugPrint('I', Text + "\r\n");

            

            // Did we enter command mode?
            if (Text == "CMD" && this._Mode == Modes.Idle)
            {
                this._Mode = Modes.CommandMode;
                _DebugPrint('D', "Successfully enterred the command mode");
                return;
            }
            else
            {
                if (Text.IndexOf("CMD") >= 0)
                {
                    Debug.Print("FOUND CMD IN STRING: " + Text);
                    this._Mode = Modes.CommandMode;
                    _DebugPrint('D', "Pretending to Successfully enterred the command mode");
                    return;
                }
            }
There are couple other issues... I'll post when i have more to say about..
thx

Edited by Stefan, 23 June 2012 - 08:07 AM.
Added [code] tags





0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users

home    hardware    projects    downloads    community    where to buy    contact Copyright © 2016 Wilderness Labs Inc.  |  Legal   |   CC BY-SA
This webpage is licensed under a Creative Commons Attribution-ShareAlike License.