|
|
|
![]() |
|
|||||||
|
||||||||
![]() |
|
|
Thread Tools | Rate Thread | Display Modes |
|
|
|
#1
|
|||
|
|||
|
Python Network Tables Raspberry Pi 2
I am looking for some in-site on the python network tables. I am using the example code found here. I try to run it and I get and error stating that I need to set my ipadress. I read up on the error here. Where would you put the IP adress and what would it be? It doesn't seem to be that well explain for newbies. Thanks for any help ahead of time.
|
|
#2
|
||||
|
||||
|
Re: Python Network Tables Raspberry Pi 2
Quote:
Code:
NetworkTable.setIPAddress("10.XX.XX.XX")#Your IP goes here
Code:
import time
from networktables import NetworkTable
# To see messages from networktables, you must setup logging
import logging
logging.basicConfig(level=logging.DEBUG)
NetworkTable.setIPAddress("10.XX.XX.XX")#Change the address to your own
NetworkTable.setClientMode()
NetworkTable.initialize()
sd = NetworkTable.getTable("SmartDashboard")
i = 0
while True:
try:
print('robotTime:', sd.getNumber('robotTime'))
except KeyError:
print('robotTime: N/A')
sd.putNumber('dsTime', i)
time.sleep(1)
i += 1
|
|
#3
|
|||
|
|||
|
Re: Python Network Tables Raspberry Pi 2
Quote:
Thanks for you help. |
|
#4
|
||||
|
||||
|
Re: Python Network Tables Raspberry Pi 2
Yes, you would put the address of the roboRio. It has been a while since I used networktables so I don't quite remember, but if I recall correctly, you can use roborio-xxxx-frc.local where xxxx is obviously your team number. If that doesn't work, you can use the 10.xx.xx.?? where the ?? is where the Rio is located on your network. To find this out, connect to the WiFi network and type "roborio-xxxx-frc.local" into your browser(again your team number) and the webpage for the Rio will pop up. There, you will see the exact address of the Rio.
Last edited by team-4480 : 12-05-2016 at 22:16. |
|
#5
|
|||
|
|||
|
Re: Python Network Tables Raspberry Pi 2
Quote:
Quote:
|
|
#6
|
||||
|
||||
|
Re: Python Network Tables Raspberry Pi 2
I haven't ever used it since I have always used the driver station for vision(which is what I assume the Pi is for). It appears that avahi is available through "apt-get" which would pretty easy to install then. Have you tried the script without installing avahi? Does it not work?
|
|
#7
|
|||
|
|||
|
Re: Python Network Tables Raspberry Pi 2
Quote:
|
|
#8
|
||||
|
||||
|
Re: Python Network Tables Raspberry Pi 2
When using a coprocessor (at least this year), you're better off setting everything up with static IPs. There are issues connecting to the roborio when mDNS is used.
|
|
#9
|
||||
|
||||
|
Re: Python Network Tables Raspberry Pi 2
Quite unsurprisingly.
|
|
#10
|
||||
|
||||
|
Re: Python Network Tables Raspberry Pi 2
Yeah my team had a plethora of issues in districts than worked totally fine at MICMP and CMP after switching to static. mDNS just isn't as battle tested as static ip
|
|
#11
|
|||
|
|||
|
Re: Python Network Tables Raspberry Pi 2
Quote:
I've heard about people having troubles with mDNS but I dont know what it is or how to change it? Can someone explain it to me? |
![]() |
| Thread Tools | |
| Display Modes | Rate This Thread |
|
|