Hi all I’d like to go on starting from this thread
https://forum.rakwireless.com/t/how-to-use-spi-communication-with-rak3172/8022/7
but I open a specific thread for clarity.
I’d like to use a W5500 eth controller connected to RAK3272-SiP to build a custom module able to manage 2 communication channels.
I’ve done some test using the RAK13800_W5100S library with partial success:
The example sketch is able to detect the presence of the module, giving the error “no module” if it is not present, but hangs after the “Ethernet.begin” call both in DHCP or fixed IP mode.
As first analyzing step i kindly ask for an hint about the wiring. Currently I’ve just connected 4 SPI wires, is it correct? Have I to connect, and how, other wires ?
Info: the led on the eth plug and on the switch are on and blinking.
Thanks a lot.
The skecth:
/**
@file RAK13800_Ethernet_DHCP_W5100S.ino
@author rakwireless.com
@brief Get an IP address via DHCP and print the address obtained.
@version 0.1
@date 2021-11-02
@copyright Copyright (c) 2021
**/
#include <SPI.h>
#include <RAK13800_W5100S.h> // Click to install library: http://librarymanager/All#RAK13800_W5100S
byte mac[] = {0xDE, 0xAD, 0xBE, 0xEF, 0xFE, 0xED }; // Set the MAC address, do not repeat in a network.
void setup()
{
time_t timeout = millis();
// Initialize Serial for debug output.
Serial.begin(115200);
while (!Serial)
{
if ((millis() - timeout) < 5000)
{
delay(100);
}
else
{
break;
}
}
Serial.println("RAK13800 Ethernet DHCP example.");
Ethernet.init( PA4 );
Serial.println("Initialize Ethernet with DHCP."); // start the Ethernet connection.
if (Ethernet.begin(mac) == 0)
{
Serial.println("Failed to configure Ethernet using DHCP");
if (Ethernet.hardwareStatus() == EthernetNoHardware) // Check for Ethernet hardware present.
{
Serial.println("Ethernet shield was not found. Sorry, can't run without hardware. :(");
while (true)
{
delay(1); // Do nothing, just love you.
}
}
while (Ethernet.linkStatus() == LinkOFF)
{
Serial.println("Ethernet cable is not connected.");
delay(500);
}
}
Serial.print("My IP address: ");
Serial.println(Ethernet.localIP()); // Print your local IP address.
}
void loop()
{
// Add your code here.
}
Output without eth module:
RAK13800 Ethernet DHCP example.
Initialize Ethernet with DHCP.
Failed to configure Ethernet using DHCP
Ethernet shield was not found. Sorry, can't run without hardware. :(
Output with the module
RAK13800 Ethernet DHCP example.
Initialize Ethernet with DHCP.