In various Wii U homebrew applications such as this one there are logger.c and logger.h functions which apparently write debug logs over the network. I've been wondering how to get them to work properly so I can see them in a console window.
Which IP address has to be passed in log_init()? The Wii U's or PC's local IP address? I assume it's the PC's since that makes a lot more sense so I edited the call respectively:
Then on the PC I assume that I need to run some kind of client to connect to the Wii U's IP address and port 4405 since the latter is hardcoded. We then keep reading the messages indefinitely. To do this, I wrote the following client code in Java:
When I start the Java client on the PC and the homebrew application on the Wii U, the Java client never connects and stays stuck on "Connecting...". Can someone help? I haven't seen an explanation for this anywhere except for here but it does pretty much what I do.
At second thought, in case the PC is the server (which again makes more sense), I tried this code:
Same problem, it never connects when I start the server and then load the homebrew application. Clearly, log_init() is called and written to from the Wii U.
@QuarkTheAwesome
@gudenaurock
@Maschell
@dimok
@shinyquagsire23
@NWPlayer123
Which IP address has to be passed in log_init()? The Wii U's or PC's local IP address? I assume it's the PC's since that makes a lot more sense so I edited the call respectively:
Code:
log_init("192.168.2.103");
Code:
import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.net.ConnectException;
import java.net.Socket;
public class EchoClient
{
public static void main(String[] arguments) throws Exception
{
System.out.println("Connecting...");
Socket socket;
// Keep trying to connect
while (true)
{
try
{
socket = new Socket("192.168.2.101", 4405);
break;
} catch (ConnectException ignored)
{
}
}
BufferedReader bufferedReader = new BufferedReader(new InputStreamReader(socket.getInputStream()));
System.out.println("Connected!");
// Keep reading from the network and print it out
while (true)
{
String line = bufferedReader.readLine();
System.out.println(line);
}
}
}
At second thought, in case the PC is the server (which again makes more sense), I tried this code:
Code:
import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.net.ServerSocket;
import java.net.Socket;
public class Server
{
public static void main(String[] arguments) throws Exception
{
System.out.println("Creating server socket...");
try (ServerSocket listener = new ServerSocket(4405))
{
System.out.println("Waiting for client...");
while (true)
{
try (Socket socket = listener.accept())
{
BufferedReader bufferedReader = new BufferedReader(new InputStreamReader(socket.getInputStream()));
System.out.println("Client connected...");
while (true)
{
String line = bufferedReader.readLine();
System.out.println(line);
}
}
}
}
}
}
@QuarkTheAwesome
@gudenaurock
@Maschell
@dimok
@shinyquagsire23
@NWPlayer123