Wiz550io Mbed Matlab bidirectional communication
Ethernet Chips
No replies yet. Be the first to reply.
Join the discussion.
Ethernet Chips
No replies yet. Be the first to reply.
Join the discussion.
Share projects and connect with makers.
Joined before the site update? first.
New to WIZnet Makers?
We sent a verification link to your address. Open it to activate your account, then log in.
Accounts from this email provider are reviewed by an administrator after verification. Approval usually takes one business day.
Already have an account?
Enter your email address. If it belongs to an account, we'll send a link to set a new password. Members who joined before the site update use this to set their password.
If an account uses that address, we sent a link to set a new password. The link works once and expires in 30 minutes.
Know your password?
Need an account?
RE: Wiz550io Mbed Matlab bidirectional communication
by Eugeny ·
More information is needed from you. I see you have some debug output in the code. You need to tell us HOW you are unable to send data. Where process fails. Which error messages you have. Do you use same communication session for data exchange (server connects W5500 module, sends info to it, and then waits to get data reply back)? Or W5500 module is expected to contact server independently and flush its data to server?
RE: Wiz550io Mbed Matlab bidirectional communication
by randomizer ·
Thanks for the reply. I am printing messages to a hyperterminal/Uart/teraTerm interface to see the progress of the code. I am new to this field, but here is my understanding:
Well Matlab (code attached) is not reading any data and it times out.
At present, a simple code is used such that when Matlab sends a commands GET10.55, wiz5500 should reply with the same message. Wiz550 is receiving this command as I am printing it to a hyperterminal of a PC. On the other side, matlab is not displaying data received but displays “2 Failed!”, and this message is only possible (I believe) if TCP on the matlab side times out.
RE: Wiz550io Mbed Matlab bidirectional communication
by Eugeny ·
In your W5500 code it is not seen which settings you use. Gateway address is a valid address of the gateway? MAC address? Source port? Destination port (should be 8080)?
RE: Wiz550io Mbed Matlab bidirectional communication
by randomizer ·
Thanks, all these settings are correct as I am receiving data from Matlab or PC. However, in the other direction: there is some issue either with the wiz550 code or Matlab code.
RE: Wiz550io Mbed Matlab bidirectional communication
by Eugeny ·
We can be sure that you have correct and enough setting for W5500 to receive data. But you have problems with sending, and what you currently have is not enough to perform this operation - either from configuration or software points of view. I asked for specific information, if you do not provide it I can not help.
RE: Wiz550io Mbed Matlab bidirectional communication
by randomizer ·
Thank you! It took a little while to succeed with bidirectional communication, but the code is continuously polling which blocks the while loop. But, as expected I am missing data most of the time.
Is it possible to have an ISR for transferring the data? My progress with ISR has been slow, but I am attaching my code if you would like to view all the information, as you suggested in your last reply.
Thank you once again!
MatlabToFromNucleo_gcc_arm_nucleo_f401re.zip (527 KB)
RE: Wiz550io Mbed Matlab bidirectional communication
by Eugeny ·
Where is this code (the project you attached is big one, please point to the specific code).
In general YOU write or adjust the code according to your requirements. If you need real bidirectional communication, then there should be a loop which will check both channels - receive channel, and thus if there’s anything in there get the data from it and instruct W5500 continue receiving using RECV command, and sending - if application needs to send something your W5500 driver should check for free send buffer, place data there and issue SEND command.
You use TCP, you simply can not miss data which have been communicated
Your task, as I said above, is to regularly check for both receive and send “tasks”.
Interrupts will add another layer of complexity to your design - I think you better make things work in as simple as possible way.
RE: Wiz550io Mbed Matlab bidirectional communication
by randomizer ·
Here is the code that I have been working with, but I am not including any wiznet libraries which are available at [url]W5500Interface - This is the Interface library for WIZnet W5500 ch… | Mbed.
Initially, I tried this [url]frdm_Ethernet_WIZ550io - How to implement WIZ550io on FRDM-KL25Z. Refer to… | Mbed
However, it blocks the while loop, hence any other (non Ethernet related) code cannot be executed. Therefore, I am trying the possibility of using an interrupt which will set a flag that will be used to read the new data and send data as required. My current code is attached.
As I am understanding from your comments: The wiz550io device will continue to fill incoming data to its eight sockets then perhaps overlaps. I can read data from these sockets any time? Is this correct?
main.cpp (10.2 KB)
RE: Wiz550io Mbed Matlab bidirectional communication
by Eugeny ·
No. For TCP when you start connection with remote device and it sends some data, W5500 receives this data until its RX buffer is full. Then W5500 sends special packet to remote device to suspend communication. Remote device will not send anything else until W5500 sends another special packet to it instructing it to continue sending. This packet sending is triggered by “RECV” command which informs W5500 about freed RX buffer, and makes W5500 sending that special packet to remote host.
My explanation probably is not completely correct, but it gives you idea how it works.
With incoming data you should do two actions: read data which W5500 received, and reset TX RD pointer to the end of data which you have read. This will inform W5500 that there’s free space in RX buffer now; then you issue RECV command, and it continues communication until (a) RX buffer is full again, or (b) remote host has disconnected.
You do not need interrupt to set flags. Flags are already there - either you use IR interrupt register, or you regularly check socket pointers (e.g RX_RSR for received size). ISR is usually used to perform the job flushing from or putting data into W5500 socket buffers and perform data transfers.