Shop OBEX P1 Docs P2 Docs Learn Events
Comm ports and IDE crashes — Parallax Forums

Comm ports and IDE crashes

JonathanJonathan Posts: 1,023
edited 2007-08-08 02:37 in Propeller 1
Hi All,

I am having problems with the Propeller IDE and a bluetooth device. I use the bluetooth device for communicating with my project, so I can't un-install or disable the device.

What happens is that the when programming, the IDE hard crashes when it scans the port that the bluetooth device is on. I have to reboot, force quit doesn't work.

I found a thread discussing this problem, but didn't see a fix. I am using the Prop tool 1.05.5, winXP with SP2 on a Dell 5150 laptop. Is there any way to specify which port for the IDE to use so it skips the scan? I am travelling and nees to get it all working on my laptop. The same issue appears on my desktop. To work around I have been using the desktop for programming and the laptop for communicating with the project, but on the road this won't work.

Thanks!

Jonathan

▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
www.madlabs.info - Home of the Hydrogen Fuel Cell Robot

Comments

  • Paul BakerPaul Baker Posts: 6,351
    edited 2007-08-01 22:11
    Does your bluetooth module set up two com ports? Also can you state what the manufacturer and model of you bluetooth device is?

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Paul Baker
    Propeller Applications Engineer

    Parallax, Inc.
  • JonathanJonathan Posts: 1,023
    edited 2007-08-01 22:20
    Paul,

    Yes, the bluetooth does have two com ports when I look under the device manager, COM7 and COM8. I am using a Linksys USBBT100 adapter. I am using the latest driver from Linksys, 1.4.2.8 .

    Thanks!

    Jonathan

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    www.madlabs.info - Home of the Hydrogen Fuel Cell Robot
  • Paul BakerPaul Baker Posts: 6,351
    edited 2007-08-01 22:35
    Yeah, the problem is that some BT devices create a read only COM port and a write only COM port, but there is no provisions within windows to actually do that, so any program which requests a list of open com ports gets a list of both as fully functioning. We have another BT device that does the same thing, we will get yours too and see if we can find any commonality we can use to get it so they aren't checked.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Paul Baker
    Propeller Applications Engineer

    Parallax, Inc.
  • JonathanJonathan Posts: 1,023
    edited 2007-08-02 00:11
    Paul,

    Thanks for giving me the skinny. I may try picking up another Bluetooth adapter while I'm on the road. Do you know of one which does not cause this problem? Right now I am going to have to unplug/program/quit IDE/ plug. Eeew. Dang Windows...

    Thanks!

    Jonathan

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    www.madlabs.info - Home of the Hydrogen Fuel Cell Robot
  • Chad GeorgeChad George Posts: 138
    edited 2007-08-04 01:24
    Jonathan,

    This problem occurs on many brands of bluetooth devices. Personally, I haven't found any brands that don't have some problem with the Prop Tool's autoscan feature.

    Paul, I don't think it has to do with "read only" or "write only" ports. These bluetooth ports are virtual com ports that windows just simply enumerates as an available physical port. I've usually found the problem to occur when

    1. the bluetooth device is plugged into the computer and the driver/manager is running and
    2. the serial port connection isn't actually paired with a bluetooth device.

    It's not that it is the PropTool causing the crash. If any other program tries to "open" the port at this time then it'll lockup the system too. BUT, most programs don't go around opening every available com port either. So it doesn't come up too often.

    Here's the workaround I've found for BT devices.
    1. don't plug it in (not usually·very usefull)
    2. move the serial port #s that the bluetooth is using to something high like the 20s
    3. make sure there is actually a propeller connected on a low com port so it doesn't get to scan the upper ones

    of course after 10-15 minutes of development in this scenario and I ALWAYS forget to turn on the propeller before hitting F10 and my system is lockup up. No blue screen, no CTRL-ALT-DELETE,... nothing just unplug and go to bed.

    Oh and its not just limited to bluetooth devices. TCP/IP redirect drivers (ie. Lantronix) have the same problem if the target port isn't available (as in its off). And even loop-back virtual serial ports have a problem.

    Really, there are just too many scenarios to try to "fix" the problem. I don't think it can be fixed. There's nothing wrong except maybe trying to open·ports that shouldn't be opened. I know this is a small percentage of the user base's setups, but it isn't that uncommon.

    The solution is just let us disable the autoscan feature when we know that it'll lock things up.
    ·
  • hippyhippy Posts: 1,981
    edited 2007-08-04 14:20
    The scan also sends data to ports which are used by devices which are not Propeller Chips and their operation can be adversely affected by the scan if some other application does not have the serial port they are connected to opened.

    That presents a stopgap solution for some cases - Run an application which keeps the ports open so the Propeller Tool cannot. It wouldn't help in the situation where simply opening the port leads to a system crash or hang.
  • MightorMightor Posts: 338
    edited 2007-08-04 20:18
    I vote for a toggle-able com port scan function in the Prop tool. I really like the PBASIC IDE's ability to just specify ports you wish to scan. The automated scan might work for most people and this additional functionality would cater for basically all exceptions.
    It's better to fix the problem rather than the symptoms [noparse]:)[/noparse]

    Gr,
    Mightor

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    | What the world needs is more geniuses with humility, there are so few of us left.
    | "Wait...if that was a compliment, why is my fist of death tingling?"
    | - Alice from Dilbert
  • Paul BakerPaul Baker Posts: 6,351
    edited 2007-08-04 20:26
    I will bring up your concerns with Jeff.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Paul Baker
    Propeller Applications Engineer

    Parallax, Inc.
  • AribaAriba Posts: 2,685
    edited 2007-08-04 23:53
    I have two Propellers on two different COM-ports, and found no easy
    solution to handle this, with the PropellerTool.
    So, this evening I made a little Upload Tool for the Propeller IDE.

    It can also be a solution for the Bluethooth and oder COM-problems,
    because it does'nt search on the COMs. You can define 4 COM-ports for
    code upload to 4 different Propellers.

    I used the same technic as for the PreSpin Preprocessor to control the
    IDE, and I reused the Loader routines from the PropTerminal.

    Installation and Usage:

    Copy the PropUp.exe in the PropellerTool directory. Start it before or
    after the PropellerTool. The little window will stay in foreground.

    Click on Compile to compile a spin code (this is the same as pressing F8).
    If not done, enable the Hex-Dump view in the Object info window.
    Then set the desired COM number in a line and click on the Upload button,
    after the compilation has finished. The code will automatically be saved
    as "compiled.binary" file and then uploaded to the Propeller.
    With Save, you save all 4 COM numbers and the window position for future
    starts.
    Don't click on Upload when no Hexdump of the compiled code is visible,
    this will write some text lines in the source code.

    The Upload button on the first of the 4 COM-port lines will also control
    a PropTerminal window, if one is started. You no longer have to minimize
    and restore it manually.

    Have fun

    Andy
    905 x 585 - 36K
  • QuattroRS4QuattroRS4 Posts: 916
    edited 2007-08-05 00:05
    Ariba,
    I Like it !

    Regards,
    ········· John Twomey

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    'Necessity is the mother of invention'
  • MightorMightor Posts: 338
    edited 2007-08-05 05:34
    What a masterful hack, nice one! This will function as a very nice work-around until Parallax implements the manual port list in its IDE.

    Gr,
    Mightor

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    | What the world needs is more geniuses with humility, there are so few of us left.
    | "Wait...if that was a compliment, why is my fist of death tingling?"
    | - Alice from Dilbert
  • AribaAriba Posts: 2,685
    edited 2007-08-07 22:54
    Thank you Mightor and QuattroRS4 for the kind comments [noparse]:)[/noparse]

    I hope Parallax will implement something similar in the IDE, that would be still a little bit more comfortable.

    Andy

    Post Edited (Ariba) : 8/7/2007 11:35:21 PM GMT
  • Chad GeorgeChad George Posts: 138
    edited 2007-08-07 23:12
    Ariba,

    Its an absolutely brilliant hack.

    I have a feeling how you did it but I'd love to hear the details so I'll ask...

    How DO you get the compiled.binary file? This was a feature I had asked them to add the IDE but it seems like you worked around it anyway.

    Once you get the compiled.binary I understand the upload bit as I helped work though that little issue a while ago.

    -Chad
  • Fred HawkinsFred Hawkins Posts: 997
    edited 2007-08-07 23:34
    Very nice, Ariba. Any chance of bundling this with PreSpin?
  • AribaAriba Posts: 2,685
    edited 2007-08-07 23:56
    Chad
    There is some explanation in the PreSpin Thread:
    http://forums.parallax.com/showthread.php?p=655470
    There are some Windows API functions that let you select any activ window and send some key-events to it.
    To compile, I activate the IDE, then I send key <F8>. To produce the binary, I send ALT-B (the File-Dialog Opens) then I send the filename as ASCII characters and then <RETURN> - the binary will be saved.
    You can cotrol all what is doable with Keyboard-Shortcuts, the problem is you get no feedback, when something is done, so you have to time this with delays and a lot of trying.

    Fred
    That was my first attempt, but it does'nt easy fit in the PreSpin concept, so I decided to make a new application for now. I hope it is necessary only for short time, until Parallax include something similar into the IDE. If not I will include it in PreSpin later...

    Andy
  • SkogsgurraSkogsgurra Posts: 231
    edited 2007-08-08 02:37
    The beauty of a hack!

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Sign In or Register to comment.