Proper way to set up WiFi module through UART?

I’m attempting to set up a WiFi ESP Click module that is connected to an SC20260D via UART bus 2. The WiFi tutorial covers connection over SPI (which the module unfortunately lacks), but does not cover any details over UART. I’ve attempted some code below as a start but keep running into null and mismatching type errors. I was hoping someone could point me in the right direction. Thanks!

//Start a WiFi connection
var netInterfaceSettings = new UartNetworkCommunicationInterfaceSettings()
{
    ApiName = ???,
    BaudRate = 115200,
    DataBits = 8,
    Parity = UartParity.None,
    StopBits = UartStopBitCount.One,
    Handshaking = UartHandshake.None
};

var wifiSettings = new WiFiNetworkInterfaceSettings()
{
    DhcpEnable = true,
    DynamicDnsEnable = true,
    Ssid = "CoolWifiName",
    Password = "password1234"
};

var networkController = NetworkController.FromName(???);
networkController.SetCommunicationInterfaceSettings(netInterfaceSettings);
networkController.SetAsDefaultController();
networkController.NetworkAddressChanged += WifiAddressChanged;
networkController.NetworkLinkConnectedChanged += WifiConnectionChanged;
networkController.Enable();

This wifi click has nothing to do with “WiFiNetworkInterfaceSettings” or our WiFi classes.

You need to look at user manual of that wifi click to see how communicate by UART, then use Uart and talk to.

1 Like

Wifi on endpoint is for specific USB wifi adapters only.

Correct but uart is available for those interested in using things like esp32 through their AT commands. But this still be a uart from the systems perspective, not more.

1 Like

Unless some brave person from Wilderness labs decides to share their ESP32 UART to TCP/IP driver with the group. That would be soo cool

Tcp to uart? How is this different from the original AT commands?

No Different. they implemented the code on the ESP to respond and act like a normal wifi “modem”, then wrote the driver for Linux to know how to control that modem.

Linux? I am more confused now :grin:

1 Like

Do you want native TCP/IP or is a dotnet driver ok?
Will this work? : GitHub - PervasiveDigital/serialwifi: .Net Support for serial Wifi devices like the ESP8266
It provides socket-level access, plus some DNS, NTP, BOOTP/DHCP support.
You’ll have to translate it from the original Sanskrit (netmf) but the code should translate mostly intact.

1 Like

Wow, lots of answers! I completely missed the ESP vs ATWINC difference :face_with_spiral_eyes: that’s my bad. Fortunately the AT command set isn’t too complicated, so I I’ll just try and set up my own library. Thanks everyone!

1 Like

Oh. Do tell how that turns out.

Directly interfacing with an ESP WiFi is easy, The challenge would be integration with network stack to get socket support.

@mcalsyn I’m still using your driver, but with the parts I’m using extracted to a separate compile module which builds in TinyCLR for our SC20260 boards and NetMF 4.3 for our G120 boards.

I’ve fixed a few problems (eg ESP8266 TCP RX buffer is actually a lot smaller than they document!) and added some functions (we needed live RSSI tracking of connected AP), but what is there is pretty reliable.

It has diverged too far from your original to try and merge, but I’m happy to put it up somewhere on Github or elsewhere for others to use.

1 Like

Yes, please do! Glad to hear that it was of use.

First pass, no Readme or docs, untested branch split so may not have all the required parts.
https://github.com/C-Born-Software/ESP8266Library.git

1 Like