Problem with ethernet shield - can't open again a socket after warm reboot

Thank you stivo,
I think your changes will be useful for us in our new Wiznet driver being worked on.

Nicely done Stivo, great to see you getting in there with both sleeves rolled up!

This is hardly the proper thread for this, but I didn’t want to create a new topic just to complain, but what is with all of the whitespace in that Ethernet file?

I mean, even the Intellisense comments are spaced out to where Visual Studio won’t parse them! The care was taken to create them, but then they’re rendered useless by the excess line breaks!

…granted, perhaps this will all be moot when the final integrated ethernet driver is released, but until then…

Instead of bringing up the driver in a browser and doing a copy and paste, try saving the link to disk via a right click.

I believe the problem is in the browser not the driver.

I tried that some time ago (and again just now). No dice.

I’ve been navel gazing about the warm/cold reset issue and W5100 modules - was going to ask this in the Rhino forum but this thread is actually the most relevant. Does Rhino have specific circuitry to drive the RESET in code (ie connected to a GPIO port )?

Yes Rhino can control reset, this wouldn’t miss GHI designers :wink:

@ IronTek

Code exchange should solve this. Something is happening server-side that is adding the line breaks (or at least we believe) and we haven’t had much luck tracking it down.

Hey Josh, if that’s the case, why not just zip the source files up? I dare the server to add extra newlines when the firggin thing is compressed down. You could probably also do something with PHP.

Its gonna be your mime type setting on the web server for cs files.

Bstag makes a good point. I hadn’t even though of that. Make sure it’s set to text/plain

That doesn’t fix the problem. The files are fine for awhile then the line breaks occur.

That’s weird… Did you clear your cache?

Files look fine to me :think:

No line breaks except for those that are intended.

I’ve tried every browser (Firefox, IE, Chrome, and Safari) and even wget from a different server (thought maybe some firewall at work was doing something weird)…and the file looks like:


namespace GHIElectronics.NETMF.FEZ

{

    public static partial class FEZ_Shields

    {

        static public class Ethernet

        {

etc.

Very soon all drivers will be available from TinyCLR code exchange. Possibly next week, stay tuned!

Hey stivo… It looks like the 2nd code snippet in your post was cutoff… All it shows is

 private Protocol protocol;
                private UInt16 port;
                public uSocket(Protocol protocol, UInt16 port)
                { 
                    this.protocol = protocol ;
                    this.port = port;
                    ReInit();
                }
 
                public void ReInit()
                {
 
                    byte s;
 
 
 
                    for (s = 0; s < 4; s++)
                    {
//....

Can you post the rest of your ReInit method?

i did’nt post it entirely because it’s the same as the old uSocket constructor. I justed memorised the parameters to call again the initialization. that’s why it was called ReInit.

By the the way… I m very productive and eventough I m working just a few hours from time to time on this project… I m soon having a RFID clockwork made with tinyclr. It will start to be tested by my customers in October… :slight_smile:

Here is the entire ReInit()


 public void ReInit()
                {

                    byte s;



                    for (s = 0; s < 4; s++)
                    {

                        if (SocketIsUsed[s] == false)

                            break;

                    }

                    if (s == 4)

                        throw new Exception("No free sockets");



                    if ((protocol == Protocol.TCP) || (protocol == Protocol.UDP) || (protocol == Protocol.IPRAW) || (protocol == Protocol.MACRAW))
                    {



                        _scoket_number = s;

                        //SM
                        this.Disconnect();
                        //SM
                        this.Close();



                        //SM + 128
                        W5100.RegisterWrite(s, W5100.SocketRegisters.MR, (byte)(protocol +128));//| flag));

                        if (port != 0)
                        {

                            W5100.RegisterWrite(s, W5100.SocketRegisters.PORT0, (byte)((port & 0xff00) >> 8));

                            W5100.RegisterWrite(s, W5100.SocketRegisters.PORT0 + 1, (byte)(port & 0x00ff));

                        }

                        else
                        {

                            local_port++; // if don't set the source port, set local_port number.

                            W5100.RegisterWrite(s, W5100.SocketRegisters.PORT0, (byte)((local_port & 0xff00) >> 8));

                            W5100.RegisterWrite(s, W5100.SocketRegisters.PORT0 + 1, (byte)(local_port & 0x00ff));

                        }

                        W5100.RegisterWrite(s, W5100.SocketRegisters.CR, (byte)CR_val.Sn_CR_OPEN); // run sockinit Sn_CR



                        while (W5100.RegisterRead(s, W5100.SocketRegisters.CR) != 0) ;

                        _scoket_number = s;

                        SocketIsUsed[s] = true;



                    }

                    else
                    {

                        throw new Exception("Unknown protocol");

                    }



                    //Debug.Print("Sn_SR = " + W5100.RegisterRead(s, W5100.SocketRegisters.SR).ToString() + " Protocol = " + W5100.RegisterRead(s, W5100.SocketRegisters.MR).ToString());

                }

Our native implementation is complete and we are about to release when done testing.

[quote]Our native implementation is complete and we are about to release when done testing.
[/quote]

Will there be a beta testing period?