Go to Post FRC did a lot for me in high school. I couldn't pass up the opportunity to help it do the same for others. - Oblarg [more]
Home
Go Back   Chief Delphi > Technical > Programming
CD-Media   CD-Spy  
portal register members calendar search Today's Posts Mark Forums Read FAQ rules

 
Closed Thread
Thread Tools Rate Thread Display Modes
  #1   Spotlight this post!  
Unread 27-11-2007, 22:46
mluckham's Avatar
mluckham mluckham is offline
Registered User
FRC #0758 (Sky Robotics)
Team Role: Mentor
 
Join Date: Mar 2006
Rookie Year: 2006
Location: Ontario, Canada
Posts: 116
mluckham will become famous soon enoughmluckham will become famous soon enough
Bluetooth RS232 and EasyC Pro

Our team acquired a Startech USBBTOOTH1 (USB to Class 1 Bluetooth Adapter) and a ICRS232BT1 (RS-232 Serial to Class 1 Bluetooth Adapter).

We have managed to get a Bluetooth RS232 connection to Hyperterminal, but neither EasyC nor the EasyC Loader will recognize the Bluetooth port name - it shows up as Bluetooth Serial Port (COMxx) in the Device Manager. We have different versions of USB-to-RS232 converters and they work fine with EasyC.

At least we can use the Bluetooth RS232 to download telemetry data from the robot to Hyperterminal (and from there to Excel) during driving tests.

Anyone else using Bluetooth successfully with EasyC?

Maybe our problem is with the Bluetooth Adaptor and supplied "Bluesoleil" software ... perhaps a different Bluetooth adaptor will work.
  #2   Spotlight this post!  
Unread 28-11-2007, 10:01
Kingofl337's Avatar
Kingofl337 Kingofl337 is offline
You didn't see anything....
AKA: Adam
FRC #0501 (Power Knights)
Team Role: Mentor
 
Join Date: Feb 2005
Rookie Year: 1998
Location: Manchester, NH
Posts: 861
Kingofl337 has a reputation beyond reputeKingofl337 has a reputation beyond reputeKingofl337 has a reputation beyond reputeKingofl337 has a reputation beyond reputeKingofl337 has a reputation beyond reputeKingofl337 has a reputation beyond reputeKingofl337 has a reputation beyond reputeKingofl337 has a reputation beyond reputeKingofl337 has a reputation beyond reputeKingofl337 has a reputation beyond reputeKingofl337 has a reputation beyond repute
Send a message via Yahoo to Kingofl337
Re: Bluetooth RS232 and EasyC Pro

Ok, so here is the deal, easyC doesn't like COM ports above like 10+. So what you need to do is goto the device manager and change the port number to something below 10. Also, I wouldn't recommend using bluetooth to program your robot as it will be SLOWWWW.
__________________
FIRST Team 501 PowerKnights - Mentor
FIRST Team 40 Checkmate - Mentor Alum
FIRST Team 146 Blue Lightning - Alumni
  #3   Spotlight this post!  
Unread 28-11-2007, 10:22
whytheheckme's Avatar
whytheheckme whytheheckme is offline
Registered User
AKA: Jacob Komar
no team
 
Join Date: Feb 2006
Rookie Year: 2005
Location: Providence, RI
Posts: 1,320
whytheheckme has a reputation beyond reputewhytheheckme has a reputation beyond reputewhytheheckme has a reputation beyond reputewhytheheckme has a reputation beyond reputewhytheheckme has a reputation beyond reputewhytheheckme has a reputation beyond reputewhytheheckme has a reputation beyond reputewhytheheckme has a reputation beyond reputewhytheheckme has a reputation beyond reputewhytheheckme has a reputation beyond reputewhytheheckme has a reputation beyond repute
Send a message via ICQ to whytheheckme Send a message via AIM to whytheheckme Send a message via MSN to whytheheckme Send a message via Yahoo to whytheheckme
Re: Bluetooth RS232 and EasyC Pro

Quote:
Originally Posted by Kingofl337 View Post
Also, I wouldn't recommend using bluetooth to program your robot as it will be SLOWWWW.
I'm not sure that the Bluetooth would be any slower than serial. Bluetooth 2.0+ is rated at 3Mbit/s, while even slower 1.2 is rated at 1 Mbit/s. Compare this to the speed of the serial port (what speed does IFILoader like to use? 115200? thats 10 times slower than Bluetooth 1.2 even.)

