# Differentiate between IDE & VCP connections

**URL:** <https://forums.openmv.io/t/differentiate-between-ide-vcp-connections/897>\
**Category:** OpenMV Boards\
**Created:** [September 19, 2018, 6:56am UTC](https://forums.openmv.io/t/differentiate-between-ide-vcp-connections/897 "2018-09-19T06:56:30Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![phantom8](https://avatars.discourse-cdn.com/v4/letter/p/67e7ee/32.png) [@phantom8](https://forums.openmv.io/u/phantom8)\
**Post date:** [September 19, 2018, 6:56am UTC](https://forums.openmv.io/t/differentiate-between-ide-vcp-connections/897/1 "2018-09-19T06:56:30Z")

</div>

In the python program, how to tell if the camera is connected to IDE or USBVCP? I tried to use USB\_VCP.isconnected(), but it returns True even the cam is connected to IDE. During development and testing, my cam will normally connect to IDE. However, the cam will be connected to a linux box during production. I need a way to distinguish between these 2 cases.

---

<div class="post-metadata">

**Author:** ![kwagyeman](https://yyz1.discourse-cdn.com/flex029/user_avatar/forums.openmv.io/kwagyeman/32/4_2.png) [@kwagyeman](https://forums.openmv.io/u/kwagyeman)\
**Post date:** [September 19, 2018, 3:30pm UTC](https://forums.openmv.io/t/differentiate-between-ide-vcp-connections/897/2 "2018-09-19T15:30:49Z")

</div>

Hi, um, you can’t use the VCP port when the IDE is connected to the camera because the IDE uses that. I’d recommend using the hardware UART for testing purposes and then switch to the VCP port once you think your code is ready.

---

<div class="post-metadata">

**Author:** ![phantom8](https://avatars.discourse-cdn.com/v4/letter/p/67e7ee/32.png) [@phantom8](https://forums.openmv.io/u/phantom8)\
**Post date:** [September 20, 2018, 1:30am UTC](https://forums.openmv.io/t/differentiate-between-ide-vcp-connections/897/3 "2018-09-20T01:30:45Z")

</div>

I fully understand that I can’t use the VCP port when the IDE is connected to the camera. I’m not trying to connect the camera to IDE and use the VCP port at the same time.

All I am asking is there an API in the OpenMV library which can tell me if I’m currently connected to IDE or using VCP as a serial terminal? During development, the Camera will connect to a Mac running IDE. As for production, the camera will connect to a Linux box and communicate to a Java program via VCP. And the Camera will switch between these 2 environments very often. The handling of the Python program will be different in these 2 scenarios. I can modify the program each time when I switch environments, but this is not ideal. I would expect there is a way to tell which connection it’s currently using programmatically.

As for the USB\_VCP.isconnected() API in the OpenMV, why does it return “True” when the Python program is running under IDE? Is this a bug? My expected behaviour of this API is to return “True” when connected via VCP, and “False” when connected to IDE. If this API works, it will serve my purpose.

---

<div class="post-metadata">

**Author:** ![kwagyeman](https://yyz1.discourse-cdn.com/flex029/user_avatar/forums.openmv.io/kwagyeman/32/4_2.png) [@kwagyeman](https://forums.openmv.io/u/kwagyeman)\
**Post date:** [September 20, 2018, 6:16am UTC](https://forums.openmv.io/t/differentiate-between-ide-vcp-connections/897/4 "2018-09-20T06:16:33Z")

</div>

Mmm, it probably is a bug. Mostly related to the way our IDE connects to the cam. Please submit a bug request to our GitHub.

---

<div class="post-metadata">

**Author:** ![phantom8](https://avatars.discourse-cdn.com/v4/letter/p/67e7ee/32.png) [@phantom8](https://forums.openmv.io/u/phantom8)\
**Post date:** [September 20, 2018, 10:00am UTC](https://forums.openmv.io/t/differentiate-between-ide-vcp-connections/897/5 "2018-09-20T10:00:01Z")

</div>

I’ve submitted a bug report to Github. Besides the USB\_VCP.isconnected() API, is there any other API that I can use to detect if the OpenMV cam is connected to IDE? If I’m not mistaken, the OpenMV cam connects to IDE with 921600 BPS. Is this the way the firmware detects if the IDE is connected by checking the baud rate? Is there any OpenMV API that I can use to check the USB VCP port baud rate?

---

<div class="post-metadata">

**Author:** ![iabdalkader](https://yyz1.discourse-cdn.com/flex029/user_avatar/forums.openmv.io/iabdalkader/32/1169_2.png) [@iabdalkader](https://forums.openmv.io/u/iabdalkader)\
**Post date:** [September 21, 2018, 1:44am UTC](https://forums.openmv.io/t/differentiate-between-ide-vcp-connections/897/6 "2018-09-21T01:44:08Z")

</div>

Hi, I’ve added a new function for that (see github issue), it will be available in the next release.

---

<div class="post-metadata">

**Author:** ![phantom8](https://avatars.discourse-cdn.com/v4/letter/p/67e7ee/32.png) [@phantom8](https://forums.openmv.io/u/phantom8)\
**Post date:** [September 21, 2018, 7:21am UTC](https://forums.openmv.io/t/differentiate-between-ide-vcp-connections/897/7 "2018-09-21T07:21:37Z")

</div>

I’ve compiled the firmware and tested the new debug\_mode\_enabled() API. It’s working perfectly. The technical support that you’ve provided for the product is incredible. Thank you so much! 🙂
