RN-XV WiFly Module driver - Page 3 - Project Showcase - Netduino Forums
   
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

RN-XV WiFly Module driver


  • Please log in to reply
98 replies to this topic

#41 Stefan

Stefan

    Moderator

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

Posted 12 June 2012 - 05:28 AM

It's hard to see from your picture but I think there are 4 of those on top and 4 in the bottom.

I'm not sure what you mean, but it's all in the description on that page: "This kit includes 4 headers (2 8-pin and 2 6-pin)"
You need to solder them.

Currently, it's not possible yet to use UART on the shield base, but in the future it will be.
"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

#42 carb

carb

    Advanced Member

  • Members
  • PipPipPip
  • 352 posts
  • LocationCrystal River, Florida

Posted 12 June 2012 - 10:02 AM

Giuliano,

I would not use the pins listed from Sparkfun, read the comments, most said that they where too small. You can by strips of pins and cut off the number that you need ( 2 sixes and 2 eights). You need 2 of each only, the pins go through the top of the board and stick out the bottom, do one at a time and hold in place with tape.

Tack solder one pin, make sure the header is flush with board and straight (perpendicular to the board)then solder the rest of the pins, do the next header.

Look on sparkfun to see if they have assymbly instructions. Assembly Tutorial not the one for this board but has how to solder on the pins.

Chuck

#43 Giuliano

Giuliano

    Advanced Member

  • Members
  • PipPipPip
  • 361 posts
  • LocationSimi Valley, CA

Posted 12 June 2012 - 07:32 PM

I'm not sure what you mean


I wanted to confirm with you before I place my order.

From the picture below, you can see one of the stackalbe pins (black plastic thingy) in the top part and in the bottom which sits on top of the N+ blue pins plastic thingy. Are you inserting on top of the blue connectors of the N+ and then also inserting them on top of the Xbee shield? That's why my question if I just get 4 or 8, meaning 2 sets of the link you sent me. I hope I make sense.


Posted Image

#44 Giuliano

Giuliano

    Advanced Member

  • Members
  • PipPipPip
  • 361 posts
  • LocationSimi Valley, CA

Posted 12 June 2012 - 07:34 PM

Giuliano,
You can by strips of pins and cut off the number that you need ( 2 sixes and 2 eights).



Hi Chuck, where should I get the ones you are recommending me?

#45 carb

carb

    Advanced Member

  • Members
  • PipPipPip
  • 352 posts
  • LocationCrystal River, Florida

Posted 12 June 2012 - 09:35 PM

Good question, every where I looked was out of stock or the Sparkfun headers. Adafruit did show stackable header pins that will be back in stock in approximately 5 to 10 day Stackable Headers.

Headers do not come in strips, just the ones that are soldered on one side(my mistake, read the post before heading into work and before coffee).

The Adafruit.Com headers do not state the pin size and may be similar to the Sparkfun headers, but in the past I have not had any complaints with Adafruit products.

If all else fails go with what you can get, Mouser or Digikey may have them but they will likely cost more. :(

Chuck

#46 Kaeptn Linux

Kaeptn Linux

    New Member

  • Members
  • Pip
  • 8 posts

Posted 22 June 2012 - 09:53 AM

You can get the stackable headers perhaps here: http://www.exp-tech....8df73f312917a1a

#47 crawf

crawf

    Member

  • Members
  • PipPip
  • 13 posts

Posted 09 July 2012 - 02:08 AM

Stefan - don't suppose there is any plans to include the 'scan' functionality in the class? Awesome toolbox though, so many useful things!

#48 Stefan

Stefan

    Moderator

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

Posted 09 July 2012 - 07:35 AM

Stefan - don't suppose there is any plans to include the 'scan' functionality in the class?

You're correct ;)
I'm not planning to include the scan functionality since I don't see much added value to an embedded device. I try to keep the stack as simple as possible.
But I am considering to make some APIs so it will be easier to extend the class.

There are a lot of features the wifi module supports, but I don't want to implement myself. If others do so, it would be very awesome.

If you want to participate, please head to http://netmftoolbox....cussions/362540
"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

#49 crawf

crawf

    Member

  • Members
  • PipPip
  • 13 posts

Posted 18 July 2012 - 09:33 AM

You're correct ;)
I'm not planning to include the scan functionality since I don't see much added value to an embedded device. I try to keep the stack as simple as possible.
But I am considering to make some APIs so it will be easier to extend the class.

There are a lot of features the wifi module supports, but I don't want to implement myself. If others do so, it would be very awesome.

If you want to participate, please head to http://netmftoolbox....cussions/362540


Hi Stefan - will do, would love to give back to the awesome project. I ended up writing the function myself, however, there doesn't seem an easy way of 'reading to the end' of the reply from the module. I'm using
this._CommandMode_GetInfo("scan", 3);
but this will only read 3 lines of returned response from the module.

An API would be a great idea :)

