In the official Tech Support Channel, @Banfa wrote:
I find it rather irritating that with 25+ years programming experience under my belt I don’t seem to be able to get something that is aimed at students working correctly. Of course this is not helped by only having 1 hour per week and working in an environment where the computers are old and slow and absolutely everything is locked down and no (present in the classroom) has admin access.
Anyway enough pointless complaining and onto the problems at hand: there are 2 current problems we have.
We only seem to be able to upload code to the Cortex via a direct serial link (using USB A-A cable (the very existence of such a thing shocks me to my core, very much against the USB standard I believe)) if we try to do this via VEXNet with the Joystick connected to the PC we get a could not communicate error (I would post a picture but I’m at work and have no access to the PC/Robot right now).
Having downloaded and run the program via RobotC it is not clear how you get the program to run again once you have detached the Cortex from the PC. Is the program just supposed to run when you switch it on.
… oh … there are 3 current problems we have
Before we downloaded a program to the Cortex when you switched on the Cortex and Joystick they would connect and then you could control the Robot manually using the Cortex. Having downloaded a program (a simple one that just switch on all the drive motors for 5 seconds) when we switch on the Cortex and Joystick the seem to connect (all the lights go green) but nothing happens, our downloaded program does not seem to run and the Joystick does not have any control over the robot.
… ah … among the many problems we are currently having
I feel like I am missing some documentation I am using VEXnet-UserGuide-20150210.pdf but that has a single paragraph on programming. I feels like I am missing the bit of documentation that says “When you have downloaded your program to the Cortex this is what you can expect to happen. If you want to get back to the previous behaviour of the Joystick and Cortex this is what you need to do.”
What are the different communications modes “VEXNet or Use”, “USB Only”, “Competition (VEXNet)” about. that doesn’t seem to be explained anywhere.
Easy ones first. And, I’ll note, this is the lilkely source of some of your problems. These (“VEXNet or USB”, “USB Only”, “Competition (VEXNet)”) are really boot flag values that the RobotC run time system (by convention, called the “RobotC Firmware”) pays attention to when it restarts.
There is a variable (which just maps to a single memory location) that RobotC RTS reads when you recycle the power. The value stored there tells the firmware whether to look for a VEXNet key, and whether to run without it.
And if there is ever a conflict between what someone else says and what @jpearman says, put your money on JPearman. That isn’t true in every last case, but it’s your best bet. With this exception: He may try to disagree with this particular point. He will be wrong if he does.
Issue 1: This is a driver issue for the programming cable. You will also want to update firmware for the joystick, the cortex and robotC-specific cortex. So, four things to update and having one be more current than the others can cause problems with the download/execution of the program. You will need to track down an admin to make the driver update for the programming cable and, depending on the network security, you may need to log on as that admin do use it. So, if you can be granted admin on a specific computer, that would be best.
Issue 2 (and sort of 4): If not connected to a PC via vexnet, the program will run whatever is in task main (or the usercontrol task in competition template) on every restart. When not connected to a PC, you can use a field switch to set what code is run within the competition template. When using the programming cable, there is a competition control debug widow with the same functionality.
Issue 3/4: Not sure. There is a troubleshooting guide here that is tangentially related, that you might find useful.
I sent the following to the OP in a PM. If I made any errors, please correct them. I was in a rush.
"Ben,
I will attempt to address some of your questions/concerns. (My responses in bold)
First let me say, just for future reference. The Technical Support Channel is limited to replies from authorized Tech Support people. And it isn’t bad to ask the question here. However, had you asked in Unofficial Tech Support, the community would have been able to respond.
Anyway enough pointless complaining and onto the problems at hand: there are 2 current problems we have.
We only seem to be able to upload code to the Cortex via a direct serial link (using USB A-A cable (the very existence of such a thing shocks me to my core, very much against the USB standard I believe)) if we try to do this via VEXNet with the Joystick connected to the PC we get a could not communicate error (I would post a picture but I’m at work and have no access to the PC/Robot right now). Regardless of your feelings about the USB standard, that is the path that has been taken. And we have found it to work pretty well for this purpose (for over 10 years). As for the locked down computers, the only solutions are either find a way to get admin access on at least one computer or use someone’s personal computer (Robot C is a free download, if you have an account through VEXrobotics.com (free to establish an account). It is not a terribly large piece of software, we run it on an OLD laptop with Windows 98 with no issues.
Having downloaded and run the program via RobotC it is not clear how you get the program to run again once you have detached the Cortex from the PC. Is the program just supposed to run when you switch it on. How the program runs depends on the settings that you have set for the Robot (#5 below). If you have it set to VEXNet or USB, it will first check to see if there is a VEXnet connection. If it sees one, it will wait for a something to trigger the start of the program, which means a button press etc. from the joystick. If it doesn’t detect a VEXnet connection, it will operate as if you had checked USB only. In USB only, to run the program, you need to download the program to the cortex. Then if you have a program that just runs the motors forward for 5 seconds (for example). Disconnect the programming cable, turn off the Cortex. Then turn the Cortex back on an the program will run. My recommendation is to add a button switch on the robot and program it so that the program will only run once the button is pushed.
… oh … there are 3 current problems we have
Before we downloaded a program to the Cortex when you switched on the Cortex and Joystick they would connect and then you could control the Robot manually using the Cortex. Having downloaded a program (a simple one that just switch on all the drive motors for 5 seconds) when we switch on the Cortex and Joystick the seem to connect (all the lights go green) but nothing happens, our downloaded program does not seem to run and the Joystick does not have any control over the robot. See above, the default program is set up to VEXnet or USB, so if you have the Joystick paired it should run the robot under whatever the default program is (been so long I don’t remember what it is). When you downloaded, you may have been in either USB only (in which case it will not respond to the joystick) or the downloaded program has no references to the joystick which means the joy stick will not operate the robot.
… ah … among the many problems we are currently having
I feel like I am missing some documentation I am using VEXnet-UserGuide-20150210.pdf but that has a single paragraph on programming. I feels like I am missing the bit of documentation that says “When you have downloaded your program to the Cortex this is what you can expect to happen. If you want to get back to the previous behaviour of the Joystick and Cortex this is what you need to do.” To get back to the previous behavior, you can find the default program in the Robot C files and download that or you can run the update firmware from within RobotC which reestablishes the default code (if I remember correctly, plenty of references to how to do that by searching this forum).
What are the different communications modes “VEXNet or Use”, “USB Only”, “Competition (VEXNet)” about. that doesn’t seem to be explained anywhere. See above for most these. Competition (VEXnet) is a special connection for those involved in the VEX robotics Competitions. You won’t need this unless you decide to go that route. It sound to me like you are using this in a classroom setting.
Thanks to everyone for the help. Currently I am trying to get the school to set-up a dedicate laptop for use with the robot; a task that seems more important now that someone/thing has deleted our RobotC installation from the classroom computers.
I shall continue to bang my head against the dual walls of very limited time (I would say <35 hours per year) and a highly restrictive computer environment until I get it sorted out.