Just my 2 cents.

Jacob
  #4   Spotlight this post!  
Unread 28-11-2007, 15:37
Kingofl337's Avatar
Kingofl337 Kingofl337 is offline
You didn't see anything....
AKA: Adam
FRC #0501 (Power Knights)
Team Role: Mentor
 
Join Date: Feb 2005
Rookie Year: 1998
Location: Manchester, NH
Posts: 861
Kingofl337 has a reputation beyond reputeKingofl337 has a reputation beyond reputeKingofl337 has a reputation beyond reputeKingofl337 has a reputation beyond reputeKingofl337 has a reputation beyond reputeKingofl337 has a reputation beyond reputeKingofl337 has a reputation beyond reputeKingofl337 has a reputation beyond reputeKingofl337 has a reputation beyond reputeKingofl337 has a reputation beyond reputeKingofl337 has a reputation beyond repute
Send a message via Yahoo to Kingofl337
Re: Bluetooth RS232 and EasyC Pro

I understand where you are coming from but, based on your logic USB-to-Serial should be equal to the speed of a on board RS-232 UART but it's not. Emulation and error correction eats cycles and will slow down the output. I've tested two different Bluetooth modules and it was slowwww.
__________________
FIRST Team 501 PowerKnights - Mentor
FIRST Team 40 Checkmate - Mentor Alum
FIRST Team 146 Blue Lightning - Alumni
  #5   Spotlight this post!  
Unread 29-11-2007, 11:18
mluckham's Avatar
mluckham mluckham is offline
Registered User
FRC #0758 (Sky Robotics)
Team Role: Mentor
 
Join Date: Mar 2006
Rookie Year: 2006
Location: Ontario, Canada
Posts: 116
mluckham will become famous soon enoughmluckham will become famous soon enough
Re: Bluetooth RS232 and EasyC Pro

Quote:
Originally Posted by Kingofl337 View Post
Ok, so here is the deal, easyC doesn't like COM ports above like 10+. So what you need to do is goto the device manager and change the port number to something below 10. Also, I wouldn't recommend using bluetooth to program your robot as it will be SLOWWWW.
For one-way telemetry received by Hyperterminal the Bluetooth serial port works like a charm. The port also opens with a serial port monitor program, IFILoader, etc.

Your solution doesn't work for me (on several computers). I even tried the utility at Serial-Port-Mapper.com - no joy. Whatever I try, the EasyC error is "Failed to open port #2 (#3, etc)".

I hesitate to ask, but given the other programs that do work successfully - what API call or Active/X control are you using to open the port?

Still hopeful!

mike
  #6   Spotlight this post!  
Unread 29-11-2007, 11:40
Kingofl337's Avatar
Kingofl337 Kingofl337 is offline
You didn't see anything....
AKA: Adam
FRC #0501 (Power Knights)
Team Role: Mentor
 
Join Date: Feb 2005
Rookie Year: 1998
Location: Manchester, NH
Posts: 861
Kingofl337 has a reputation beyond reputeKingofl337 has a reputation beyond reputeKingofl337 has a reputation beyond reputeKingofl337 has a reputation beyond reputeKingofl337 has a reputation beyond reputeKingofl337 has a reputation beyond reputeKingofl337 has a reputation beyond reputeKingofl337 has a reputation beyond reputeKingofl337 has a reputation beyond reputeKingofl337 has a reputation beyond reputeKingofl337 has a reputation beyond repute
Send a message via Yahoo to Kingofl337
Re: Bluetooth RS232 and EasyC Pro

The easyC Loader is largely based on the IFI Loader for COM selection it should work the same. Are you using loader setup to change to the correct com port? Do you have a Bluetooth module plugged into the serial port on the robot and using a virtual serial port on a laptop with builtin bluetooth?
__________________
FIRST Team 501 PowerKnights - Mentor
FIRST Team 40 Checkmate - Mentor Alum
FIRST Team 146 Blue Lightning - Alumni

Last edited by Kingofl337 : 29-11-2007 at 11:42.
  #7   Spotlight this post!  