I'll probably continue this discussion on Codeplex. Thanks for the awesome work!

#50 NVDPas

NVDPas

    New Member

  • Members
  • Pip
  • 6 posts

Posted 30 July 2012 - 06:42 PM

Hi Stefan,

I'm trying to build a mp3 stream player. I quickly sketched out this code so I had a bit of an idea of how to continue:

WebRequest wre = WebRequest.Create("http://mydomain.com/url.mp3"); WebResponse wr = wre.GetResponse(); Stream stream = wr.GetResponseStream(); music = new MusicShield(SPI.SPI_module.SPI1, FEZ_Pin.Digital.An4, FEZ_Pin.Digital.An5, FEZ_Pin.Digital.Di4); music.Play(stream);It might be the case that I didn't see the right part in your library, but can I open a stream to my file with your code? I think it is clear from the code I already have what I want to do.

#51 Stefan

Stefan

    Moderator

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

Posted 30 July 2012 - 06:57 PM

Hi, Currently thats not supported with these classes. Also, I highly doubt the link speed of the wifly module, over the UART connection will be fast enough to stream MP3 files.
"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

#52 sherlack

sherlack

    New Member

  • Members
  • Pip
  • 1 posts

Posted 29 August 2012 - 06:46 PM

Can I use the RN-XV WiFly Module to make http requests to the netduino?

#53 Stefan

Stefan

    Moderator

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

Posted 30 August 2012 - 05:59 AM

Can I use the RN-XV WiFly Module to make http requests to the netduino?

Hi,

To the Netduino is not possible with my code (yet).
From the Netduino is quite possible!
"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

#54 gomore11

gomore11

    Advanced Member

  • Members
  • PipPipPip
  • 87 posts

Posted 13 September 2012 - 01:30 PM

Hello Stefan.
I have a proyect with a classic Netduino and a RN-XV Wifly module. I´m using your drivers for this module as dll-s. When I deploy my proyect I have the next error:

Resolve: unknown type: Toolbox.NETMF.Hardware.IPWMPort

Error: ff000000

what is happening???? I show you my code:

using System;
using System.Threading;
using Microsoft.SPOT;
using Microsoft.SPOT.Hardware;
using SecretLabs.NETMF.Hardware;
using SecretLabs.NETMF.Hardware.Netduino;
using Toolbox.NETMF.NET;
using Toolbox.NETMF.Hardware;

