I'm having exactly the same problem. I'm transmitting data with my program attys_scope. It's using QT for the UDP transmit and under Windows it works. Under Linux it won't. I've tried the nc -klu and it also just gives one line back. However the same problem arises when I use a python program which reads from the UDP socket. Under Windows it works. Under Linux it doesn't. So it might be something deeper in the kernel.
Python script which works under Windows but not under Linux:
# socket connection to attys_scope
s = socket.socket(socket.AF_INET,socket.SOCK_DGRAM)
listen_addr = ("",65000)
s.bind(listen_addr)
f = s.makefile()
# init the amplitudes
amplitudes = np.zeros(2)
# for the thread below
doRun = True
# read data from the udp socket into two variables
# note you need to have at least two analoge channels on
# this just overwrites the amplitudes as fast as possible
# for an oscilloscope plot we need a proper ringbuffer here!
def readSocket():
global amplitudes
while doRun:
# check if data is available
data = f.readline()
values = np.array(data.split(','),dtype=np.float32)
values = np.fabs(values)
amplitudes = values[9:11]
I'm having exactly the same problem. I'm transmitting data with my program attys_scope. It's using QT for the UDP transmit and under Windows it works. Under Linux it won't. I've tried the nc -klu and it also just gives one line back. However the same problem arises when I use a python program which reads from the UDP socket. Under Windows it works. Under Linux it doesn't. So it might be something deeper in the kernel.
Python script which works under Windows but not under Linux: socket( socket. AF_INET, socket. SOCK_DGRAM)
# socket connection to attys_scope
s = socket.
listen_addr = ("",65000)
s.bind(listen_addr)
f = s.makefile()
# init the amplitudes
amplitudes = np.zeros(2)
# for the thread below
doRun = True
# read data from the udp socket into two variables data.split( ','),dtype= np.float32)
# note you need to have at least two analoge channels on
# this just overwrites the amplitudes as fast as possible
# for an oscilloscope plot we need a proper ringbuffer here!
def readSocket():
global amplitudes
while doRun:
# check if data is available
data = f.readline()
values = np.array(
values = np.fabs(values)
amplitudes = values[9:11]
bp1@bp1- Precision- WorkStation- T5400:~ /sandbox/ attys_scope/ python$ nc -klu 65000 -30.928297, 7.316680, -2.791639, 0.000013, -0.000020, 0.000015, 0.247545, 0.001498, -0.000834, 0.001498
491.859985,
QT program which transmits the datagrams (inspired by the QT examples which won't require a bind):
void ScopeWindow: :startUDP( int port)
{
udpSocket = new QUdpSocket(this);
udpPort = port;
_RPT1(0, "UDP transmit on port %d\n",port);
}
void ScopeWindow: :stopUDP( )
{
delete udpSocket;
udpSocket = NULL;
}
void ScopeWindow: :writeUDP( ) { attysComm[ 0]->getSampling RateInHz( ))); scope-> channel[ n][i]-> isActive( )) { n][i]; tmp+strlen( tmp), ",%f", phy); tmp+strlen( tmp), ",%f", phy); tmp+strlen( tmp), "\n"); >writeDatagram( tmp, strlen(tmp), QHostAddress: :Broadcast, udpPort);
if (!udpSocket) return;
char tmp[256];
sprintf(tmp, "%f", ((float)nsamples) / ((float)
for (int n = 0; n < nAttysDevices; n++) {
int nFiltered = 0;
for (int i = 0; i < channels_in_use; i++) {
if (attys_
nFiltered++;
}
float phy = unfiltDAQData[
sprintf(
}
for (int i = 0; i < nFiltered; i++) {
float phy = filtDAQData[n][i];
sprintf(
}
}
sprintf(
if (udpSocket) {
if (udpStatus > -1) {
udpStatus = udpSocket-
//_RPT1(0, "%s", tmp);
}
}
}
This script works find under Windows. I use s similar programs as nc under Windows and there everything is fine.
Kernel issue?