Unread 29-11-2007, 12:58
mluckham's Avatar
mluckham mluckham is offline
Registered User
FRC #0758 (Sky Robotics)
Team Role: Mentor
 
Join Date: Mar 2006
Rookie Year: 2006
Location: Ontario, Canada
Posts: 116
mluckham will become famous soon enoughmluckham will become famous soon enough
Re: Bluetooth RS232 and EasyC Pro

I am going into the EasyC terminal window - it is defaulting to COM10 (the last one used) then I choose COM3.

You are correct about the hardware setup - Bluetooth RS232 device on the robot programming port, communicating with a Bluetooth dongle in a USB port on the laptop. Bluesoleil software provides the Bluetooth connectivity, and serial port service - the software preallocates a range of ports (8, I think) for Bluetooth devices, you can see these in the Device Manager. Mine start numbering at COM10, because the lower ports were already assigned to USB-Serial cables. (Thinking this was the problem, I also tried a computer where lower-than-COM10 was assigned - still no EasyC success).

When the Bluetooth radio link is established and the virtual serial port connected, the Bluesoleil app pops up a message saying which port (COMXX) has been assigned.

In the Registry HKLM/System/CurrentControlSet/Enum/Root/PORTS contains entries for the Bluetooth ports. HKLM/HARDWARE/DEVICEMAP/SERIALCOMM contains a key \Device\Serial9 whose value is COM10.
  #8   Spotlight this post!  
Unread 29-11-2007, 13:10
Kingofl337's Avatar
Kingofl337 Kingofl337 is offline
You didn't see anything....
AKA: Adam
FRC #0501 (Power Knights)
Team Role: Mentor
 
Join Date: Feb 2005
Rookie Year: 1998
Location: Manchester, NH
Posts: 861
Kingofl337 has a reputation beyond reputeKingofl337 has a reputation beyond reputeKingofl337 has a reputation beyond reputeKingofl337 has a reputation beyond reputeKingofl337 has a reputation beyond reputeKingofl337 has a reputation beyond reputeKingofl337 has a reputation beyond reputeKingofl337 has a reputation beyond reputeKingofl337 has a reputation beyond reputeKingofl337 has a reputation beyond reputeKingofl337 has a reputation beyond repute
Send a message via Yahoo to Kingofl337
Re: Bluetooth RS232 and EasyC Pro

Unfortunately I don't have access to a bluetooth laptop today I'll check on it tomorrow and get back to you.
__________________
FIRST Team 501 PowerKnights - Mentor
FIRST Team 40 Checkmate - Mentor Alum
FIRST Team 146 Blue Lightning - Alumni
  #9   Spotlight this post!  
Unread 12-01-2008, 12:20
mluckham's Avatar
mluckham mluckham is offline
Registered User
FRC #0758 (Sky Robotics)
Team Role: Mentor
 
Join Date: Mar 2006
Rookie Year: 2006
Location: Ontario, Canada
Posts: 116
mluckham will become famous soon enoughmluckham will become famous soon enough
Re: Bluetooth RS232 and EasyC Pro

I wrote a Visual Studio program to list the available COM ports and open them to receive telemetry via the Bluetooth device - it works fine. I'll post it here later.

Now I would like to use the Serial Port 2 on the robot to output telemetry ... because it's a pain switching the serial cable on the Programming Port back and forth from the PC serial cable and Easy/C, to the Bluetooth RS232 device on the robot.

It would help if I could change the default port for printf output, to Serial Port 2. Is there a way to do that?

Another way would also help (this would be a new Easy/C feature) to have the loader fire up my program rather than the Terminal window.
  #10   Spotlight this post!  
Unread 12-01-2008, 14:06
mluckham's Avatar
mluckham mluckham is offline
Registered User
FRC #0758 (Sky Robotics)
Team Role: Mentor
 
Join Date: Mar 2006
Rookie Year: 2006
Location: Ontario, Canada
Posts: 116
mluckham will become famous soon enoughmluckham will become famous soon enough
Re: Bluetooth RS232 and EasyC Pro

Other teams might find this Visual Basic program useful. It was developed using Visual Studio 2008.