namespace Prueba_socket
{
    public class Program
    {
        public static void Main()
        {
            // Declares the WiFly module, configures the IP address and joins a wireless network
            WiFlyGSX WifiModule = new WiFlyGSX();
            WifiModule.EnableDHCP();
            WifiModule.JoinNetwork("ETICGuest", 0, WiFlyGSX.AuthMode.MixedWPA1_WPA2, "silverlight");//("Mynetwork", 0, WiFlyGSX.AuthMode.MixedWPA1_WPA2, "MyTopSecretPassword");
            
            // Showing some interesting output
            Debug.Print("Local IP: " + WifiModule.LocalIP);
            Debug.Print("MAC address: " + WifiModule.MacAddress);
            
            // Creates a socket
            SimpleSocket Socket = new WiFlySocket("172.16.32.202", 2000, WifiModule);
           
            // Connects to the socket
            
            Socket.Connect();
            
            // Does a plain HTTP request
            Socket.Send("hola");
            //Socket.Send("Host: " + Socket.Hostname + "\r\n");
            //Socket.Send("Connection: Close\r\n");
            //Socket.Send("\r\n");
            
            // Prints all received data to the debug window, until the connection is terminated and there's no data left anymore
            while (Socket.IsConnected)
            {    
                string Text = Socket.Receive();
                if (Text != "")
                    Debug.Print(Text);}
            
            // Closes down the socket
            Socket.Close();


        }

    }
}

And another question, Can I have access to an extern server with this module?, I mean, access to a server that is located out of my Network?? I couldn´t earn this with this module till today, I want to access, if it´s possible, to a public extern IP.

#55 Stefan

Stefan

    Moderator

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

Posted 13 September 2012 - 01:47 PM

Resolve: unknown type: Toolbox.NETMF.Hardware.IPWMPort

Error: ff000000

Please make sure you're using the latest dlls, or use source files (I prefer that way, also easier in debugging)

And another question, Can I have access to an extern server with this module?, I mean, access to a server that is located out of my Network?? I couldn´t earn this with this module till today, I want to access, if it´s possible, to a public extern IP.

If your wifi is connected to the world wide web, you can.
"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

#56 gomore11

gomore11

    Advanced Member

  • Members
  • PipPipPip
  • 87 posts

Posted 13 September 2012 - 02:14 PM

