![]() |
UDP Recieving Problems
We are trying to send information from a custom labview dashboard to the robot (runs java). We have a regular java applet that I can upload if you would like to see it, that works perfectly. When we try to enable the robot we get robots don't quit. Here is our code. Do you see any problems. Thanks.
Code:
package edu.wpi.first.wpilibj.templates; |
Re: UDP Recieving Problems
Quote:
This thread says that it's probably an uncaught exception somewhere. Are you getting any other information printing out? i.e. stack trace, etc.? |
Re: UDP Recieving Problems
No. When we press enable it goes straight to robots don't quit. Do you see anything that isn't correctly coded for udp?
|
Re: UDP Recieving Problems
Would a possibility be a security exception?
|
Re: UDP Recieving Problems
Quote:
|
Re: UDP Recieving Problems
Quote:
|
Re: UDP Recieving Problems
We have been getting the IO exception.
|
Re: UDP Recieving Problems
We aren't able to open the socket to the labview part can connect to it.
|
Re: UDP Recieving Problems
Can you post the complete output of the console where you are getting the "Robots don't quit" message.
To help point you in the right direction in the mean time: That message means there is an uncaught exception and it bubbled up to the system level. If it is an uncaught IO exception it should tell you a line number as well, but it probably has to do with your something within the udp() function. Are you sure the parameter to connector.open is correct? I believe you should be using a "datagram" protocol instead of a "data" protocol. For example A datagram connection for accepting datagrams on port 1234 "datagram://:1234" A datagram connection for sending to a server on port 1234: "datagram://123.456.789.12:1234" And it also looks like you never instantiate the Datagram variable "data", so its null when you call data.readUTF, and null when you use it as a param in receive(data). But that should throw a null point exception, and you should be seeing that in the console. If you don't that's because the program is failing before it gets to that line, which case your problem lies where you open your connection to the datagram (or maybe you do instantiate it somewhere and I just didn't notice it). You mentioned that you have a java applet that works. Is that written using the same version of JavaME that is running on the cRIO? My guess is that you copied your code from the applet to the CRIO, however, if the code was written under different java environments it will not be able to run on the cRIO without modification. Hope that helps. Kevin |
Re: UDP Recieving Problems
We had issues with networking in general. We used TCP for our robot-OI communication. I'd assume it's a bug on the FRC side, as opposed to yours - our code would work 3/4 of the time, and require a robot restart if it failed.
|
Re: UDP Recieving Problems
Quote:
|
| All times are GMT -5. The time now is 09:14. |
Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Copyright © Chief Delphi