NativeEthernet library and two socket clients

juanperez

Member
Hi all,

I have a problem with some code where I use two socket clients.

One of them connects to a server external, I receive data from this server and send data (or in theory they are sent, I can't check it).

On the other hand, I have another client connected to a different server, this one is my property. In the latter, data is sent, which is received for a few seconds, but then nothing is received, although the teensy seems to send it, since no error appears, and I also have this code
C++:
size_t bytessend = socketClient.print((const char *)buffer);
that return the total number of correct bytes, but nothing reaches the server.
It is not a problem on the server side, since I have tried with other devices and everything works OK, so I deduce that the problem is on the teensy side.

Additionally I have noticed that if I perform a
C++:
socketClient.flush();
the other connection (the one on the external server) starts to fail and disconnects, I don't know why.

This is my clients definitions:
C++:
EthernetClient socketClient;
EthernetClient ntripClient;

Any idea?
 
May I suggest giving the QNEthernet library a try and see if you see the same issues? There’s lots of information in the Readme and examples.
 
Ok, now try QNEthernet library, but on compile show me this error:

Code:
.pio\libdeps\teensy41\QNEthernet\src\sys_arch.cpp:191:3: error: 'srand' is not a member of 'std'
 
I’ve already fixed that issue in the latest code. Can i see your platformio.ini file?
 
This is my platformio.ini:

Code:
[env:teensy41]
platform = teensy
board = teensy41
framework = arduino
monitor_speed = 115200
lib_deps = ssilverman/QNEthernet@^0.27.0

Thanks!
 
Try this:
Code:
lib_deps = https://github.com/ssilverman/QNEthernet.git
That gets the latest.

You may need to also delete .pio/libdeps/teensy41/QNEthernet.
 
Back
Top