CBCDownloader USB hangs on Mac OS X.

1 reply [Last post]
imjake9
imjake9's picture
Title: NooBot
Joined: 03/01/2012
Posts:
BotPoints: 19
User offline. Last seen 8 years 47 weeks ago.

I am running Mac OS 10.7.3, and I can't for the life of me get CBCDownloader's USB function to work properly.

I installed rxtx and ran it, which gave me a PortInUseException. I was able to fix this by following the steps outlined here, and the program continued to run fine. Unfortunately, I found that it was never actually completing the program, and was not downloading to the CBC.

After a bit of System.out.printlning and breakpointing, I traced it back to this method in Packet.java:

  1. private static boolean checkAck(InputStream in) throws IOException {
  2. int ret = 0;
  3. ret = in.read();
  4. if (ret == SERIAL_MESSAGE_OK) {
  5. return true;
  6. }
  7. return false;
  8. }

I have discovered that the program hangs on the in.read() line, and never leaves it. Can anyone get CBCDownloader to work on Mac OS X, and if so, how did you do it?

Beta
Beta's picture
Title: The Magnificent
Joined: 02/24/2012
Posts:
BotPoints: 266
User offline. Last seen 8 years 32 weeks ago.

CBCDownloader needs to be updated to the new CBCv2 serial specification. I have uploaded an internal document I wrote describing the new serial format here (you might have to scroll a bit). This document should be accurate up to KISS IDE 3.0.2. The cbcserial Qt C++ code might also be a good reference. Most of my effort right now is focused on writing a new serial system for the CBCv3, which will also be backwards compatible with the CBCv2. The entire subsystem is a mess right now, because it leans on the heavyweight Qt library.

Anyway, to actually answer your question, CBCDownloader needs some work to talk with the current serial specification. I think updating CBCDownloader would be possible, especially with the C++ code and KISS document. I don't have time to work on it right now because I am working on a ton of other things, and I am a full time student as well. You seem pretty knowledgable in Java, so I think the best bet would be to try updating it yourself. The goal with the new libcbcserial is to completely eliminate this issue by writing the downloader in standard C++ (no Qt), so it will be very easy to bind to a multitude of different languages.

That's probably not the answer you were looking for, so I apologize again. However, if you were to get CBCDownloader working, I would more than happily merge it back upstream. libcbcserial should be finished and integrated by KISS IDE 3.2.0, which is slated for summer.

Braden McDorman

Developer of the KIPR Link, KISS IDE, KIPR's 2D Simulator, and CBCJVM.

Reach me at bmcdorman(cat)kipr(dog)org where (cat)=@ and (dog)=. if you need assistance of any kind.