The RobotPy project has a new github repo that contains SIP-based python wrappers for NetworkTables that will work on your PC. Currently only the server (robot) side of the wrappers work, but in theory the client side should work with a bit of patching. I won’t be able to work on fixing that until next week.
Ok, found the client bug in WPILib. The python wrappers now will do server and client mode, and there are samples included with the source code that demonstrate this functionality.
First, is this necessary to use SmartDashboard from Python?
Second, RobotPy has a simple installable on firstforge which we used. Is there something comparable for this pynetworktables, or do I need to build from scratch?
Third, if I do have to build it, do I need to build+install robotpy from source too, or does the pynetworktables build process give me something I add on to my robotpy install?
This allows you to use NetworkTables/SmartDashboard from python on your PC. This code does **not **run on the Robot.
This code would be useful if you had something on your driver station or programming laptop that wanted to communicate with your robot code via NetworkTables, or if you were running unit tests on your PC (using fake-wpilib) that use SmartDashboard.
There currently are no binary distributions of pynetworktables, so if you wanted to use it, then you would need to compile it yourself.
I am trying to build the network tables using the instructions on a ODROID-U2 ubuntu - linaro 12.3
linaro@linaro-ubuntu-desktop:~/pynetworktables$ ROBOTPY="/home/linaro/robotpy/" python setup.py build
running build
running build_ext
building ‘pynetworktables’ extension
gcc -pthread -fno-strict-aliasing -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -fPIC -I/home/linaro/pynetworktables/src -I/home/linaro/pynetworktables/sip -I/home/linaro/robotpy/Packages/wpilib -I/home/linaro/robotpy/Packages/wpilib/WPILib -I/usr/include/python2.7 -I/usr/include/python2.7 -c build/temp.linux-armv7l-2.7/sippynetworktablescmodule.cpp -o build/temp.linux-armv7l-2.7/build/temp.linux-armv7l-2.7/sippynetworktablescmodule.o
cc1plus: warning: command line option ‘-Wstrict-prototypes’ is valid for Ada/C/ObjC but not for C++ [enabled by default]
gcc -pthread -fno-strict-aliasing -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -fPIC -I/home/linaro/pynetworktables/src -I/home/linaro/pynetworktables/sip -I/home/linaro/robotpy/Packages/wpilib -I/home/linaro/robotpy/Packages/wpilib/WPILib -I/usr/include/python2.7 -I/usr/include/python2.7 -c build/temp.linux-armv7l-2.7/sippynetworktablesEntryValue.cpp -o build/temp.linux-armv7l-2.7/build/temp.linux-armv7l-2.7/sippynetworktablesEntryValue.o
cc1plus: warning: command line option ‘-Wstrict-prototypes’ is valid for Ada/C/ObjC but not for C++ [enabled by default]
gcc -pthread -fno-strict-aliasing -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -fPIC -I/home/linaro/pynetworktables/src -I/home/linaro/pynetworktables/sip -I/home/linaro/robotpy/Packages/wpilib -I/home/linaro/robotpy/Packages/wpilib/WPILib -I/usr/include/python2.7 -I/usr/include/python2.7 -c build/temp.linux-armv7l-2.7/sippynetworktablesSmartDashboard.cpp -o build/temp.linux-armv7l-2.7/build/temp.linux-armv7l-2.7/sippynetworktablesSmartDashboard.o
cc1plus: warning: command line option ‘-Wstrict-prototypes’ is valid for Ada/C/ObjC but not for C++ [enabled by default]
gcc -pthread -fno-strict-aliasing -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -fPIC -I/home/linaro/pynetworktables/src -I/home/linaro/pynetworktables/sip -I/home/linaro/robotpy/Packages/wpilib -I/home/linaro/robotpy/Packages/wpilib/WPILib -I/usr/include/python2.7 -I/usr/include/python2.7 -c build/temp.linux-armv7l-2.7/sippynetworktablesSendableChooser.cpp -o build/temp.linux-armv7l-2.7/build/temp.linux-armv7l-2.7/sippynetworktablesSendableChooser.o
cc1plus: warning: command line option ‘-Wstrict-prototypes’ is valid for Ada/C/ObjC but not for C++ [enabled by default]
gcc -pthread -fno-strict-aliasing -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -fPIC -I/home/linaro/pynetworktables/src -I/home/linaro/pynetworktables/sip -I/home/linaro/robotpy/Packages/wpilib -I/home/linaro/robotpy/Packages/wpilib/WPILib -I/usr/include/python2.7 -I/usr/include/python2.7 -c build/temp.linux-armv7l-2.7/sippynetworktablesNamedSendable.cpp -o build/temp.linux-armv7l-2.7/build/temp.linux-armv7l-2.7/sippynetworktablesNamedSendable.o
cc1plus: warning: command line option ‘-Wstrict-prototypes’ is valid for Ada/C/ObjC but not for C++ [enabled by default]
gcc -pthread -fno-strict-aliasing -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -fPIC -I/home/linaro/pynetworktables/src -I/home/linaro/pynetworktables/sip -I/home/linaro/robotpy/Packages/wpilib -I/home/linaro/robotpy/Packages/wpilib/WPILib -I/usr/include/python2.7 -I/usr/include/python2.7 -c build/temp.linux-armv7l-2.7/sippynetworktablesSendable.cpp -o build/temp.linux-armv7l-2.7/build/temp.linux-armv7l-2.7/sippynetworktablesSendable.o
cc1plus: warning: command line option ‘-Wstrict-prototypes’ is valid for Ada/C/ObjC but not for C++ [enabled by default]
gcc -pthread -fno-strict-aliasing -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -fPIC -I/home/linaro/pynetworktables/src -I/home/linaro/pynetworktables/sip -I/home/linaro/robotpy/Packages/wpilib -I/home/linaro/robotpy/Packages/wpilib/WPILib -I/usr/include/python2.7 -I/usr/include/python2.7 -c build/temp.linux-armv7l-2.7/sippynetworktablesWriteManager.cpp -o build/temp.linux-armv7l-2.7/build/temp.linux-armv7l-2.7/sippynetworktablesWriteManager.o
cc1plus: warning: command line option ‘-Wstrict-prototypes’ is valid for Ada/C/ObjC but not for C++ [enabled by default]
gcc -pthread -fno-strict-aliasing -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -fPIC -I/home/linaro/pynetworktables/src -I/home/linaro/pynetworktables/sip -I/home/linaro/robotpy/Packages/wpilib -I/home/linaro/robotpy/Packages/wpilib/WPILib -I/usr/include/python2.7 -I/usr/include/python2.7 -c build/temp.linux-armv7l-2.7/sippynetworktablesTransactionDirtier.cpp -o build/temp.linux-armv7l-2.7/build/temp.linux-armv7l-2.7/sippynetworktablesTransactionDirtier.o
cc1plus: warning: command line option ‘-Wstrict-prototypes’ is valid for Ada/C/ObjC but not for C++ [enabled by default]
gcc -pthread -fno-strict-aliasing -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -fPIC -I/home/linaro/pynetworktables/src -I/home/linaro/pynetworktables/sip -I/home/linaro/robotpy/Packages/wpilib -I/home/linaro/robotpy/Packages/wpilib/WPILib -I/usr/include/python2.7 -I/usr/include/python2.7 -c build/temp.linux-armv7l-2.7/sippynetworktablesOutgoingEntryReceiver_NULL_t.cpp -o build/temp.linux-armv7l-2.7/build/temp.linux-armv7l-2.7/sippynetworktablesOutgoingEntryReceiver_NULL_t.o
cc1plus: warning: command line option ‘-Wstrict-prototypes’ is valid for Ada/C/ObjC but not for C++ [enabled by default]
gcc -pthread -fno-strict-aliasing -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -fPIC -I/home/linaro/pynetworktables/src -I/home/linaro/pynetworktables/sip -I/home/linaro/robotpy/Packages/wpilib -I/home/linaro/robotpy/Packages/wpilib/WPILib -I/usr/include/python2.7 -I/usr/include/python2.7 -c build/temp.linux-armv7l-2.7/sippynetworktablesNetworkTableEntry.cpp -o build/temp.linux-armv7l-2.7/build/temp.linux-armv7l-2.7/sippynetworktablesNetworkTableEntry.o
cc1plus: warning: command line option ‘-Wstrict-prototypes’ is valid for Ada/C/ObjC but not for C++ [enabled by default]
gcc -pthread -fno-strict-aliasing -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -fPIC -I/home/linaro/pynetworktables/src -I/home/linaro/pynetworktables/sip -I/home/linaro/robotpy/Packages/wpilib -I/home/linaro/robotpy/Packages/wpilib/WPILib -I/usr/include/python2.7 -I/usr/include/python2.7 -c build/temp.linux-armv7l-2.7/sippynetworktablesOutgoingEntryReceiver.cpp -o build/temp.linux-armv7l-2.7/build/temp.linux-armv7l-2.7/sippynetworktablesOutgoingEntryReceiver.o
cc1plus: warning: command line option ‘-Wstrict-prototypes’ is valid for Ada/C/ObjC but not for C++ [enabled by default]
gcc -pthread -fno-strict-aliasing -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -fPIC -I/home/linaro/pynetworktables/src -I/home/linaro/pynetworktables/sip -I/home/linaro/robotpy/Packages/wpilib -I/home/linaro/robotpy/Packages/wpilib/WPILib -I/usr/include/python2.7 -I/usr/include/python2.7 -c build/temp.linux-armv7l-2.7/sippynetworktablesTableListenerManager.cpp -o build/temp.linux-armv7l-2.7/build/temp.linux-armv7l-2.7/sippynetworktablesTableListenerManager.o
cc1plus: warning: command line option ‘-Wstrict-prototypes’ is valid for Ada/C/ObjC but not for C++ [enabled by default]
gcc -pthread -fno-strict-aliasing -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -fPIC -I/home/linaro/pynetworktables/src -I/home/linaro/pynetworktables/sip -I/home/linaro/robotpy/Packages/wpilib -I/home/linaro/robotpy/Packages/wpilib/WPILib -I/usr/include/python2.7 -I/usr/include/python2.7 -c build/temp.linux-armv7l-2.7/sippynetworktablesStringArray.cpp -o build/temp.linux-armv7l-2.7/build/temp.linux-armv7l-2.7/sippynetworktablesStringArray.o
cc1plus: warning: command line option ‘-Wstrict-prototypes’ is valid for Ada/C/ObjC but not for C++ [enabled by default]
gcc -pthread -fno-strict-aliasing -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -fPIC -I/home/linaro/pynetworktables/src -I/home/linaro/pynetworktables/sip -I/home/linaro/robotpy/Packages/wpilib -I/home/linaro/robotpy/Packages/wpilib/WPILib -I/usr/include/python2.7 -I/usr/include/python2.7 -c build/temp.linux-armv7l-2.7/sippynetworktablesNumberArray.cpp -o build/temp.linux-armv7l-2.7/build/temp.linux-armv7l-2.7/sippynetworktablesNumberArray.o
cc1plus: warning: command line option ‘-Wstrict-prototypes’ is valid for Ada/C/ObjC but not for C++ [enabled by default]
gcc -pthread -fno-strict-aliasing -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -fPIC -I/home/linaro/pynetworktables/src -I/home/linaro/pynetworktables/sip -I/home/linaro/robotpy/Packages/wpilib -I/home/linaro/robotpy/Packages/wpilib/WPILib -I/usr/include/python2.7 -I/usr/include/python2.7 -c build/temp.linux-armv7l-2.7/sippynetworktablesNetworkTableEntryTypeManager.cpp -o build/temp.linux-armv7l-2.7/build/temp.linux-armv7l-2.7/sippynetworktablesNetworkTableEntryTypeManager.o
cc1plus: warning: command line option ‘-Wstrict-prototypes’ is valid for Ada/C/ObjC but not for C++ [enabled by default]
gcc -pthread -fno-strict-aliasing -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -fPIC -I/home/linaro/pynetworktables/src -I/home/linaro/pynetworktables/sip -I/home/linaro/robotpy/Packages/wpilib -I/home/linaro/robotpy/Packages/wpilib/WPILib -I/usr/include/python2.7 -I/usr/include/python2.7 -c build/temp.linux-armv7l-2.7/sippynetworktablesNetworkTableEntryType.cpp -o build/temp.linux-armv7l-2.7/build/temp.linux-armv7l-2.7/sippynetworktablesNetworkTableEntryType.o
cc1plus: warning: command line option ‘-Wstrict-prototypes’ is valid for Ada/C/ObjC but not for C++ [enabled by default]
gcc -pthread -fno-strict-aliasing -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -fPIC -I/home/linaro/pynetworktables/src -I/home/linaro/pynetworktables/sip -I/home/linaro/robotpy/Packages/wpilib -I/home/linaro/robotpy/Packages/wpilib/WPILib -I/usr/include/python2.7 -I/usr/include/python2.7 -c build/temp.linux-armv7l-2.7/sippynetworktablesBooleanArray.cpp -o build/temp.linux-armv7l-2.7/build/temp.linux-armv7l-2.7/sippynetworktablesBooleanArray.o
cc1plus: warning: command line option ‘-Wstrict-prototypes’ is valid for Ada/C/ObjC but not for C++ [enabled by default]
gcc -pthread -fno-strict-aliasing -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -fPIC -I/home/linaro/pynetworktables/src -I/home/linaro/pynetworktables/sip -I/home/linaro/robotpy/Packages/wpilib -I/home/linaro/robotpy/Packages/wpilib/WPILib -I/usr/include/python2.7 -I/usr/include/python2.7 -c build/temp.linux-armv7l-2.7/sippynetworktablesArrayEntryType.cpp -o build/temp.linux-armv7l-2.7/build/temp.linux-armv7l-2.7/sippynetworktablesArrayEntryType.o
cc1plus: warning: command line option ‘-Wstrict-prototypes’ is valid for Ada/C/ObjC but not for C++ [enabled by default]
gcc -pthread -fno-strict-aliasing -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -fPIC -I/home/linaro/pynetworktables/src -I/home/linaro/pynetworktables/sip -I/home/linaro/robotpy/Packages/wpilib -I/home/linaro/robotpy/Packages/wpilib/WPILib -I/usr/include/python2.7 -I/usr/include/python2.7 -c build/temp.linux-armv7l-2.7/sippynetworktablesComplexEntryType.cpp -o build/temp.linux-armv7l-2.7/build/temp.linux-armv7l-2.7/sippynetworktablesComplexEntryType.o
cc1plus: warning: command line option ‘-Wstrict-prototypes’ is valid for Ada/C/ObjC but not for C++ [enabled by default]
gcc -pthread -fno-strict-aliasing -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -fPIC -I/home/linaro/pynetworktables/src -I/home/linaro/pynetworktables/sip -I/home/linaro/robotpy/Packages/wpilib -I/home/linaro/robotpy/Packages/wpilib/WPILib -I/usr/include/python2.7 -I/usr/include/python2.7 -c build/temp.linux-armv7l-2.7/sippynetworktablesArrayData.cpp -o build/temp.linux-armv7l-2.7/build/temp.linux-armv7l-2.7/sippynetworktablesArrayData.o
cc1plus: warning: command line option ‘-Wstrict-prototypes’ is valid for Ada/C/ObjC but not for C++ [enabled by default]
gcc -pthread -fno-strict-aliasing -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -fPIC -I/home/linaro/pynetworktables/src -I/home/linaro/pynetworktables/sip -I/home/linaro/robotpy/Packages/wpilib -I/home/linaro/robotpy/Packages/wpilib/WPILib -I/usr/include/python2.7 -I/usr/include/python2.7 -c build/temp.linux-armv7l-2.7/sippynetworktablesComplexData.cpp -o build/temp.linux-armv7l-2.7/build/temp.linux-armv7l-2.7/sippynetworktablesComplexData.o
cc1plus: warning: command line option ‘-Wstrict-prototypes’ is valid for Ada/C/ObjC but not for C++ [enabled by default]
gcc -pthread -fno-strict-aliasing -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -fPIC -I/home/linaro/pynetworktables/src -I/home/linaro/pynetworktables/sip -I/home/linaro/robotpy/Packages/wpilib -I/home/linaro/robotpy/Packages/wpilib/WPILib -I/usr/include/python2.7 -I/usr/include/python2.7 -c build/temp.linux-armv7l-2.7/sippynetworktablesPeriodicNTThread.cpp -o build/temp.linux-armv7l-2.7/build/temp.linux-armv7l-2.7/sippynetworktablesPeriodicNTThread.o
cc1plus: warning: command line option ‘-Wstrict-prototypes’ is valid for Ada/C/ObjC but not for C++ [enabled by default]
gcc -pthread -fno-strict-aliasing -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -fPIC -I/home/linaro/pynetworktables/src -I/home/linaro/pynetworktables/sip -I/home/linaro/robotpy/Packages/wpilib -I/home/linaro/robotpy/Packages/wpilib/WPILib -I/usr/include/python2.7 -I/usr/include/python2.7 -c build/temp.linux-armv7l-2.7/sippynetworktablesNTThread.cpp -o build/temp.linux-armv7l-2.7/build/temp.linux-armv7l-2.7/sippynetworktablesNTThread.o
cc1plus: warning: command line option ‘-Wstrict-prototypes’ is valid for Ada/C/ObjC but not for C++ [enabled by default]
gcc -pthread -fno-strict-aliasing -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -fPIC -I/home/linaro/pynetworktables/src -I/home/linaro/pynetworktables/sip -I/home/linaro/robotpy/Packages/wpilib -I/home/linaro/robotpy/Packages/wpilib/WPILib -I/usr/include/python2.7 -I/usr/include/python2.7 -c build/temp.linux-armv7l-2.7/sippynetworktablesDefaultThreadManager.cpp -o build/temp.linux-armv7l-2.7/build/temp.linux-armv7l-2.7/sippynetworktablesDefaultThreadManager.o
cc1plus: warning: command line option ‘-Wstrict-prototypes’ is valid for Ada/C/ObjC but not for C++ [enabled by default]
/home/linaro/robotpy/Packages/wpilib/WPILib/networktables2/thread/DefaultThreadManager.h: In member function ‘virtual NTThread* sipDefaultThreadManager::newBlockingPeriodicThread(PeriodicRunnable*, const char*)’:
/home/linaro/robotpy/Packages/wpilib/WPILib/networktables2/thread/DefaultThreadManager.h:23:20: error: ‘virtual NTThread* DefaultThreadManager::newBlockingPeriodicThread(PeriodicRunnable*, const char*)’ is private
build/temp.linux-armv7l-2.7/sippynetworktablesDefaultThreadManager.cpp:68:69: error: within this context
/home/linaro/robotpy/Packages/wpilib/WPILib/networktables2/thread/DefaultThreadManager.h: In function ‘PyObject* meth_DefaultThreadManager_newBlockingPeriodicThread(PyObject*, PyObject*)’:
/home/linaro/robotpy/Packages/wpilib/WPILib/networktables2/thread/DefaultThreadManager.h:23:20: error: ‘virtual NTThread* DefaultThreadManager::newBlockingPeriodicThread(PeriodicRunnable*, const char*)’ is private
build/temp.linux-armv7l-2.7/sippynetworktablesDefaultThreadManager.cpp:95:100: error: within this context
/home/linaro/robotpy/Packages/wpilib/WPILib/networktables2/thread/DefaultThreadManager.h:23:20: error: ‘virtual NTThread* DefaultThreadManager::newBlockingPeriodicThread(PeriodicRunnable*, const char*)’ is private
build/temp.linux-armv7l-2.7/sippynetworktablesDefaultThreadManager.cpp:95:143: error: within this context
error: command ‘gcc’ failed with exit status 1
linaro@linaro-ubuntu-desktop:~/pynetworktables$
You need the current git head of RobotPy to compile pynetworktables. RobotPy uses git submodules now, and if you don’t check it out correctly then pynetworktables will not compile for you.
This is a mandatory update for C++ teams and MUST be installed before competing. Install this build on your development system and rebuild your program. Then deploy the new resultant .OUT file to the robot. The fixed issues are:
Adjusted the packet size of data transmitted with NetworkTables (and SmartDashboard) to avoid excessive number of TCP/IP packets.
Updated minimum CAN Jaguar version to 101 as per rule 61-4.
Added a fix to the Preference class to make it more robust.
Subsystems now only report changes in Test mode (LiveWindow updates)
Removed some unnecessary initialization of some variables.
Added code to make the Scheduler class sendable so that it can be written to the SmartDashboard.
Fixed an issue with numeric arrays in NetworkTables.
Fixed an issue with invalid and/or null pointers in LiveWindow code causing crashes in threaded robot code.
We are using an Odroid running Ubuntu and we have a script to start up automatically. The Odroid is booting before the cRio and trying to connect with the Networktables. This is causing the cRio to not boot at all. Is there a way to check if the network tables are running? Or is there some other way to interface the Odriod to the cRio?
What do you mean by this, and what language are you using on the cRio? Is it your program that’s crashing? What happens when you don’t have the odroid running? If your program is running on the cRio and then the odroid starts, does it crash immediately? More details needed.
FYI, if you were using pynetworktables, update to the latest version of it/RobotPy. There were a number of stupid bugs that would cause crashes and data inconsistencies. The issues should be fixed now.