WIO Overview → WIOesp & WIOpico
Work In Progress: Do not translate. |
Goal is to provide a Pico with an ethernet connection W5500.
The W5500 is controlled by SPI and the WIOpico-ETH will use the same pin mapping as the WIOpico 16 I/O CAN.
Use the following terminal command to activate the EthCon in WIO:
*ethcon=1
This is bit 0 in options7.
A reboot is needed.
To be able to set the hostname the Ethernet Library must be modified.
In Arduino/libraries/Ethernet/src/Dhcp.cpp
the following code must be added/extended:
const char* g_DhcpHostName = ""; // ***** NEW code line void DhcpClass::send_DHCP_MESSAGE(uint8_t messageType, uint16_t secondsElapsed)
// OPT - host name buffer[16] = hostName; // ***** start NEW code lines if( strlen( g_DhcpHostName ) > 0 ) { buffer[17] = strlen(g_DhcpHostName); strcpy((char*)&(buffer[18]), g_DhcpHostName); } else { // ***** end NEW code lines buffer[17] = strlen(HOST_NAME) + 6; // length of hostname + last 3 bytes of mac address strcpy((char*)&(buffer[18]), HOST_NAME); printByte((char*)&(buffer[24]), _dhcpMacAddr[3]); printByte((char*)&(buffer[26]), _dhcpMacAddr[4]); printByte((char*)&(buffer[28]), _dhcpMacAddr[5]); } // ***** NEW code line