The shield is now working. As expected, of course
It’s not very obvious but the green led on the right is lit, indicating that the Moxa board is ok.
To verify this, it comes with a program that can see it and configure it. It’s located at IP 192.168.0.100 on my network. Teraterm is also seeing it since I have opened a Telnet session on it :
Now, a “real” test session. For this example, the Moxa has been configured to appear as COM8 on my PC. It also communicate with the Panda via its COM1 pins (Panda pins).
I open a session with Teraterm on COM8 and then send chars to this port. On the Panda, it simply echoing what it receives. If it receives the letter “A” then it sends “Hello world !” back to the Moxa, which in turn sends it on the PC COM8 port.
You can see a recording of this test session : http://www.lsp-fr.com/FEZ/moxa/FEZMoxa.htm
And here’s the C# code that is running on the Panda :
public class Program
static readonly SerialPort Uart = new SerialPort("COM1", 115200);
public static void Main()
Uart.DataReceived += UartDataReceived;
static void UartDataReceived(object sender, SerialDataReceivedEventArgs e)
if (e.EventType != SerialData.Chars) return;
var readBuffer = new byte[Uart.BytesToRead];
Uart.Read(readBuffer, 0, readBuffer.Length);
if (readBuffer == 65)
var dataToSend = Encoding.UTF8.GetBytes("\r\nHello World!\r\n");
Uart.Write(dataToSend, 0, dataToSend.Length);
So, to summarize, the Panda can now communicate with any PC on a network via a simple “serial link” mechanism.
I’ve chosen this mode (COM port emulation) because it’s the one I will be using in a real project, but the Moxa can also act as a TCP server/client or in UDP mode.