Main Site Documentation

Beyond Frustrated... is it better now?


#1

Hi. I’ve worked with GHI systems and modules for some time now and, honestly, it’s been one of my most frustrating electronic experiences. Every time I upgraded, code would stop working and it seemed nearly impossible to find the libraries that matched the import statements. LIbraries would disappear and get renamed. Code samples would not work. Code samples didn’t indicate what libraries to import. Every product I had experienced different library issues. I’m about ready to throw in the bucket and call it quits.

However, reading in the ‘news’ blog, it seems GHI may have recognized and addressed this issue. Have things stabilized? Can libraries be easily identified now? Do coding examples actually work? Are there working code examples for ethernet and wifi — this is where I experienced the most trouble (well… in addition to writing to memory, accessing a pin, and well… just about everything)?

I just want to write the code for my modules and not struggle with wondering why my code never works anytime an upgrade is done or spend an hour trying to find a new library name because the import doesn’t seem to match the file name or eliminate sections of code because it no longer works under the new libraries and I can’t find equivalent code.

Is all this fixed?

Thanks for your time.


#2

I agree many changes happened rapidly but this is no longer case, for few months now. The SDK API is locked and the documentation provided by GHI reflects the latest and greatest.

There will always be room for improvements and we are here to listen if you have any suggestions or concerns.


#3

I can confirm this.
From 4.1 to 4.2 there were a lot of changes.
From 4.2 to 4.3 there were some changes too, but usually they were mentioned in the release notes. For some changes there were more detailed information in the documentation or in the forum.
Since 4.3 is out of beta, there were nor breaking changes I can remember.


#4

Try this which I have just chopped out of a working project. I’m assuming you are using 4.3


using System.Threading;
using Microsoft.SPOT;

using GTM = Gadgeteer.Modules;

namespace SpiderEthernet
{
    public partial class Program
    {
        // This method is run when the mainboard is powered up or reset.   
        void ProgramStarted()
        {
            Debug.Print("Program Started");

            #region Ethernet Connection


            if (!ethernetJ11D.NetworkInterface.Opened)
                ethernetJ11D.NetworkInterface.Open();

            if (!ethernetJ11D.NetworkInterface.IsDhcpEnabled)
            {
                ethernetJ11D.NetworkInterface.EnableDhcp();
            }
            ethernetJ11D.NetworkInterface.EnableDynamicDns();

            ethernetJ11D.NetworkDown += ethernetJ11D_NetworkDown;
            ethernetJ11D.NetworkUp += ethernetJ11D_NetworkUp;

            while (ethernetJ11D.NetworkInterface.IPAddress == "0.0.0.0")
            {
                Debug.Print("Waiting for DHCP");
                Thread.Sleep(250);
            }
            string[] DnsAddress = ethernetJ11D.NetworkInterface.DnsAddresses;
            foreach (string dnsAddress in DnsAddress)
            {
                Debug.Print("DNS Address : " + dnsAddress);
            }

            #endregion
        }
        #region Ethernet Event Handlers

        void ethernetJ11D_NetworkDown(GTM.Module.NetworkModule sender, GTM.Module.NetworkModule.NetworkState state)
        {
            Debug.Print("Network Down Event.");
            if (state == GTM.Module.NetworkModule.NetworkState.Down)
            {
                Debug.Print("Network Down");
            }
            else
            {
                Debug.Print("Network UP in the DOWN Event Handler????");
            }

            if (!ethernetJ11D.NetworkInterface.Opened)
                ethernetJ11D.NetworkInterface.Open();
        }

        void ethernetJ11D_NetworkUp(GTM.Module.NetworkModule sender, GTM.Module.NetworkModule.NetworkState state)
        {
            Debug.Print("Network Up Event.");
            if (state == GTM.Module.NetworkModule.NetworkState.Up)
            {
                Debug.Print("Network UP");
            }
            else
            {
                Debug.Print("Network down in the UP Event Handler????");
            }

            Debug.Print("Connected to Network.");
            Debug.Print("IP Address : " + ethernetJ11D.NetworkInterface.IPAddress);
            Debug.Print("Gateway Address : " + ethernetJ11D.NetworkInterface.GatewayAddress);
            string[] DnsAddress = ethernetJ11D.NetworkInterface.DnsAddresses;
            foreach (string dnsAddress in DnsAddress)
            {
                Debug.Print("DNS Address : " + dnsAddress);
            }
        }

        #endregion
    }
}



#5

Thank you all. I will give it another go this evening and see how it goes.

:slight_smile:


#6

@ Sprigo - And Gadgeteer. Which didn’t exist in 4.1 days, I don’t think. It’s one of the bigger changes, since it’s more of a paradigm shift than an API adjustment.


#7

Gadgeteer existed in the 4.1 time frame, I got my first Spider kit and I was using Gadgeteer with 4.1. I have a few code shares from that time that are 4.1 Gadgeteer projects.