Ethernet and WiFi clicks, tested!

Here they are both connected and tested to fit nicely with the display and also tested to function securely. I wish we could have finished these last week to ship to you for the holidays but at least now you get a photo for the holidays :slight_smile: … so yeah, happy holidays :partying_face:

4 Likes

I’m looking forward to try these.

1 Like

while waiting to be able to test this, happy holidays to the whole GHI Team :slight_smile:

2 Likes

Yes, Merry Christmas to you Gus, Greg, and all the hard working staff, looking forward to playing next year!!!

2 Likes

+1 !!! Merry Christmas to all !

1 Like

Merry Christmas Ghi staff

Any chance we can get a copy of the test app that you used to test for ourselves? I just got my WiFi Click module today and would like to fast track the WiFi startup and usage. Any and all code will be much appreciated!

We are updating all docs this week. We can then add any extra needed info starting Monday.

Pretty please…:pleading_face::pleading_face::pleading_face: I have time the rest of the week and weekend and wanted to get a jump start on working with the networking (wired and wireless). Sure I can’t get a copy of the test app? I promise I won’t ask for any support until the official docs come out :innocent:

Do you have click modules for wireless?

Yep… Just arrived today. I bought a module from Mouser that has the uFL connector too so I could change out the chipset and use an antenna. I understand they aren’t deemed worthy of use due to security, but my application doesn’t require that level of security.

1 Like

Which WiFi Click did you get?

WiFi 7 Click… It was called out in the WiFi networking tutorials.

1 Like

Ok great. @Dat_Tran can you please share a quick example or if we have the docs done then let’s release the changes

1 Like
{
    var enablePin = GpioController.GetDefault().OpenPin(SC20100.GpioPin.PA15);

    enablePin.SetDriveMode(GpioPinDriveMode.Output);
    enablePin.Write(GpioPinValue.High);

    SpiNetworkCommunicationInterfaceSettings networkCommunicationInterfaceSettings =
        new SpiNetworkCommunicationInterfaceSettings();

    var settings = new GHIElectronics.TinyCLR.Devices.Spi.SpiConnectionSettings()
    {
        ChipSelectLine = SC20100.GpioPin.PD3,
        ClockFrequency = 4000000,
        Mode = GHIElectronics.TinyCLR.Devices.Spi.SpiMode.Mode0,
        DataBitLength = 8,
        ChipSelectType = GHIElectronics.TinyCLR.Devices.Spi.SpiChipSelectType.Gpio,
        ChipSelectHoldTime = TimeSpan.FromTicks(10),
        ChipSelectSetupTime = TimeSpan.FromTicks(10)
    };

    networkCommunicationInterfaceSettings.SpiApiName =
        GHIElectronics.TinyCLR.Pins.SC20260.SpiBus.Spi3;

    networkCommunicationInterfaceSettings.GpioApiName =
        GHIElectronics.TinyCLR.Pins.SC20260.GpioPin.Id;

    networkCommunicationInterfaceSettings.SpiSettings = settings;
    networkCommunicationInterfaceSettings.InterruptPin = SC20100.GpioPin.PC5;
    networkCommunicationInterfaceSettings.InterruptEdge = GpioPinEdge.FallingEdge;
    networkCommunicationInterfaceSettings.InterruptDriveMode = GpioPinDriveMode.InputPullUp;
    networkCommunicationInterfaceSettings.ResetPin = SC20100.GpioPin.PD4;
    networkCommunicationInterfaceSettings.ResetActiveState = GpioPinValue.Low;

    var networkController = NetworkController.FromName
        ("GHIElectronics.TinyCLR.NativeApis.ATWINC15xx.NetworkController");

    WiFiNetworkInterfaceSettings networkInterfaceSetting = new WiFiNetworkInterfaceSettings()
    {
        Ssid = yourSSID
        Password = yourPassword
    };

    networkInterfaceSetting.Address = new IPAddress(new byte[] { 192, 168, 1, 122 });
    networkInterfaceSetting.SubnetMask = new IPAddress(new byte[] { 255, 255, 255, 0 });
    networkInterfaceSetting.GatewayAddress = new IPAddress(new byte[] { 192, 168, 1, 1 });
    networkInterfaceSetting.DnsAddresses = new IPAddress[] { new IPAddress(new byte[]
        { 75, 75, 75, 75 }), new IPAddress(new byte[] { 75, 75, 75, 76 }) };

    networkInterfaceSetting.MacAddress = new byte[] { 0x00, 0x4, 0x00, 0x00, 0x00, 0x00 };
    networkInterfaceSetting.IsDhcpEnabled = true;
    networkInterfaceSetting.IsDynamicDnsEnabled = true;

    networkInterfaceSetting.TlsEntropy = new byte[] { 0, 1, 2, 3 };

    networkController.SetInterfaceSettings(networkInterfaceSetting);
    networkController.SetCommunicationInterfaceSettings
        (networkCommunicationInterfaceSettings);

    networkController.SetAsDefaultController();

    networkController.NetworkAddressChanged += NetworkController_NetworkAddressChanged;
    networkController.NetworkLinkConnectedChanged +=
        NetworkController_NetworkLinkConnectedChanged;

    networkController.Enable();

    while (linkReady == false) ;

    // Network is ready to used
}

private static void NetworkController_NetworkLinkConnectedChanged
    (NetworkController sender, NetworkLinkConnectedChangedEventArgs e)
{
    // Raise event connect/disconnect
}

private static void NetworkController_NetworkAddressChanged
    (NetworkController sender, NetworkAddressChangedEventArgs e)
{
    var ipProperties = sender.GetIPProperties();
    var address = ipProperties.Address.GetAddressBytes();

    linkReady = address[0] != 0;
}

IMPORTANT There is an enable pin which needs to be pulled high on the WiFI 7 click module.

GpioController.GetDefault().OpenPin(SC20100.GpioPin.PA15);
enablePin.SetDriveMode(GpioPinDriveMode.Output);
enablePin.Write(GpioPinValue.High);
2 Likes

@Greg_Norris Thank you! Appreciate you sharing the code! GHI is the best!

And thanks for putting up with my groveling too :wink:

1 Like

I’ve got the WiFi up and running on the SC20260D and it is looking great! :partying_face::partying_face::partying_face:

Can ping the SC20260D from my PC. Now on to bigger things!

Thank you again for the tutorial code! I really appreciate you helping me out!

2 Likes

Documentation is now opened up on Github. There is a post about it. All this and more is located there. That’s where I went…:slight_smile:

I didn’t know it was there… Missed that memo somehow but glad to know where they are now!

We just opened it up. For you…:wink:

3 Likes