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.

mcinnes01

Member Since 14 Jun 2011
Offline Last Active Jun 20 2017 09:27 AM
-----

Posts I've Made

In Topic: MIP tcp/ip stack running on Netduino mini !!

30 July 2014 - 10:08 PM

Hi Valkyrie

 

Sorry its took so long for me to get back and thanks for the TCP example!

 

The problem I am having is that the M2Mqtt library uses System.Net.Sockets and as I have a very limited understanding of how TCP works I am struggling to identify the parts of mIP I need to use to replace the TCP class (MqttNetworkChannel) in the M2Mqtt project and how to go about implementing them.

 

In your example you clearly show a way of creating a socket, but I don't understand how you achieved this or how it can be extended to cover the scenarios required in the Mqtt TCP class.

 

For example System.Net.Sockets provides:

 

.Send()

.Recieve()

.Available()

.Connect()

.Close()

 

Which are used in the MqttNetworkChannel or TCP class.

 

It also seems that the Send, Receive and Available methods return an int value of the number of bytes sent, left in the buffer or available to be received.

 

What I would like to know is, is there any way I can achieve this with mIP?

 

I would very much like to implement your mIP library with mqtt and appreciate any help you can provide :)

 

Thanks again for your help and I hope with your assistance I can give people using any type of netduino or other boards the ability to use pub sub messaging.

 

Andy


In Topic: MIP tcp/ip stack running on Netduino mini !!

24 June 2014 - 08:59 PM

Hi Hanz,

 

Just a quick update, I have confirmation from Paolo who wrote the M2Mqtt library that the network library in his project uses sockets over tcp. There is a TCP class in the mIP library but I wondered if you or anyone else has any ideas or examples of how to implement TCP sockets with mIP. There are great examples of http and UDP but any pointer as to TCP would be greatly appreciated.

 

I guess in regards to my previous post the questions still remain in terms of extending mIP to provide similar structure to System.Net.Sockets in terms of returning int for send, receive and data available?

 

Thanks as ever,

 

Andy


In Topic: MIP tcp/ip stack running on Netduino mini !!

23 June 2014 - 10:09 PM

Hi Hanz,

 

Just wondered if you could give me a few pointers...

 

I am trying to determine what the equivalent mIP method of the following would be:

public int Send(byte[] buffer)
        {
            return this.socket.Send(buffer, 0, buffer.Length, SocketFlags.None);
        } 

And

        public int Receive(byte[] buffer)
        {
            // read all data needed (until the buffer is full)
            int idx = 0;
            while (idx < buffer.Length)
            {
                idx += this.socket.Receive(buffer, idx, buffer.Length - idx, SocketFlags.None);
            }
            return buffer.Length;
        } 

 this.socket.Send is derived from the System.Net.Sockets method:

public int Send(byte[] buffer, int offset, int size, SocketFlags socketFlags);

and this.socket.Receive is from:

public int Receive(byte[] buffer, int offset, int size, SocketFlags socketFlags);

From what I can tell nothing seems to expose a send or receive method that returns a int, my only conclusion would be that this response is returned until the buffer is empty. I guess this would need some adaptation or extension of the mIP methods?

 

 

And finally the only other method I can't work out the mIP equivalent of is as follows, however it may require some extension if its possible:

public bool DataAvailable
{
   get
   {
      return (this.socket.Available > 0);
   }
}

Again drawing from System.Net.Sockets:

public int Available { get; }
 Your guidance would be greatly appreciated :)
 
Many thanks
 
Andy

In Topic: Ethernet Module Update

27 May 2014 - 08:54 AM

Well that's up to you :) I know its frustrating waiting ages and comms could definitely been handled differently by secret labs, but this is the situation which I'm sure is fairly common when developing new transport protocols especially with netmf ever evolving and having to work around the bugs that are inherited with it.

The suggestion of mip + an enc28j60 is a good cheap alternative or at least stop gap. It is from what I understand the same chip on the ethernet board we are all waiting on. Plus it uses spi, so you only really lose 1 pin for chip select if you use other spi modules and the multi spi library, so not much of a sacrifice. I got it working sharing spi with a gpio expander so I actually gained pins as opposed to lost pins. Also in terms of plug and play, bar a resistor and not having a 10 pin connector or shield format, its not far off. At least this way you can move on with your code and project in the mean time, then when the ethernet module lands, fingers crossed this year, you can simply switch out the mip code for the native network code.

Hth

Andy

In Topic: Ethernet Module Update

23 May 2014 - 09:34 PM

Sigh, why don't you just get a cheap ass ENC28J60 module off ebay for < 3 and use the mIP library?

 

At least this is something that WILL get ethernet to the GO without doubt.

 

Module: http://www.ebay.co.u...=item20d966b102

 

mIP: http://mip.codeplex.com/

 

I'm currently trying to get mIP working with M2Mqtt so I can get GO working with Mqtt, it would be cool to have a few other people helping explore this route :)


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.