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.
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.
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.
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.
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.
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.
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!
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 = newMusicShield(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.
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.
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:
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.
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.
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
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.
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!!
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; } }
}
}
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.