Yes I´m using the last version, Where could be the problem??? I´m loosing an assembly??? The Netduino gets freezed, with the blue light on continuously,so i have to rewrite the firmware each time I try to deploy :(

#57 Stefan

Stefan

    Moderator

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

Posted 13 September 2012 - 02:16 PM

Yes I´m using the last version, Where could be the problem??? I´m loosing an assembly??? The Netduino gets freezed, with the blue light on continuously,so i have to rewrite the firmware each time I try to deploy :(

Try adding the required .cs files to your project instead, that may help.

Also, rewriting firmware shouldn't be required, then something else is wrong. Make sure you've installed the right netduino SDK 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

#58 gomore11

gomore11

    Advanced Member

  • Members
  • PipPipPip
  • 87 posts

Posted 13 September 2012 - 06:37 PM

Adding the .cs files to the project, also gives me an error in one of the included filesd, in the SocketWifly.cs I think.......I don´t know, tomorrow I will try to write a code based in those you developed. I´ll tell you more tomorrow, thank you!!

#59 gomore11

gomore11

    Advanced Member

  • Members
  • PipPipPip
  • 87 posts

Posted 14 September 2012 - 07:58 AM

Hi Steffan to complete the information, when I add the .cs files to the project and compile it it gives me this two errors:

Error 1 'Toolbox.NETMF.NET.SimpleSocket' does not contain a constructor that takes 0 arguments
Error 2 The type or namespace name 'SocketFeatures' could not be found (are you missing a using directive or an assembly reference?)

they are here: WiflySocket.cs

namespace Toolbox.NETMF.NET
{
    /// <summary>
    /// Simplifies usage of sockets for the WiFly module
    /// </summary>
    public class WiFlySocket : SimpleSocket
    {
        /// <summary>Reference to the network interface</summary>
        private WiFlyGSX _NetworkInterface;
        /// <summary>The remote host name</summary>
        private string _Hostname = "";
        /// <summary>The remote TCP port</summary>
        private ushort _Port = 0;

        /// <summary>
        /// Creates a new socket based on the WiFly socket TCP stack
        /// </summary>
        /// <param name="Hostname">The hostname to connect to</param>
        /// <param name="Port">The port to connect to</param>
        /// <param name="NetworkInterface">Reference to the WiFly module</param>
        public WiFlySocket(string Hostname, ushort Port, WiFlyGSX NetworkInterface)
        {
            this._Hostname = Hostname;
            this._Port = Port;
            this._NetworkInterface = NetworkInterface;
            this.LineEnding = "";
        }

        /// <summary>
        /// Returns a timestamp from an NTP server
        /// </summary>
        /// <returns>The amount of seconds since 1 jan. 1900</returns>
        public override double NtpLookup()
        {
            string ip = this._NetworkInterface.DnsLookup(this._Hostname);
            return this._NetworkInterface.NtpLookup(ip, this._Port);
        }

        /// <summary>
        /// Connects to the remote host
        /// </summary>
        /// <param name="Protocol">The protocol to be used</param>
        public override void Connect(SocketProtocol Protocol = SocketProtocol.TcpStream)
        {
            if (Protocol != SocketProtocol.TcpStream)
                throw new NotImplementedException();
            this._NetworkInterface.OpenSocket(this._Hostname, this._Port);
        }

        /// <summary>
        /// Closes the connection
        /// </summary>
        public override void Close()
        {
            this._NetworkInterface.CloseSocket();
        }

        /// <summary>
        /// Sends string data to the socket
        /// </summary>
        /// <param name="Data">The string to send</param>
        public override void Send(string Data)
        {
            this._NetworkInterface.SocketWrite(Data);
        }

        /// <summary>
        /// Sends binary data to the socket
        /// </summary>
        /// <param name="Data">The binary data to send</param>
        public override void SendBinary(byte[] Data)
        {
            this.Send(new string(Tools.Bytes2Chars(Data)));
        }

        /// <summary>
        /// Returns true when connected, otherwise false
        /// </summary>
        public override bool IsConnected { get { return this._NetworkInterface.SocketConnected; } }
        /// <summary>Returns the hostname this socket is configured for</summary>
        public override string Hostname { get { return this._Hostname; } }
        /// <summary>Returns the port number this socket is configured for</summary>
        public override ushort Port { get { return this._Port; } }

        /// <summary>
        /// Receives data from the socket
        /// </summary>
        /// <param name="Block">When true, this function will wait until there is data to return</param>
        /// <returns>The received data (may be empty)</returns>
        public override string Receive(bool Block = false)
        {
            string RetValue = "";
            do
            {
                RetValue = this._NetworkInterface.SocketRead(-1, this.LineEnding);
            } while (Block && RetValue == "");

            return RetValue;
        }

        /// <summary>
        /// Receives binary data from the socket (line endings aren't used with this method)
        /// </summary>
        /// <param name="Length">The amount of bytes to receive</param>
        /// <returns>The binary data</returns>
        public override byte[] ReceiveBinary(int Length)
        {
            return Tools.Chars2Bytes(this._NetworkInterface.SocketRead(Length).ToCharArray());
        }

        /// <summary>
        /// Checks if a feature is implemented
        /// </summary>
        /// <param name="Feature">The feature to check for</param>
        /// <returns>True if the feature is implemented</returns>
        public override bool FeatureImplemented(SocketFeatures Feature)
        {
            switch (Feature)
            {
                case SocketFeatures.TcpStream:
                case SocketFeatures.NtpClient:
                    return true;
                default:
                    return false;
            }
        }

        /// <summary>Requests the amount of bytes available in the buffer</summary>
        public override uint BytesAvailable { get { return this._NetworkInterface.SocketBufferLength; } }
    }
}



#60 Stefan

Stefan

    Moderator

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

Posted 14 September 2012 - 08:21 AM

Error 1 'Toolbox.NETMF.NET.SimpleSocket' does not contain a constructor that takes 0 arguments
Error 2 The type or namespace name 'SocketFeatures' could not be found (are you missing a using directive or an assembly reference?)

they are here: WiflySocket.cs


Error 1:
Your constructor is invalid, it should contain at least a hostname and a port. This is in your main code I think.

Error 2:
Did you also include the interface? You should also include Framework\NET\SimpleSocket.cs and Framework\Tools.cs at least.
"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




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.