Controller not connecting to the Cortex

Hello my name is Payton and I am having trouble trying to connect my controller to the cortex. I have downloaded the firmware to both the cortex and controller, hit the config button on the cortex, changed the cortex, keys, and the remote, and also established a vex link on everything, but when I try to connect the controller and the cortex with keys it would not connect. There would be a green light on the joystick icon and also on the controller a yellow light would flash rapidly on VEXnet on the cortex two yellow lights would flash rapidly on VEXnet and Game and a green light would flash slowly on robot.

#pragma config(Motor,  port2,           LFDriveM,      tmotorVex393, openLoop)
#pragma config(Motor,  port3,           LRDriveM,      tmotorVex393, openLoop)
#pragma config(Motor,  port8,           RRDriveM,      tmotorVex393, openLoop, reversed)
#pragma config(Motor,  port9,           RFDriveM,      tmotorVex393, openLoop, reversed)
//*!!Code automatically generated by 'ROBOTC' configuration wizard               !!*//

#pragma platform(VEX)

//Competition Control and Duration Settings
#pragma competitionControl(Competition)
#pragma autonomousDuration(20)
#pragma userControlDuration(120)

#include "Vex_Competition_Includes.c"   //Main competition background not modify!

//                          Pre-Autonomous Functions
// You may want to perform some actions before the competition starts. Do them in the
// following function.

void pre_auton()
  // Set bStopTasksBetweenModes to false if you want to keep user created tasks running between
  // Autonomous and Tele-Op modes. You will need to manage all user created tasks if set to false.
  bStopTasksBetweenModes = true;

	// All activities that occur before the competition starts
	// Example: clearing encoders, setting servo positions, ...

//                                 Autonomous Task
// This task is used to control your robot during the autonomous phase of a VEX Competition.
// You must modify the code to add your own robot specific commands here.

task autonomous()
  // .....................................................................................
  // Insert user code here.
  // .....................................................................................

	AutonomousCodePlaceholderForTesting();  // Remove this function call once you have "real" code.

//                                 User Control Task
// This task is used to control your robot during the user control phase of a VEX Competition.
// You must modify the code to add your own robot specific commands here.

task usercontrol()
	// User control code here, inside the loop

	while (true)
	  motor[LFDriveM] = vexRT[Ch3];
	  motor[LRDriveM] = vexRT[Ch3];
	  motor[RFDriveM] = vexRT[Ch2];
	  motor[RRDriveM] = vexRT[Ch2];

Here is my code, I do not see anything obviously wrong with it but if any one could help that would be great.

Thank you,

I’m not much of a programmer or electrician,

but have you tried using the robot with a tether?
Do you have good quality vex net keys?(these easily break)
on robot C, is your code setting under USB or WiFi?

Your program looks 100% fine. It must be a technical issue with the cortex.

It may be because your keys are bad, or maybe the cortex is just borked. Try what Draco said and tether it with the USB to USB cable.

Do you have a backup battery connected? The backup battery supplies power when the cortex momentarily loses power.

Now that I think about it, you may still be in disabled mode. Try redownload the program, then go up to the task menu on the top and go to Robot > Debugger Windows, then look for VEX Competition control. Select “User Control” then “Enable”, and try see if you can move the controls.

Usually if you’re just testing something briefly, it should be okay to not use a backup battery. If you need the backup battery immediately without even using the cortex for a second, there is already something wrong with the cortex.

As Draco said, make sure that under
Robot->Vex Cortex Communication Mode-> VEXnet
is selected

I have tried to select the competition control but it seems to be locked where I cannot click on it. Why would that be?

I did enable it but it still isn’t connecting; is there anything else that could be the issue?

You said the joystick light is green? When connecting, turn off the joystick. The only thing that should be powered is the Cortex. Then it will connect - it may be up to a minute though.

I think he means:
Turn both off.
Turn on cortex.
Turn on joystick.

Hi Payton,

We need a little more feedback to help you, Draco posted good suggestions but can you answer the following questions for us.

  1. Are you downloading for competition?

  1. Can you control your robot if you tether the cortex and joystick using the USB A-A cable?

  2. Do you have other VEXnet keys you can try ?

  3. Do the blue leds flash inside the VEXnet keys ?

  4. Are you programming the robot using the USB A-A cable connected to the cortex or do you have a programming kit connected to the joystick?

The most likely situation (assuming you answer yes to question 1) is that one or both VEXnet keys are not working, the only way to figure this out is to try other known good keys.

  1. Yes I am
  2. I can Control it sometimes but not always
  3. I have tried to new keys but they did not work either
  4. Yes the blue leds do flash
  5. I am programming with the USB A-A cable.
    But something new did happen it would connect then it would disconnect and I would have to power cycle the cortex and the controller but the samething would happen again.

Your Answer to number two makes me wonder what could be causing the issue when using the A-A cable, I have seen loose power connections to the cortex result in ‘bad link’ observables, however I cannot remember a case where USB A-A cable failed to work on a properly loaded (compatible firmware on both) Cortex and Handset. however loose poser connections on the cortex could cause a re-boot of the cortex. Try wiggling the power cable gently where it enters the cortex and see if you are getting re-boots.

Your answer to #3 is a little vague (new does not mean good in all cases), do you have access to known ‘good’ keys that you have seen work reliably (for 2-3 minutes) in another Cortex handset pair? Troubleshooting bad keys is a frustrating process, I just tested a batch of 8 Keys and found 5 where unreliable, 3 could be used reliably for longer durations. Of the 5 failed keys failures would range from never getting a connection through connecting but disconnecting after a short time (or some short period of activity). If you have access to other units that do work, try to methodically test each combination of keys available.

good luck,