# What is the COM port of serial port for Bluetooth for Raspberry Pi

**URL:** <https://discourse.processing.org/t/what-is-the-com-port-of-serial-port-for-bluetooth-for-raspberry-pi/42278>\
**Category:** Processing for Pi\
**Created:** [June 23, 2023, 2:49pm UTC](https://discourse.processing.org/t/what-is-the-com-port-of-serial-port-for-bluetooth-for-raspberry-pi/42278 "2023-06-23T14:49:01Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![Myrdalm](https://avatars.discourse-cdn.com/v4/letter/m/bcef8e/32.png) [@Myrdalm](https://discourse.processing.org/u/Myrdalm)\
**Post date:** [June 23, 2023, 2:49pm UTC](https://discourse.processing.org/t/what-is-the-com-port-of-serial-port-for-bluetooth-for-raspberry-pi/42278/1 "2023-06-23T14:49:01Z")

</div>

Using this code:

import processing.serial.\*;

Serial myPort;

printArray(Serial.list());  
myPort = new Serial(this, Serial.list()[0], 9600);

I am able to connect a comport via Bluetooth if use Windows in my laptop. But I tried applying it in my raspberry pi and I have not been successful so far. Does anyone know what name of the serial port that should be used to be able to access the serial connection of raspberry pi Bluetooth?

Thank you

---

<div class="post-metadata">

**Author:** ![sterretje](https://avatars.discourse-cdn.com/v4/letter/s/cdc98d/32.png) [@sterretje](https://discourse.processing.org/u/sterretje)\
**Post date:** [June 24, 2023, 4:24am UTC](https://discourse.processing.org/t/what-is-the-com-port-of-serial-port-for-bluetooth-for-raspberry-pi/42278/2 "2023-06-24T04:24:01Z")

</div>

I only use Windows (and Linux at occasion) and have no experience at all with a Raspberry Pi.

> [@Myrdalm](#):
>
> I have not been successful so far

What is the output of _`printArray(Serial.list());`_? Did you try the different ports that are listed?

> [@Myrdalm](#):
>
> myPort = new Serial(this, Serial.list()[0], 9600);

That would pick the first serial port. If I run it on Windows, it will pick COM1 which is a serial port that is by default available on my Win10 system and it will not be the Bluetooth port.

---

<div class="post-metadata">

**Author:** ![Myrdalm](https://avatars.discourse-cdn.com/v4/letter/m/bcef8e/32.png) [@Myrdalm](https://discourse.processing.org/u/Myrdalm)\
**Post date:** [June 24, 2023, 5:05am UTC](https://discourse.processing.org/t/what-is-the-com-port-of-serial-port-for-bluetooth-for-raspberry-pi/42278/3 "2023-06-24T05:05:39Z")

</div>

the list does not show in my raspberry pi screen, especially since I use the 3.5-inch touchscreen.

---

<div class="post-metadata">

**Author:** ![sterretje](https://avatars.discourse-cdn.com/v4/letter/s/cdc98d/32.png) [@sterretje](https://discourse.processing.org/u/sterretje)\
**Post date:** [June 24, 2023, 6:26am UTC](https://discourse.processing.org/t/what-is-the-com-port-of-serial-port-for-bluetooth-for-raspberry-pi/42278/4 "2023-06-24T06:26:36Z")

</div>

OK, so I guess that you can’t run shell commands either?

To find ports in Linux at the operating system level, you use _`lsusb`_ and in case of problems _`dmesg -w`_; I have no reason to believe that it would be different on a Raspberry Pi. But you need a monitor and a keyboard. In which case your statement _`printArray(Serial.list());`_ should also give the required data.

> [@Myrdalm](#):
>
> especially since I use the 3.5-inch touchscreen.

Can’t you iterate over the list of serial ports and print each entry on that screen?

---

<div class="post-metadata">

**Author:** ![Myrdalm](https://avatars.discourse-cdn.com/v4/letter/m/bcef8e/32.png) [@Myrdalm](https://discourse.processing.org/u/Myrdalm)\
**Post date:** [June 24, 2023, 1:46pm UTC](https://discourse.processing.org/t/what-is-the-com-port-of-serial-port-for-bluetooth-for-raspberry-pi/42278/5 "2023-06-24T13:46:13Z")

</div>

I was able to make it work with raspberry pi, but in the raspberry pi, you need to set rfcomm and apply it in the code above using the set rfcomm in exchange of the “com7” in the code. I have only 2 cons as of now that I am trying to resolve, communication has too much delay and when I restart the raspberry pi, you need to re-setup the rfcomm due to the reason that it releases the bind.

---

<div class="post-metadata">

**Author:** ![sterretje](https://avatars.discourse-cdn.com/v4/letter/s/cdc98d/32.png) [@sterretje](https://discourse.processing.org/u/sterretje)\
**Post date:** [June 24, 2023, 3:22pm UTC](https://discourse.processing.org/t/what-is-the-com-port-of-serial-port-for-bluetooth-for-raspberry-pi/42278/6 "2023-06-24T15:22:14Z")

</div>

Great 👍  
Can you share the code? I’m just curious how you solved it but others can benefit if they encounter the same problem.

---

<div class="post-metadata">

**Author:** ![Myrdalm](https://avatars.discourse-cdn.com/v4/letter/m/bcef8e/32.png) [@Myrdalm](https://discourse.processing.org/u/Myrdalm)\
**Post date:** [June 25, 2023, 3:26pm UTC](https://discourse.processing.org/t/what-is-the-com-port-of-serial-port-for-bluetooth-for-raspberry-pi/42278/7 "2023-06-25T15:26:56Z")

</div>

myPort = new Serial(this, “dev/rfcomm9”, 9600);

just a different port