(I hope the Easy/C developers can use it to find out why Easy/C won't open the Bluetooth serial port, as explained in my previous posts. It might also help with their comments on data throughput ... we find that the data is received very quickly and accurately as long as we don't output data so often that the robot controller's time limits aren't exceeded and the Code Error light comes on.)

We use it, together with our Bluetooth serial adaptor, to produce instant line charts in Excel following a telemetry run. Obviously this requires Microsoft Excel be installed on your computer.

The robot code outputs data in columns, with a header line output first. For example (and this code fragment is for illustration purposes only):

Code:
int iJoystick;
int iError;
unsigned int uPWM;

print("\r\nHEADER:\n");
print("Joystick,Error,Motor\r\n");
while (1)
{
    // read joystick value
    ...
    // compute error and motor PWM values
    ...

    // output data for telemetry
    print("%d,%d,%u\r\n", iJoystick, iError, uPWM);
}
It is important that the number of comma-separated fields in the header line, and the number of comma-separated fields in the data lines, are the same.

The data going out the serial port would look something like this:

HEADER:
Joystick,Error,Motor
-12,10,132
-12,10,132
-14,12,145
-16,14,145

You can see this in the Terminal window of Easy/C, but there is no way to capture the data to a file.

You could open the COM port on the PC using Hyperterminal, and capture the data to a log file, but that's lots of keystrokes and mouse-clicks to repeat on every data run. And if you try to use the same COM port as Easy/C, you will have to close Easy/C between runs to free up the COM port.

Or you could run the attached program and get the data on a different COM port - leaving the original one for Easy/C and program loading. You will need to plug the robot controller's Program Port into a different port on the PC, during your telemetry test run.

To use the program:

1. select the COM port and click the Open button
2. hook up the robot controller as described above, and run it to produce data
3. click the Excel button to copy the data to Excel. The program fires up Excel automatically, copies the data to rows and columns, creates a chart, and then makes Excel visible.

The 'Trim Data' button is provided so that you can restart the robot program multiple times ... this results in multiple header lines in the output. Trim looks for the line containing the word HEADER: and removes that line and everything before it. This leaves only the the final header and data lines. After you Trim, then use the Excel button.

Mike
Attached Files
File Type: zip SkyTelemetry1.zip (88.7 KB, 71 views)
  #11   Spotlight this post!  
Unread 13-01-2008, 22:15
Kingofl337's Avatar
Kingofl337 Kingofl337 is offline
You didn't see anything....
AKA: Adam
FRC #0501 (Power Knights)
Team Role: Mentor
 
Join Date: Feb 2005
Rookie Year: 1998
Location: Manchester, NH
Posts: 861
Kingofl337 has a reputation beyond reputeKingofl337 has a reputation beyond reputeKingofl337 has a reputation beyond reputeKingofl337 has a reputation beyond reputeKingofl337 has a reputation beyond reputeKingofl337 has a reputation beyond reputeKingofl337 has a reputation beyond reputeKingofl337 has a reputation beyond reputeKingofl337 has a reputation beyond reputeKingofl337 has a reputation beyond reputeKingofl337 has a reputation beyond repute
Send a message via Yahoo to Kingofl337
Re: Bluetooth RS232 and EasyC Pro

If your just sending bytes or recording motor values you can use motor values and user bytes 0-5 and read them via the dashboard port on the OI. Plus it legal for use at the competition. I'm sorry I didn't get back to you sooner. I was able to test my bluetooth device on my MacBook Pro under XP and I was able to both receive terminal data and program the robot. It was extremely slow trying to program the robot controller though.

The function for user bytes is:

SetUserByte(unsigned char index, unsigned char value);
__________________
FIRST Team 501 PowerKnights - Mentor
FIRST Team 40 Checkmate - Mentor Alum
FIRST Team 146 Blue Lightning - Alumni
Closed Thread


Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
MS Vista/EasyC & EasyC Pro rswsmay Programming 1 25-04-2007 10:47
easyC Pro help! shlomi Programming 1 08-02-2007 06:48
EasyC Pro trial? Stuart Programming 3 07-02-2007 22:33
easyC PRO contest Brandon Martus Announcements 0 01-02-2007 11:57


All times are GMT -5. The time now is 19:38.

The Chief Delphi Forums are sponsored by Innovation First International, Inc.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Copyright © Chief Delphi