MissionPlanner icon indicating copy to clipboard operation
MissionPlanner copied to clipboard

Can't connect MP via Bluetooth since upgrading to Windows 7 - "Element not found"

Open ArtSpaziano opened this issue 12 years ago • 13 comments

I've been using 1.2.84 for many months and never a problem connecting via Bluetooth using my old XP laptop. I just got a new Win 7 laptop and can no longer connect via MP.
I immediately get the message "Connect Failed". When I select "Details", there is a message "Element not found" and some debugging info. I'm using the RCTimer Crius BT board. Connecting via Putty works fine, so I know that BT and port setting are fine. I also tried 1.3.1 and 1.3.1.2 - same issue.

I tried it on two Win7 machines (32 and 64 bit) with the same result.

  • Any ideas?

pix2

ArtSpaziano avatar May 04 '14 23:05 ArtSpaziano

Also tried disabling "reset apm on connect" No difference. Last night I decided to uninstall MP and re-install it as Administrator. It actually worked a few times and then, back to the errors described above.

ArtSpaziano avatar May 05 '14 21:05 ArtSpaziano

please read this http://answers.microsoft.com/en-us/windows/forum/windows_7-hardware/bluetooth-com-port-problem/751e4fc8-3688-48ba-85c4-fb851a320ba7

meee1 avatar May 06 '14 01:05 meee1

Michael, I read it and I'm not sure that it applies to my situation. I don't have any extra ports that are in-use. I just have an inbound and outbound port from the BT card as well as a Com3 port from native Laptop functionality. I would expect MP to connect to COM5 with my current configuration, but I get the error shown about, instead. I have no problem connecting to on COM5 using Putty. See screenshots below.

-Any other thoughts?

Art

egceacej

efighjcj

iahffadi

ArtSpaziano avatar May 07 '14 01:05 ArtSpaziano

I noticed that the connect light on the Crius BT module briefly indicates a connection before the MP error appears, so it looks like MP briefly finds it but drops and then can't find the port.

I found that using a 3rd party Bluetooth stack solved my problem, although I'm not completely satisfied with that resolution. I bought one of these BT dongles: http://www.newegg.com/Product/ProductList.aspx?Submit=ENE&DEPA=0&Order=BESTMATCH&Description=tbw-107ub&N=-1&isNodeId=1 It comes with a 3rd party BT stack by Bluesoleil (http://www.bluesoleil.com). Now I have no problem connecting to MP. I believe that the 3rd party BT stack is a bit more persistent about maintaining the BT connection. I'm a bit unhappy with having to add one of these dongles to my new $1,400 laptop, though, and it also causes my computer to hang when shutting down.

I really think someone needs to figure out why MP doesn't like to connect to the default Microsoft BT stack in Windows 7.

Art

ArtSpaziano avatar May 16 '14 02:05 ArtSpaziano

namespace MissionPlanner.Comms {

public class SerialPort : System.IO.Ports.SerialPort, ICommsSerial
{
    static bool serialportproblem = false;

    //public new bool DtrEnable { get { return base.DtrEnable; } set { if (ispx4(base.PortName)) return; base.DtrEnable = value; } }
    //public new bool RtsEnable { get { return base.RtsEnable; } set { if (ispx4(base.PortName)) return; base.RtsEnable = value; } }

Commenting out the above two commented lines will solve the problem... I do this everytime there's an update in the code and recompile a working version for myself... Possible going to communicate with the main dev about this?

gitsly avatar Jul 22 '14 19:07 gitsly

Thanks for sharing this, gitsly. I'm going to download Visual Studio and try it myself. Although my BT dongle works, I have limited range because I'm not able to take advantage of the antenna built into the LCD display in my laptop.

  • So how do we get the developers to incorporate your fix? As you can see from this and other entries, they seem to think it's just us getting the setup wrong.

Art

ArtSpaziano avatar Jul 23 '14 00:07 ArtSpaziano

I will try to understand myself why this fixes the problem and make a more gentle fix, and possible send a pull request along with some info? I'm currently (constantly) in lack of time, but started to set up my MissionPlanner sln with the latest code yesterday, just gotta get rid of all reference errors (again =).

Also you need to uncheck 'Reset APM on connect'. (or disable that code in MainV2.cs). The problem is really illogical and I can't really understand why my solution works, really. I use the bluetooth module (JY-MCU) connected to my OpenLRSng TX module with my custom firmware, which let me do telemetry back to the laptop without needing an additional 3DR radio modem stuck in the plane, which is really handy when all things work properly.

gitsly avatar Jul 23 '14 05:07 gitsly

can I get some testers to test the latest beta MP please.

  1. make sure reset apm on connect is off.
  2. if you get an element not found, you need to depower the Bluetooth dongle and repower.
  3. now the real trick. you need to select the comport without using the drop down. or if you do, you will need to do step 2.

can I just get you guys to test. so far I can connect everytime, so long as I don't use the dropdown comport selector at the time. ie type it in, or use the keyboard arrow keys to select.

meee1 avatar Aug 01 '14 09:08 meee1

Will try as soon as I get home from work. Thanks for looking into this. On Aug 1, 2014 11:55 AM, "Michael Oborne" [email protected] wrote:

can I get some testers to test the latest beta MP please.

  1. make sure reset apm on connect is off.
  2. if you get an element not found, you need to depower the Bluetooth dongle and repower.
  3. now the real trick. you need to select the comport without using the drop down. or if you do, you will need to do step 2.

can I just get you guys to test. so far I can connect everytime, so long as I don't use the dropdown comport selector at the time. ie type it in, or use the keyboard arrow keys to select.

— Reply to this email directly or view it on GitHub https://github.com/diydrones/MissionPlanner/issues/445#issuecomment-50867797 .

gitsly avatar Aug 01 '14 09:08 gitsly

Hi, i finally got time to test this yesterday with the latest clone from your repository. Took me quite some time to get the project compiling mostly due to reference errors and I even got to change the framework version on some of the DLLs in Ext libs?? Also the prebuild step for making the git hash file didn't work for me strangely so I did the hash manually (from cygwin) and removed the automatic one...

Anyways the fix is working! My behavior (using a JY-MCU) is exactly the same as you described above, including the need to power off when I get element not found. But for me, this is OK. I'll be alright as long as I stick to the procedure, and I rarely use the drop down anyways (it is really slow?). Thanks again!

gitsly avatar Aug 05 '14 05:08 gitsly

I also did the testing and was able to connect, but I need to do exactly what was described, it is a good work around to connect via Bluetooth, I tested with 2 different Bluetooth dongles a JY-MCU and a BlueSmirf from Sparkfun both have the same behavior.

bassin12 avatar Aug 19 '14 11:08 bassin12

Is there any news about this ?

  • have Reset APM on USB connect disabled
  • use last beta of Mission Planner 1.3.11 build 1.1.5426.22786
  • after restart and repower dongle I am not clicking in combo because I already have BT com port there.

DevFor8 avatar Nov 11 '14 19:11 DevFor8

Wanted to confirm this also using HC-05, Win7 64bit. Connection with Tower on Android phone work flawlessly.

I was able to connect once by disconnecting and reconnecting BT power. Is there a chance some more robust BT stack is needed - the windows stock one is known to be very buggy ?

Saxin avatar Apr 06 '16 17:04 Saxin