Closed virtuald closed 4 years ago
Tested this with a python client -> python server, sequence number rollover seems to be handled fine.
Client:
#!/usr/bin/env python3
import sys
import time
from networktables import NetworkTables
# To see messages from networktables, you must setup logging
import logging
logging.basicConfig(level=logging.DEBUG)
if len(sys.argv) != 2:
print("Error: specify an IP to connect to!")
exit(0)
ip = sys.argv[1]
NetworkTables.initialize(server=ip)
sd = NetworkTables.getTable("SmartDashboard")
for i in range(1000000):
if i % 100 == 0:
print(i)
sd.putNumber("dsTime", i)
NetworkTables.flush()
time.sleep(0.001)
Server:
#!/usr/bin/env python3
import time
from networktables import NetworkTables
# To see messages from networktables, you must setup logging
import logging
logging.basicConfig(level=logging.DEBUG)
NetworkTables.initialize()
sd = NetworkTables.getTable("SmartDashboard")
# hack: grab internals for debugging
with NetworkTables._api.storage.m_mutex:
entry = NetworkTables._api.storage._getOrNew("/SmartDashboard/dsTime")
i = 0
while True:
print("dsTime:", entry.value, entry.seq_num)
sd.putNumber("robotTime", i)
time.sleep(1)
i += 1
I've been told that in 2019 LabVIEW had an issue with this, so it sounds like it's either (a) an interop issue or (b) a problem with LabVIEW. I'd like to know if the user can reproduce this with the ntcore library.
This is apparently a known issue regarding ntcore/LabVIEW interoperability, so going to close as not a bug.
Reported from a user via email:
We have used your library PyNetworkTables on our raspberry 4, for vision processing purposes and we've ran into some issues regarding to your library.
After examing the behaviour of the library, We discovered that sometimes, after ~32900 value sending, The NT server freezes. We need to declare:
for example:
If you take the basic example from your ReadTheDocs and make a simple LabVIEW listener, we have found that after the ~32900 the library freezes.
We have tried to do so on every version from 2016-->2020 and this error accurs from 2017 and up. 2016 is obslete so we cannot use it operationally.