Hi @AbnerWang ,
I would like to use the Ethernet for simple Tx and Rx for sending commands from PC and reading the response from the device. I saw the enet_txrx_transfer demo project in the sdk. I am not sure how to use the MAC address and send commands from PC. Is there any example which I can refer for this requirement. It would be of great help if you could guide me on this.
Thanks.
Hi,
Do you mean you want to send layer2 MAC frame from PC to board?
Usually I use https://ostinato.org/. Or you can try Python Scapy, but I rarely use script to do this.
Best Regards.
Abner
Hi @AbnerWang,
I am new to Ethernet and if I want to use ethernet to send command from PC just like RS232 what changes should I do in the enet_txrx_transfer project? I see in the code that MAC address
#define MAC_ADDRESS \
{ \
0x54, 0x27, 0x8d, 0x00, 0x00, 0x00 \
}
is assigned to the device. So if from my PC if I want to send command to this address and read back the response from the device, how do I implement it? Can I use Teraterm or other free utilities?
Your help on this is much appreciated.
Thanks.
Hi,
I'm not sure whether the Teraterm support to send layer2 frame. It looks the command you want to send is TCP/IP packets. But SDK driver example only loopback MAC frames. If you want to get response, need to write extra code. Please refer the LwIP examples to find the example such as lwip_ipv4_ipv6_echo_freertos, then use your TCP/IP terminal to send packet to the board. You can get details in example readme.
Best Regards.
Ruijia
Hi @AbnerWang,
My requirement is to send a command to the meter to change a setting in the meter or read the settings from the meter using remote commands from PC. It is just like serial commands using RS232, no need of internet connectivity. I will try the lwip example which you have mentioned.
Just to understand more on the enet_txrx_transfer demo, so is it not possible to do a point to point communication using the MAC address?
Thanks.
Hi @AbnerWang ,
Sorry for asking too many questions. Yes I can write a protocol on RT1060 side to process the received command and respond accordingly. Say if I send "LED 1" from PC then I can decode the command on RT1060 to turn on the LED on receiving this via Ethernet. But I am not sure how to send this command to RT1060 from PC via Ethernet.
Thanks.
Unfortunately I'm not expert on network development in PC environment. What I can tell is you need to find some middleware system interfaces. Whatever Linux or Window shall open some system interfaces to implement this. Or you can use other upper-layer soft module or library just like the Scapy.
Best Regards.
Hi @AbnerWang,
I tried the Ethernet Tx and Rx using the UDP. I would like to know about the port number which we need to mention as 10001 while communicating with the board. Is this the registered port number by NXP to communicate with the boards? Also, using UDP is it possible for me to send messages from PC to multiple boards as the port number will be same?
Thanks.
Hi,
1) What's the 'registered port' you mean? It should not be a vendor registered port, just our example use this port.
2) I don't own those net cases. But I think you may need to modify code, using multicast IP to communicate.