Any Online-Code Control From PC Examples?

  1. ‹ Older
  2. 8 years ago

    MarkO

    10 Sep 2008 Albany, Oregon, USA, North Wes...

    @dsheehan87 This is great stuff MarcO!

    Does anyone know the correct call to make to retrieve a value from say analog 1 from c# or C in Widnows? I can move motors and servos just fine but I am having issues reading the data of the various sensors like the bumper or an IR sensor.

    I thought it was like port.Read(buffer, 0, bufferlength) or something but I am not seeing anything in my console app.

    Ok, now to get you doing something productive. ;)

    Lets talk some background..

    The Vex Controller Code I posted today (09-SEP-2008) is a Reverse Engineer of the Vex Controller On-Line Code for IFI/intelitek Loader v2.8.0.1.
    That means that it (should) react just like the Vex Controller On-Line Code shipped with the IFI/intelitek Loader v2.8.0.1.
    RS-232 communication has many parameters that can be adjusted, but all the PC<->Vex communication occures at a speed of 115200 Bits Per Second, 8 Data Bits, NO Stop Bits, and One Stop Bit (You will see this written as "115200bps, 8N1")

    It also means that the Vex Controller On-Line Code is limited to 4 Analog Inputs in I/O block 1-4, 6 Digital Inputs in I/O block 5-10, and 6 Digital Outputs in I/O block 11-16. The 6 Interrupts are also used as Digital Inputs as well, giving a Total of 12 Digital Inputs. There is also the 8 PWM (Motor and Servo) Outputs as well.

    This (currently) limits the Inputs to stright Analog Devices, (e.g. Line Follower, Light Sensor, and Potentiometer), Digital Devices (e.g. Limit Switch, Bumper Switch, and the Orange Jumpers).
    Analog Inputs will report an Integer Number between 1023 and 0. Digital Inputs will report an Integer Number between 1 and 0 (TRUE and FALSE).

    The Optical (Quadrature or otherwise) Encoder's and Ultrasonic Range Finder won't work with the Current Code (Never Fear, I have a plan).

    Also Devices that Transmit Serial Data (e.g. GPS and some Compesses) won't work either, (Never Fear, I have a plan for that too).

    Now, lets talk some terminology..

    Broadcast and/or Request.
    At my day job , the devices I work with that communicate together, send Data in two different paradigms, the Broadcast and/or Request.

    A Communication Device may ONLY Broadcast data, or ONLY Transmit data (on a Request from another Communication Device) or may do Both (some data is Broadcast other data is Transmitted on a Request, or data is typically Transmitted on a Request and Broadcast on a Warning, Error or Limit condition).
    That is a total of Four different paradigms, and I have not even got to the hybred paradigm that the Vex Controller On-Line Code for IFI/intelitek Loader v2.8.0.1 uses.

    The Vex Controller On-Line Code uses a Broadcast paradigm for ALL Input Data to the Vex Controller, BUT, you have to Activate It (That is where the Request part comes in)!!

    To get the Vex Controller to Broadcast, you must send it this Init Data Packet ("0xC9 0x17 0x01 0x00 0x00 0x00"). The Vex Controller will Broadcast until the Battery goes Dead, it Locks Up (AKA Hangs) or you send the Exit Data Packet ("0xC9 0x17 0x02 0x00 0x00 0x00"). There is also a Reset Data Packet ("0xC9 0x17 0x03 0x00 0x00 0x00"), which will turn off ALL the Digital Outputs (And probably Stops all the PWM devices, but the IFI/intelitek Loader will send a STOP for each PWM Output, so I don't know how the Vex Controller really works on this point).

    Once the Vex Controller receives the Init Data Packet, it starts Broadcasting the following data, about 2 times per second. There is 54 Characters, including a Terminating Carrage Return (Symbol "CR", Hexadecimal "0x0d") ALL Charcters are Printable ASCII characters, delimited(i.e. To be Divided or Seperated) by Spaces:

    "BOARDDATA 1018 1022 1022 1022 1 1 1 1 1 1 1 1 1 1 1 1"

    This Data is broken down like this:
    "BOARDDATA " 10 Characters, This is the Header, it never changes.
    "1018 " 5 Characters, This is Analog Input #1 (in I/O block position 1).
    "1022 " 5 Characters, This is Analog Input #2 (in I/O block position 2).
    "1022 " 5 Characters, This is Analog Input #2 (in I/O block position 3).
    "1022 " 5 Characters, This is Analog Input #2 (in I/O block position 4).
    "1 " 2 Characters, This is Digital Input #5 (in I/O block position 5).
    "1 " 2 Characters, This is Digital Input #6 (in I/O block position 6).
    "1 " 2 Characters, This is Digital Input #7 (in I/O block position 7).
    "1 " 2 Characters, This is Digital Input #8 (in I/O block position 8).
    "1 " 2 Characters, This is Digital Input #9 (in I/O block position 9).
    "1 " 2 Characters, This is Digital Input #10 (in I/O block position 10).
    "1 " 2 Characters, This is Digital Input #1 (in Interrupt block position 1).
    "1 " 2 Characters, This is Digital Input #2 (in Interrupt block position 2).
    "1 " 2 Characters, This is Digital Input #3 (in Interrupt block position 3).
    "1 " 2 Characters, This is Digital Input #4 (in Interrupt block position 4).
    "1 " 2 Characters, This is Digital Input #5 (in Interrupt block position 5).
    "1\x0d" 2 Characters, This is Digital Input #6 (in Interrupt block position 6).

    So, now it is "Try it and Find Out" time. (I have Limit Switches, Bumper Switches, and Line Trackers)

    Setup you PC application for Serial Communication with your COM Port (Determine the COM Port Number in the Device Manager, if you are not sure) with the Communication Settings of "115200bps, 8N1".
    Setup a Couple of Buttons in your Application's Window. You can call the Buttons, "Start" and the other one "Stop".
    Setup a Text Window, that will display text, that text will come from the Opened COM Port. You might need to adjust the Text Display Window Size to only show One Line of text.
    On the Press of the "Start Button", have it send to the opened COM Port the Init Data Packet. On the Press of the "Stop Button", have it send to the opened COM Port the Exit Data Packet.

    Connect the Vex Controller to the Vex Programmer and your Computer. Download the "default" Vex On-Line Code or the Vex On-Line Code I have provided.
    Plug in a Bumper Button or Limit Switch into the Interrupt Block, Say in position 3. Plug a Bumper Button or Limit Switch into the I/O block, Say in position 6. Plug a Line Tracker into the I/O block, Say in position 1, its Window facing up.

    Press the "Start Button" on your Application. You should see on your Application in the Text Window something like:
    "BOARDDATA 0807 1022 1022 1022 1 1 1 1 1 1 1 1 1 1 1 1"

    Cover the "Line Tracker" window, the data should look like:
    "BOARDDATA 0257 1022 1022 1022 1 1 1 1 1 1 1 1 1 1 1 1"

    Uncover the "Line Tracker" window, the data should look like above:
    "BOARDDATA 0807 1022 1022 1022 1 1 1 1 1 1 1 1 1 1 1 1"

    Press and Hold the Switch connected to the Interrupt Block, the data should look like:
    "BOARDDATA 0807 1022 1022 1022 1 1 1 1 1 1 1 1 1 0 1 1"

    Release and Press the Switch connected to the Interrupt Block, the data should look like:
    "BOARDDATA 0807 1022 1022 1022 1 1 1 1 1 1 1 1 1 1 1 1"
    When the Switch is Released, and the data should look like:
    "BOARDDATA 0807 1022 1022 1022 1 1 1 1 1 1 1 1 1 0 1 1"
    When the Switch is Pressed.

    Press and Hold the Switch connected to the I/O Block, the data should look like:
    "BOARDDATA 0807 1022 1022 1022 1 0 1 1 1 1 1 1 1 1 1 1"

    Release and Press the Switch connected to the I/O Block, the data should look like:
    "BOARDDATA 0807 1022 1022 1022 1 1 1 1 1 1 1 1 1 1 1 1"
    When the Switch is Released, and the data should look like:
    "BOARDDATA 0807 1022 1022 1022 1 0 1 1 1 1 1 1 1 1 1 1"
    When the Switch is Pressed.

    That covers reading the Analog and Digital Inputs.. Tomorrow, I will cover the PWM and Digital Outputs.

    You can use a standard Terminal Program for the above Test, but you will need to be able to send the Init Data Packet and the Exit Data Packet.

    My Notes from my research on the Vex On-Line Code (05/09-SEP-2008)

    IFI/Intelitek Loader 2.8.0.1
    ==================================================================================

    Sent on Open of "On-Line Window" (Not Sure purpose)
    0x0F 0x0F 0x08 0x40 0xB8 0x04

    Init (Occurs on Open of "On-Line Window" and "IFI>" prompt from Vex Controller)
    0xC9 0x17 0x01 0x00 0x00 0x00

    Exit (Occurs on Close of "On-Line Window")
    0xC9 0x17 0x02 0x00 0x00 0x00

    Reset (Occurs on Press of "Reset All" Button on "On-Line Window")
    0xC9 0x17 0x03 0x00 0x00 0x00
    Reset (For PWM outputs NOT at 0x7F [127], a PWM Control Message with a Data Value of 0x7F is sent)
    All Digital Outputs are set to OFF.

    ==================================================================================

    Response of Vex Controller (Vex On-Line Code )
    Information is Always BROADCAST (like On-Line Code for Version 1.x, unlike DDT Code)
    (Format Example)
    BOARDDATA 1018 1022 1022 1022 1 1 1 1 1 1 1 1 1 1 1 1

    On EXIT Command from "On-Line Window" Vex Controller RESETS resulting in a "IFI>" prompt from Vex Controller.

    Power Up of Vex Controller
    0x00 0x49 0x46 0x49 0x3E 0x00 (NUL IFI> NUL)

  3. OK I actually figured out some sort of issue... WIth the VEx online code I just get IO 1 1 1 1 1 1 1 1 1 0 0 0 0 0 etc etc

    With your code I correctly get 10 1022 1022 1022 1 1 1 1 1 etc etc

    The 10 is the Sharp infared sensor. And I verified that is the reading in the IFI online window and some test easy c code I made for creating a better function to convert the SHarp voltage into cm's.

    I first send the online mode buffer, then the initialize, then I read the data in c#.

    I am going to try and do a few tests tomorrow on actually doing something in reaction to the sensor data (really want to know how fast it will take for the data to pass to the serial port and be interpretted by the c# application.

  4. MarkO

    10 Sep 2008 Albany, Oregon, USA, North Wes...

    @dsheehan87 OK I actually figured out some sort of issue... WIth the VEx online code I just get IO 1 1 1 1 1 1 1 1 1 0 0 0 0 0 etc etc

    With your code I correctly get 10 1022 1022 1022 1 1 1 1 1 etc etc

    The 10 is the Sharp infared sensor. And I verified that is the reading in the IFI online window and some test easy c code I made for creating a better function to convert the SHarp voltage into cm's.

    I first send the online mode buffer, then the initialize, then I read the data in c#.

    I am going to try and do a few tests tomorrow on actually doing something in reaction to the sensor data (really want to know how fast it will take for the data to pass to the serial port and be interpretted by the c# application.

    Check your IFI/intelitek Loader, it sounds like you have Version 3.x. It has a different Data Format from Ver 1.x and Ver 2.xl, and the Vex version seems broken too.

    If you have Broadband Internet. download the latest EasyC 2.x , and Install it. Then you will have the IFI/intelitek Loader Ver 2.x and the VexOnlineCode.hex to match.

    Ballpark speed is about 2 times per second for the Data Transfer. That would mean that you should be able to get readings every .5 Seconds

    It should be possible to speed it up, and I originality was crashing my Terminal Program because I was sending Data too fast.. ;)

    Some of the Improvements I am working on will include ONLY sending the Data you need.

    Sound like you are getting some Valid Data.. That is great!!

    My Notes from my research on the Vex On-Line Code (05/09-SEP-2008)

    Version 3 (easyC Pro On-Line Code [FRC and VEX versions])
    ==================================================================================
    Response from Vex Controller (ASCII String, Space Delimited)

    IO 993 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 1 1 1 1 1

    1 Token Analog (Port 1)
    15 Tokens Input (Ports 2-16) ** Digital Input does not cause change, Analog gives a "0" or "1". What is up ???
    6 Tokens Interupts (Interupts 1-6)

  5. MarkO

    13 Sep 2008 Albany, Oregon, USA, North Wes...

    @tswift1 Check out the JVEX (JAVA) links and Sensor Tagging using Vex hardware for control of Vex robots using a PC or laptop host. The JVEX firmware is based on the original IFI Dynamic Debug Tool firmware (DDT), but also has the bumper sensors and Vex optical encoder and Vex Ultrasonic Ranger sensor functions that can also be called from Microchip PIC18 C using MPLAB.

    https://jvex-robotics.dev.java.net/servlets/ProjectForumView[/URL]

    I have not located any compiled versions of the JVEX project, but found this Sonar Code from MikeDubreuil :,

    Also I found this Code from Qbranch , this Code from wt200999 , and more Code (0.1 and 0.3 ) from MikeDubreuil .

    I worked with wt200999's Code in FEB-2008 getting the Parallax Ultra Sonic sensors working on FRC Team 957's Robot.

    For a Better Education on Ultra Sonics, read the Full Threads of the above message:
    SONAR Sensor Software Driver
    Ultrasonic sensors on digital ports 3-6 problems

    also this Tutorial is good too:
    [URL="http://www.robotbuilder.co.uk/Resources/Articles/138.aspx"]An Introduction to Robot Sonar

  6. MarkO

    13 Sep 2008 Albany, Oregon, USA, North Wes...

    @bg_blea MarkO,
    What codes does you version support for setMotor and the rest? Same as the ones I posted at the beginning of the thread?

    Sorry I missed this message earler!

    Yes!

    PMW and Motor Ports
    0xC9 0x17 0x04 0x00 0x7F 0x00 (Motor Port #01, STOPPED).
    0xC9 0x17 0x04 0x01 0x7F 0x00 (Motor Port #02, STOPPED).
    0xC9 0x17 0x04 0x02 0x7F 0x00 (Motor Port #03, STOPPED).
    0xC9 0x17 0x04 0x03 0x7F 0x00 (Motor Port #04, STOPPED).
    0xC9 0x17 0x04 0x04 0x7F 0x00 (Motor Port #05, STOPPED).
    0xC9 0x17 0x04 0x05 0x7F 0x00 (Motor Port #06, STOPPED).
    0xC9 0x17 0x04 0x06 0x7F 0x00 (Motor Port #07, STOPPED).
    0xC9 0x17 0x04 0x07 0x7F 0x00 (Motor Port #08, STOPPED).

    0xC9 0x17 0x04 0x00 0xFF 0x00 (Motor Port #01, MOTOR CLOCK WISE, SERVO COUNTER CLOCK WISE).
    0xC9 0x17 0x04 0x01 0xFF 0x00 (Motor Port #02, MOTOR CLOCK WISE, SERVO COUNTER CLOCK WISE).
    0xC9 0x17 0x04 0x02 0xFF 0x00 (Motor Port #03, MOTOR CLOCK WISE, SERVO COUNTER CLOCK WISE).
    0xC9 0x17 0x04 0x03 0xFF 0x00 (Motor Port #04, MOTOR CLOCK WISE, SERVO COUNTER CLOCK WISE).
    0xC9 0x17 0x04 0x04 0xFF 0x00 (Motor Port #05, MOTOR CLOCK WISE, SERVO COUNTER CLOCK WISE).
    0xC9 0x17 0x04 0x05 0xFF 0x00 (Motor Port #06, MOTOR CLOCK WISE, SERVO COUNTER CLOCK WISE).
    0xC9 0x17 0x04 0x06 0xFF 0x00 (Motor Port #07, MOTOR CLOCK WISE, SERVO COUNTER CLOCK WISE).
    0xC9 0x17 0x04 0x07 0xFF 0x00 (Motor Port #08, MOTOR CLOCK WISE, SERVO COUNTER CLOCK WISE).

    0xC9 0x17 0x04 0x00 0x00 0x00 (Motor Port #01, MOTOR COUNTER CLOCK WISE, SERVO CLOCK WISE).
    0xC9 0x17 0x04 0x01 0x00 0x00 (Motor Port #02, MOTOR COUNTER CLOCK WISE, SERVO CLOCK WISE).
    0xC9 0x17 0x04 0x02 0x00 0x00 (Motor Port #03, MOTOR COUNTER CLOCK WISE, SERVO CLOCK WISE).
    0xC9 0x17 0x04 0x03 0x00 0x00 (Motor Port #04, MOTOR COUNTER CLOCK WISE, SERVO CLOCK WISE).
    0xC9 0x17 0x04 0x04 0x00 0x00 (Motor Port #05, MOTOR COUNTER CLOCK WISE, SERVO CLOCK WISE).
    0xC9 0x17 0x04 0x05 0x00 0x00 (Motor Port #06, MOTOR COUNTER CLOCK WISE, SERVO CLOCK WISE).
    0xC9 0x17 0x04 0x06 0x00 0x00 (Motor Port #07, MOTOR COUNTER CLOCK WISE, SERVO CLOCK WISE).
    0xC9 0x17 0x04 0x07 0x00 0x00 (Motor Port #08, MOTOR COUNTER CLOCK WISE, SERVO CLOCK WISE).

    The First Two Bytes are the Header, they are always the same.
    The Third Byte is the "Device Family", "0x04" is Motor/Servos (PWM Outputs).
    The Fourth Byte (for the "Device Family PWM") is the Individual Device.
    The Fifth Byte is the Actual Speed Value for the Individual Device.
    The Sixth Byte always seems to be 0x00.

    ===========================================================

    Digital Output Ports
    0xC9 0x17 0x06 0x00 0x00 0x00 (Output Port #11, FALSE).
    0xC9 0x17 0x06 0x01 0x00 0x00 (Output Port #12, FALSE).
    0xC9 0x17 0x06 0x02 0x00 0x00 (Output Port #13, FALSE).
    0xC9 0x17 0x06 0x03 0x00 0x00 (Output Port #14, FALSE).
    0xC9 0x17 0x06 0x04 0x00 0x00 (Output Port #15, FALSE).
    0xC9 0x17 0x06 0x05 0x00 0x00 (Output Port #16, FALSE).

    0xC9 0x17 0x06 0x00 0x01 0x00 (Output Port #11, TRUE).
    0xC9 0x17 0x06 0x01 0x01 0x00 (Output Port #12, TRUE).
    0xC9 0x17 0x06 0x02 0x01 0x00 (Output Port #13, TRUE).
    0xC9 0x17 0x06 0x03 0x01 0x00 (Output Port #14, TRUE).
    0xC9 0x17 0x06 0x04 0x01 0x00 (Output Port #15, TRUE).
    0xC9 0x17 0x06 0x05 0x01 0x00 (Output Port #16, TRUE).

    The First Two Bytes are the Header, they are always the same.
    The Third Byte is the "Device Family", "0x06" is Digital (Digital Outputs).
    The Fourth Byte (for the "Device Family DIO") is the Individual Device.
    The Fifth Byte is the Actual Output Value for the Individual Device.
    The Sixth Byte always seems to be 0x00.

    Vex On-Line Controller Code v2.0, 0.81 Beta, Supports OUTPUT Control of I/O Ports 01-10, if you are not using them for INPUT.

    0xC9 0x17 0x06 0x06 0x00 0x00 (Output Port #01, FALSE).
    0xC9 0x17 0x06 0x07 0x00 0x00 (Output Port #02, FALSE).
    0xC9 0x17 0x06 0x08 0x00 0x00 (Output Port #03, FALSE).
    0xC9 0x17 0x06 0x09 0x00 0x00 (Output Port #04, FALSE).
    0xC9 0x17 0x06 0x0A 0x00 0x00 (Output Port #05, FALSE).
    0xC9 0x17 0x06 0x0B 0x00 0x00 (Output Port #06, FALSE).
    0xC9 0x17 0x06 0x0C 0x00 0x00 (Output Port #07, FALSE).
    0xC9 0x17 0x06 0x0D 0x00 0x00 (Output Port #08, FALSE).
    0xC9 0x17 0x06 0x0E 0x00 0x00 (Output Port #09, FALSE).
    0xC9 0x17 0x06 0x0F 0x00 0x00 (Output Port #10, FALSE).

    0xC9 0x17 0x06 0x06 0x01 0x00 (Output Port #01, TRUE).
    0xC9 0x17 0x06 0x07 0x01 0x00 (Output Port #02, TRUE).
    0xC9 0x17 0x06 0x08 0x01 0x00 (Output Port #03, TRUE).
    0xC9 0x17 0x06 0x09 0x01 0x00 (Output Port #04, TRUE).
    0xC9 0x17 0x06 0x0A 0x01 0x00 (Output Port #05, TRUE).
    0xC9 0x17 0x06 0x0B 0x01 0x00 (Output Port #06, TRUE).
    0xC9 0x17 0x06 0x0C 0x01 0x00 (Output Port #07, TRUE).
    0xC9 0x17 0x06 0x0D 0x01 0x00 (Output Port #08, TRUE).
    0xC9 0x17 0x06 0x0E 0x01 0x00 (Output Port #09, TRUE).
    0xC9 0x17 0x06 0x0F 0x01 0x00 (Output Port #10, TRUE).

    If you try to ACTIVATE an OUTPUT for a Port set to INPUT, it should be Ignored.

  7. @MarkO I have not located any compiled versions of the JVEX project, but found this Sonar Code from MikeDubreuil :,

    Also I found this Code from Qbranch , this Code from wt200999 , and more Code (0.1 and 0.3 ) from MikeDubreuil .

    I worked with wt200999's Code in FEB-2008 getting the Parallax Ultra Sonic sensors working on FRC Team 957's Robot.

    For a Better Education on Ultra Sonics, read the Full Threads of the above message:
    SONAR Sensor Software Driver
    Ultrasonic sensors on digital ports 3-6 problems

    also this Tutorial is good too:
    An Introduction to Robot Sonar

    Check out the following JVEX Sites on the JSwarm and JVEX Robotics using the Vex Starter Kit. They also include information on Sensor Tagging. The embedded firmware is very similar to Vex DDT and can easily be called from Microchip PIC18 C.

    https://jvex-robotics.dev.java.net/[/url]

    [url]https://jvex-robotics.dev.java.net/servlets/ProjectDocumentList?folderID=4778&expandFolder=4778&folderID=4788

  8. MarkO

    14 Sep 2008 Albany, Oregon, USA, North Wes...

    @tswift1 Check out the following JVEX Sites on the JSwarm and JVEX Robotics using the Vex Starter Kit. They also include information on Sensor Tagging. The embedded firmware is very similar to Vex DDT and can easily be called from Microchip PIC18 C.

    https://jvex-robotics.dev.java.net/[/URL]

    [URL]https://jvex-robotics.dev.java.net/servlets/ProjectDocumentList?folderID=4778&expandFolder=4778&folderID=4788

    Thanks.. Now I have the Full Source Code and the .hex files too.

  9. [deleted]

    27 Nov 2008

    hi.
    i'm trying to use the servo codes above and it's work !
    i'm sending the HEX codes from java.

    the problem is that the servos (all of them) sudenly jumps a little while the program is runnig

    does someone meet this problem ?
    i use vex v.5, firmware 7 for easyC and the online mode HEX file, witch is going with easyC 4 VEX v2.9.0.9

  10. 7 years ago

    shua

    26 May 2009 California

    Hello there! This post is why I registered at this forum :) Marko and others, are you guys still actively developing this?

    Here is what I am trying to do:

    I have a stationary sentry bot that I am building w/ camera mic light mounted to an articulating 'head'. It is controlled via the Vex controller and I Have just ordered an old laptop that I will be using to control the controller Via the online code.

    I am a Sr. web developer with extensive knowledge of linux and the LAMP stack. My idea is to run a linux (gentoo) based web server on the laptop and create a web interface to my robot. The laptop will process the camera image via USB and make it available to the web server ( application is called webcam ). To countrol the robot I will be using PHP with an AJAX based interface. I plan on designing custom code to relay commands from PHP / Javascript to the robot.

    My application ideas for sending / receiving controller commands are:

    C++ based program
    Simple bash script
    Apache WEBDAV module
    a pure PHP approach ( if there is a way for PHP to talk to the serial port )

    However the communication works out, the end product will be the ability to control the robot from any computer via a web interface.

    Any thoughts? I see there have been no updates to this thread for a while... you guys still working on anything?

  11. shua

    27 May 2009 California

    I am posting my progress and attempting to organize the information from this thread in my wiki. If anyone is curious or wants to help, have a peek here

  12. shua

    3 Jun 2009 California

    @MarkO Vex On-Line Controller Code v2.x (Available Source Version 0.80 Beta) is now available in the Vex Code section.

    I forgot to add in the Compiled .hex file. So I will try to attach it here (along with the Source).

    I am trying to communicate with the vex controller via serial with very little luck. I have downloaded and installed your code (MarkO) on my controller but I am not getting any broadcast. If I am in windows and I fire up hyperterminal then turn on the controller I get this string:

    IFI>IFI User Processor Initialized ....

    but with minicom in linux I am seeing nothing when I power up the device.

    I have tried sending the init string by pasting it into hyperterminal (paste to device) but nothing happens.

    When I send the device data from linux (minicom) the most response I have gotten is either a question mark (?) or the program light on the controller starts blinking.

    Should I be trying to use the original online code? I only have the original IFI loader app v1.1... could that be the problem that I tried to load the software with this loader?

    I purchased the Vex programming kit quite a while ago. I think I could use some updated software but I can't seem to find any torrents or upgrades ( do I have to pay for Vex programming software? )

    Has anyone gotten the vex controller to just dump data into a terminal application (minicom, hyperterminal, etc) ? Any idea what I am doing wrong? Are there any special characters I should be wrapping the INIT packet in?

  13. MarkO

    3 Jun 2009 Albany, Oregon, USA, North Wes...

    @shua I am trying to communicate with the vex controller via serial with very little luck. I have downloaded and installed your code (MarkO) on my controller....

    You downloaded the Hex File "VexUserCode_OL2.hex"??? From the Zip File "Vex_On-Line_2_Code_v0-80.zip" (Which is really v0.81) From Vex Code, Page 3 .

    ....but I am not getting any broadcast. If I am in windows and I fire up hyperterminal then turn on the controller I get this string:

    IFI>IFI User Processor Initialized ....

    You should see in your Terminal Window

    IFI>On-Line User Processor Initialized ...

    but with minicom in linux I am seeing nothing when I power up the device.

    It could be the Baud Rate or Data Bits or Stop Bits.. Set them to 115200, 8N1.

    Is your Windows OS and Linux OS on the same machine, or different machines?? What Distro of Linux?? It could be a Cable or Hardware Port Issue.

    I have tried sending the init string by pasting it into hyperterminal (paste to device) but nothing happens.

    Many Terminal Programs filter incoming and outgoing data. For my Reverse Engineering I used TeraTerm v2.3 or TeraTerm v3.1.3 and Realterm . I would advise to get both.

    Also, do you know that your Serial Cable is correct and if you Connect Two Computer (or Serial Ports) Together with a Null Modem, can you see in a Terminal Program the correct Init String?

    In HyperTerminal, You might be able to Config a Macro with the correct 6 bytes for the Init, or place the 6 Bytes in a File and do a File Transfer Upload, with NO Transfer Protocol.

    When I send the device data from linux (minicom) the most response I have gotten is either a question mark (?) or the program light on the controller starts blinking.

    Sounds like wrong Port Settings.. (see above)

    Should I be trying to use the original online code? I only have the original IFI loader app v1.1... could that be the problem that I tried to load the software with this loader?

    The Original On-Line Code will give the same Init Message "IFI>On-Line User Processor Initialized ..." I did not know if the On-Line Window would break if I changed it.. So I left it the same.

    I purchased the Vex programming kit quite a while ago. I think I could use some updated software but I can't seem to find any torrents or upgrades ( do I have to pay for Vex programming software? )

    You have EasyC 1.x?? The On-Line Window in the EasyC Loader 1.1 will work for testing.

    You need a License Key to use EasyC 2.x and Pro after 7 days, but the Downloader Programs should work fine with out. Download and Install, then use the Downloader Programs.

    Download EasyC 2.x
    Download EasyC Pro

    Has anyone gotten the vex controller to just dump data into a terminal application (minicom, hyperterminal, etc) ? Any idea what I am doing wrong? Are there any special characters I should be wrapping the INIT packet in?

    I think you have 3 or 4 issues here...

    Start with Downloading the Hex File and checking in the IFI (or EasyC) Downloader's Term Window for the correct String.

    Then check the Serial Port Settings, in Windows and in Linux.
    If these are two different machines (I have a dozzen machines that could run Windows or DOS or OS/2 or BSD or Linux), NULL Modem them together and check sending Data Back and Forth between the Two. Look for a Loss of Characters (Some Times the NUL [Hex 0x00] will not get sent).

    Once the Data is good, plug into the Vex and Using the On-Line code from EasyC 2.x or EasyC Pro, or MarkO's On-Line Code, you should be able to send the 6 Init Bytes, and the Vex Controller should start Broadcasting the Data in an ASCII format.

  14. shua

    4 Jun 2009 California

    You should see in your Terminal Window
    IFI>On-Line User Processor Initialized ...

    I think I had the wrong code installed. I downloaded it again and reinstalled and now I get the correct message in my windows terminal ( tera term pro ) but still don't see anything in minicom.

    It could be the Baud Rate or Data Bits or Stop Bits.. Set them to 115200, 8N1.

    I have this all set up correctly. One thing I am not sure about is flow control, I have everything set to NONE (windows) or Hardware: off Software: off (linux)

    Is your Windows OS and Linux OS on the same machine, or different machines?? What Distro of Linux?? It could be a Cable or Hardware Port Issue.

    2 machines.

    I have XP running in a virtual machine on OSX -> this I use to program the controller w/ a 3rd party USB to Serial cable I got on ebay ( a friend commondeered my VEX one ) connected to the orange programming module.
    Using version 1.1 I can install the original on-line code and control the bot with the online window.

    Other is an old laptop running Gentoo. This has a built in serial port. I run this machine headless and connect via SSH.

    Hardware is good (see below)

    [HTML]Many Terminal Programs filter incoming and outgoing data. For my Reverse Engineering I used TeraTerm v2.3 or TeraTerm v3.1.3 and Realterm . I would advise to get both.

    Also, do you know that your Serial Cable is correct and if you Connect Two Computer (or Serial Ports) Together with a Null Modem, can you see in a Terminal Program the correct Init String?[/HTML]

    I built a simple NULL modem and connected the serial ports on the 2 computers and was able to send data/text back and forth no problem.

    [HTML]In HyperTerminal, You might be able to Config a Macro with the correct 6 bytes for the Init, or place the 6 Bytes in a File and do a File Transfer Upload, with NO Transfer Protocol.[/HTML]

    Tried this. No dice. Maybe I am formatting my string wrong??? I have tried a text file with each of the following none of which seem to work.

    0xC9 0x17 0x01 0x00 0x00 0x00
    C9 17 01 00 00 00
    C91701000000

    What should the init string look like EXACTLY when I send it to the controller?

    Sounds like wrong Port Settings.. (see above)

    that's what I would think. but I swear I have tried everything.

    You have EasyC 1.x?? The On-Line Window in the EasyC Loader 1.1 will work for testing.

    yes, but I don't seem to be able to send data to the serial port with this. Tera Term seems better fit.

    You need a License Key to use EasyC 2.x and Pro after 7 days, but the Downloader Programs should work fine with out. Download and Install, then use the Downloader Programs.

    I downlaoded and installed and can run the loader but none of the com ports are available to select. Is this because it's not registered or do I need to uninstall the old software first?

    I am going to go through the process again. Any more input would be much appreciated!

    thanks!

  15. MarkO

    4 Jun 2009 Albany, Oregon, USA, North Wes...

    @shua I think I had the wrong code installed. I downloaded it again and reinstalled and now I get the correct message in my windows terminal ( tera term pro ) but still don't see anything in minicom.

    I am not sure about what to do about that..

    I have this all set up correctly. One thing I am not sure about is flow control, I have everything set to NONE (windows) or Hardware: off Software: off (linux)

    CTS/RTS (pin 4 and 5) is used for Downloading the Hex Files, but for simple Communication, just TX/RX/GND are needed.

    2 machines.

    I have XP running in a virtual machine on OSX -> this I use to program the controller w/ a 3rd party USB to Serial cable I got on ebay ( a friend commondeered my VEX one ) connected to the orange programming module.
    Using version 1.1 I can install the original on-line code and control the bot with the online window.

    Other is an old laptop running Gentoo. This has a built in serial port. I run this machine headless and connect via SSH.

    Hardware is good (see below)
    [html]Many Terminal Programs filter incoming and outgoing data. For my Reverse Engineering I used TeraTerm v2.3 or TeraTerm v3.1.3 and Realterm . I would advise to get both.

    Also, do you know that your Serial Cable is correct and if you Connect Two Computer (or Serial Ports) Together with a Null Modem, can you see in a Terminal Program the correct Init String?[/html]I built a simple NULL modem and connected the serial ports on the 2 computers and was able to send data/text back and forth no problem.

    OK, hardware works, what BAUD Rate and Settings did you use??

    [html]In HyperTerminal, You might be able to Config a Macro with the correct 6 bytes for the Init, or place the 6 Bytes in a File and do a File Transfer Upload, with NO Transfer Protocol.[/html]Tried this. No dice. Maybe I am formatting my string wrong??? I have tried a text file with each of the following none of which seem to work.

    0xC9 0x17 0x01 0x00 0x00 0x00
    C9 17 01 00 00 00
    C91701000000

    What should the init string look like EXACTLY when I send it to the controller?

    Ahh... (I saw your post Re: Programming in *nix , I have not responded yet)

    The above are TEXT representations of Binary Data. As far as ASCII and ISO character sets go, not ALL Binary Values have Visible Characters.

    0xC9 0x17 0x01 0x00 0x00 0x00 This represents 6 Bytes, displayed in Hexadecimal. Note that each Byte represented here, requires 4 Bytes, plus a Space between them for readability. I have attached a Zip File with The 3 Basic On-Line Code commands, INIT, EXIT, and RESET. Unzip and place where you can find them. (I put them in the OL2 directory, so they will be downloaded with every copy)

    Using TeraTerm (I know that Pro has this option, I think 2.3 does also):

    Having the Robot, Power Off, but plugged into the Vex Programmer and the Programmer Plugged into the Computer.

    Open TeraTerm, set COM Port (to whatever your Com Port is) and Port Settings to 115200, 8N1, NO Flow Control.

    Power Up the Robot. You should see Displayed

    IFI>On-Line User Processor Initialized ...Select "File-->Send File". check the Option Box for Binary.

    OPEN the file OLC_INIT. You should see the line below in the Terminal Window.
    BOARDDATA 1018 1020 1020 1020 1 1 1 1 1 1 1 1 1 1 1 1Give sigh of relief.

    Select "File-->Send File".

    OPEN the file OLC_EXIT. You should see the line in the Terminal Window STOP being Broadcast.

    I just tested this with the OL2 Code, and it works.

    that's what I would think. but I swear I have tried everything.

    Still thinking about that one...

    yes, but I don't seem to be able to send data to the serial port with this. Tera Term seems better fit.

    Realterm has it uses too..

    I downlaoded and installed and can run the loader but none of the com ports are available to select. Is this because it's not registered or do I need to uninstall the old software first?

    I am going to go through the process again. Any more input would be much appreciated!

    Make sure that the Com Port is available. If the IFI Loader or iLoader or Hyperterminal is still open, it can lock the Com Port.

    thanks!

    Your Welcome!! ;)

  16. shua

    4 Jun 2009 California

    [/code]I have attached a Zip File with The 3 Basic On-Line Code commands, INIT, EXIT, and RESET. Unzip and place where you can find them. (I put them in the OL2 directory, so they will be downloaded with every copy)

    DOH! this was my problem all along. I was thinking I could just send those hex bytes like AT commands. I guess not ;)

    Using your files I was able to get data dumping to the terminal in windows ( still need to try in linux )

    Realterm has it uses too..

    I am going to check that one out too :)

    When I am sending commands I will need to convert them the same way the init commands have been converted. When you say it's binary data, are you saying you compiled those strings with easyC or something? How can I convert the command set eg

    0xC9 0x17 0x04 0x00 0x7F 0x00 (Motor Port #01, STOPPED)

    to the proper format to send to the controller? ideally I would have a file like the INIT and EXIT files you provided for each command. How do I make these? What format conversion am I looking for?

  17. shua

    7 Jun 2009 California

    MarkO and others! Thanks to all your help and hard work I was able to get my VEX bot set up to be controlled through a web interface.

    I have a webcam set up feeding to a page with the cam feed and some controls and I am able to move servos and (de)activate digital outputs via this web interface. It even works from safari on my ipod touch :D

    I will post screenshots soon. Thanks again!

  18. [deleted]

    7 Jun 2009

    I'm was doing something different. I bought a few Pololu motor controllers and this guy: http://www.pololu.com/catalog/product/391[/url]

    My goal was to be able to control several Vex Blue, Vexplorer motors with an old HP laptop. The idea was to build a small "black box" to house all my custom electronics. I now own a Bug, from BugLabs: [url]http://www.buglabs.net/[/url] later, when I get around to it, I would like to replace the laptop with the Bug. Then link the Bug over wifi to a laptop. Then I want to use my 3D mouse, [url]http://www.3dconnexion.com/3dmouse/spacenavigator.php To control an holonomic drive. This would be amazing because the 3d mouse has X, Y, Z movement and X,Y, and Z rotation.

    This all is simple preparation for my professional BattleBot that will be a holonomic drive bot, it will feature a flipper, spikes and an interchangeable weapon port on the front, primary weapon will be a saw blade. I would also like to deploy an ultrasonic "sonar" system, it would find my opponent and keep my weapons pointed at him. It will rain holonomic death upon all and I will be the crowned the champion thus completing my childhood dream and about 15% of my life goals.

    At least thats the idea :)

  19. shua

    9 Jun 2009 California

    @smartkid This all is simple preparation for my professional BattleBot that will be a holonomic drive bot, it will feature a flipper, spikes and an interchangeable weapon port on the front, primary weapon will be a saw blade. I would also like to deploy an ultrasonic "sonar" system, it would find my opponent and keep my weapons pointed at him.

    That sounds really cool :)

    How do you plan on making your bot holonomic ? Something like a ballbot? If you're using that 3D mouse you mentioned, how many controllable degrees of freedom with that give you?

    I can't wait to see this!

 

or Sign Up to reply!