Vexnet and Arudino

I am trying to make a robotic toy remote controlled toy and I am having trouble with the joystick part.

I have an arduino nano hooked up to an Xbee antena but the signal keeps dropping out.

I planned on using a vex joystick to send the signals to a cortex that has a xbee linked into its serial port. I then wanted to send the motor commands from the cortex to an arduino using an xbee. It is not going well. The Xbee keeps stopping and I cannot stream a continuous message to the robot.

A friend of mine told me that i could use the Vexnet Keys to communicate between a vexnet joystick and an arduino. He sugjested using the vexnet keys instead of the Xbees

Has anyone ever done anything like this before? I could really use some pointers.

Not possible without some serious reverse engineering.

Why not use something like a playstation controller and bluetooth on the arduino, I think that’s been done before.

https://www.circuitsathome.com/mcu/wireless-xbox360-controller-support-for-usb-host-2-0-library
Using an Arduino Mega ADK (built-in USB) or USB shield you can interface with an XBOX or PS controller with the libraries in the link above.

Hope this helps!

Using an Arduino Mega ADK (built-in USB) or USB shield you can interface with an XBOX or PS controller with the libraries in the link above.

Hope this helps!

The USB interface is quite easy. Did that in this project.
[Interfacing a PS3 controller to the joystick partner port

Bluetooth should be similar.](“https://vexforum.com/t/interfacing-a-ps3-controller-to-the-joystick-partner-port/21829/1”)

I did this project a number of years back:
https://vexforum.com/showpost.php?p=324297&postcount=1

At the time I had good luck with the xbee, the links would stay up fairly well. I did need to add code to the robot to detect a ‘lack of input’ and stop as there were a few times the link would drop and the robot kept rolling.

James has provided many examples of communicating such as this:
[https://vexforum.com/t/communicating-between-two-cortex-dual-cortex-robot/24236/1&highlight=serial+port

I would try to find out why ‘the Xbee keeps stopping’. what specific behaviour are you seeing? do you want to post your code?

Cheers Kb](https://vexforum.com/t/communicating-between-two-cortex-dual-cortex-robot/24236/1&highlight=serial+port)

The Xbee/Zigbee keeps dropping the signal out after connecting. I am using an Arduino Nano from gravitech and an Xbee S2 with a zigbee.

Here are the parts I am using

Arduino Nano
http://www.gravitech.us/arna30wiatp.html

XBee shield (it wants the TX and RX pins 0 and 1
http://www.gravitech.us/xbadforarna.html

Zigbee Xbee S2 radios
http://www.amazon.com/gp/product/B007R9U1QA

also tried this USB shield with no luck
[http://www.gravitech.us/usadforarna.html

I just had it connected to the computer at first with the usb shield to arduino and I got it to communicate for a few seconds at a time. It would then stop for a few seconds then start again and run for a few seconds. It was really frustrating.

Here is the arduino Code I used and the Robot C code.](http://www.gravitech.us/usadforarna.html)
xbeetest3.zip (1.79 KB)
Miranda’s attempt at serial communication.c (4.88 KB)

I will have a look at the code later.

O.k. It looks as though you are expecting the Xbees to be configured in point to point mode. so what goes in one Xbee serial port (say from the Cortex) comes out the other Xbee.

how do you have the XBee modems configured? Do you have a device such as the Xbee xplorer ? https://www.sparkfun.com/products/11812
Or do you have to configure them via the XBee add on board?

As I recall the XBee needs to be setup, one thing I notice right off is the baud rate at 38400 is not the default for XBee so I am assuming you have a tool to configure those devices. I’d like to understand how you have them configured.

I have planned to get my (5) Xbees working in Mesh mode this weekend so I am sure I can help test some configurations. Please let me know if you configured the XBee radios what tools you used. i.e X-CTU ?

Cheers Kb

Yes we used X-CTU and set one Zigbee as the controller and one as the receiver.

We set the PAN to some value and then set one as controller and one receiver. The screen shots are for the old version of X-CTU so it was quite confusing.

We bought two of them to get the Zigbee (Xbee S2’s) talking to each other via the PC. Then moved to PC to Arduino receiver.

Even from the PC constantly sending the same string at 500ms intervals, the Nano Zigbee dropped out for a few seconds the started up again.

I fried one of those sparkfun items trying to solder wires for the Cortex 4 wire connections. So now we only have one. The connections drove us to the Bluetooth receivers BNS has been showing lately. Their code has been really helpful but there was another trick needed to get two bluetooth devices talking to each other.

Bluetooth is talking much more reliably now.

https://alselectro.wordpress.com/2014/10/21/bluetooth-hc05-how-to-pair-two-modules/

I’m glad to hear the bluetooth is working for you. I have not played with those devices. For the Xbee, I use the XBEE explorer regulated to connect to the Cortex , PIC (VEX) or a generic Arduino compatible device. It has 4 pins +5V /Gnd Din/Dout

The XBEE is 3.3V and the Vex equipment runs at 5v so you need level conversion and this board provides that. I connect the 4 pins to the Cortex using the serial port. In my case I solder pins to the XBee breakout and use F-M jumper cables to make the hookup to a cortex.

I only use the USB XBee explorer to configure the various Xbees.

I’ve had some varied experience with the XBees mostly good. but there was a time it seemed very sporadic to get 2 radios to connect regularly, but if they did connect in point to point mode they worked really well. I have not experienced dropouts once they connected.

It sounds like your on hold for the XBee for the moment? I would recommend getting the non USB explorer for the Cortex Hookup if you want to get this working in future.

Let me know if you’d like any other help on this If I get the mesh working I may post here. There didn’t seem much interest in XBees & cortex / Vex as they are not competition legal.

Cheers Kb