i am using Digi-ME and WI-ME devices in my application, where small data packages (20-30 Bytes) have to be interchanged as quick as possible.
The Digi-Me device is connected to a fast microcontroller on one hand. On the other hand I have a PC. For transport I have selected the TCP Sockets Profile, setting the baud-rate to 115200bps.
What I am able to achieve over lan/wlan is hardly 10% of the data throughput i get with a serial cable between microcontroller and PC.
Can anybody give me a hint how to improve speed ?
I have the same problem.
If data is in 30kB blocks speed is like normal hard serial port. But if I send small data blocks (30Bytes) for and back data rate is VERY small (2-10% of nominal transfer rate).
I worked about that and foud out it because direction chanes takes 30-200ms. So if clear data transmit of 30 Bytes for one direction takes 3ms, and for back direction takes 3ms, AND additionally direction-change-time takes 80ms, then finally transmition of 60 Bytes takes 86ms. It makes less than 9600 bps.
But I have no idea how can I change it.
Not to brag, but I am running an application that among other things uses the serial port to communicate with an external UART at the max rate of 230Kb/sec without a glitch (so far). The only thing that comes to mind that you guys may wanna look at is the bsp.h file in the src/bsp/platforms/connectme directory and change BSP_SERIAL_FAST_INTERRUPT from FALSE to TRUE and recompile the bsp/bootloader and your application. I also have my serial recieve and serial send functions running as separate threads with default priority.
My application does not translate traffic from serial to Ethernet and vice versa, but rather it takes data from an UART (MODBUS formatted message) and stores it into registers and provides HTTP and MODBUS-over-TCP access. My Ethernet (MODBUS/TCP) thread is independent from the serial part. But I see no reason why you cannot set two threads, one that listens to the serial port for any incoming bytes and one that listens to the Ethernet socket. I would use mutex locking in both cases you do want to lock the serial port until you are done sending or receiving.