Welcome to our new forum
All users of the legacy CODESYS Forums, please create a new account at account.codesys.com. But make sure to use the same E-Mail address as in the old Forum. Then your posts will be matched. Close

Rasp onboard Bluetooth as serial port

audi0615
2021-11-25
2022-06-09
  • audi0615 - 2021-11-25

    Hi.

    I'd like to use Raspberry pi onboard bluetooth as a serial port.
    My understanding is UART0(ttyAMA0) is allocated to the bluetooth in Rasp 3 or 4.

    So, does this mean i can use the bluetooth as any other serial devices for serial communication?

    I edited "/etc/CODESYSControl_User.cfg" as below and I would use SysCom library for serial communication.

    [SysCom]
    Linux.Devicefile.1=/dev/ttyAMA0

     
  • alrcastro

    alrcastro - 2021-11-25

    You didn't exactly mention which RASP variant you are using, but from RPI3 onwards UART0 is exclusive to the Bluetooth and UART1 is general purpose, so you could not use UART0 as you want. Note that UART0 is an implementation based on the INTEL 16550 chipset whereas UART1 is a simplified version, implemented almost in softcore, but still works well.

     

    Last edit: alrcastro 2021-11-25
  • audi0615 - 2021-11-26

    Thanks for your reply.
    I have Raspi 3b and 4.
    if the bluetooth is UART0(ttyAMA0), could it be used as a serial com port?
    i've read a post regarding "cmpCharDevice" library. do i have to use the library for the bluetooth or just Syscom library is enough?

     
  • twofacexx - 2022-06-09

    Hello,
    I'm also trying to read data from a BT device. I have a Rasp4B. Have you or anyone else already had success and could describe the procedure here.

     

Log in to post a comment.