CerebusOSS/CereLink

cbpy Runtime error -28

Closed this issue · 12 comments

Hi,

I'm trying to get the cbpy working on 64-bit linux debian and in fact I was already able to make it talk to the NSP once. I have done
sysctl -w net.core.rmem_max=8388608
and
setcap 'cap_net_bind_service=+ep' /path/to/python
and when I do
cbpy.open()
the program hangs for a while and then gives RuntimeError: error -28

When I run the
testcbsdk
it runs successfully.

Could anyone help me debugging this please? Weird enough, I had this working yesterday but can't figure out what's wrong now.

All help would appreciated!

I got this figure out. So I was importing the cbpy under Cerelink-master/cerebus but for whatever reason that was causing problems. When imported the cbpy under Cerelink-master/build/lib.linux-x86_64-2.7/cerebus I got it working.

I noticed that my previous post probably did not make much sense. Anyway then problem of error -28 still persists. Few times I've been able to open a connection but most of the time the connection is timed out. Any ideas?

Can you check the version installed on NSP and the library version. I merged some code that should warn if they mismatch. I also asked for the latest protocol headers from Blackrock.

Please get the latest code.

the NSP version is 6.05.01.00

That might be it then. CereLink supports 6.04. The PR I just merged should warn about version mismatch. I also contacted Blackrock to get the latest protocol files (cbhwlib.h and cbhwlib.c) as soon as I get them I will be able to merge them.

I checked in some code I think will help with error -28 (timeout) problem, if you can check that would be great, I do not have NSP and can only test with nPlayServer. If you want nPlayServer for Linux please email me and I send it to you.

EDIT: it is still not fixed! I am working on it now

Ok I think I found the problem!
The problem is that SysRep packet sometimes is lost. This is UDP stream and therefore the buffers should be large specially at the beginning to make sure all the config packets come and get saved.
Somehow this problem is more evident on Linux. I am going to update the wiki, but here is the limits to set:

    sysctl -w net.core.rmem_max = 16777216
    sysctl -w net.core.rmem_default = 8388608

After this setting I no longer get the timeout. Make sure to get the latest code too.

P.S. no need to set cap_net_bind_service that was for 6.03 when the port number was low.

ehsan, it might be that this was the problem, after setting the rmem_max in the way you said I've been able to open the connection to NSP dozens of time without timeouts. but let me test a little more before closing the issue.

after changing the memory parameters to what you said above I have been using the cbpy for 5 days without a single timeout error.

thanks! I guess this is now solved.

Even using the above memory parameters I do have problems. The first time I run my script from a Linux machine to read UDP packets from the nPlayServer running on a windows machine everything works.
The second time I try to do the same, I do get a timeout error.
Any ideas what may be the problem?
Could you also provide me with a linux version of nPlayServer? Maybe this helps to avoid the problem altogether.
thanks!

@JohnV7 what is a good email address? I can send you nPlayServer for Linux.

Send you a direct message to your email address. Thanks in advance!