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

Raspberrypi Serial Port Connection Error

Poncik
2017-12-18
2017-12-19
  • Poncik - 2017-12-18

    Dear all,

    I have read all the topics related to serial communication on the forum. But Δ± cannot open serial port to communicate with my device.

    1)I have modified the CODESYSConfig.cfg like this:

    [SysEthernet]
    Linux.ProtocolFilter=3

    [CmpSchedule]
    ProcessorLoad.Enable=1
    ProcessorLoad.Maximum=95
    ProcessorLoad.Interval=5000

    [SysCom]
    Linux.Devicefile=/dev/serial

    2) Add Symbolic Link to /pi folder

    #!/bin/sh
    # Script to start our application
    sudo ln -s /dev/serial/by-id/usb-Prolific_Technology_Inc.USB-Serial_Controller-if00-port0 /dev/serial2
    sudo ln -s /dev/serial/by-id/usb-DekTec_Digital_Video_BV_DTM-3237
    -OEM_DVB-S_DVB-S2_receiver-if00 /dev/serial3
    sudo ln -s /dev/serial/by-id/usb-Silicon_Labs_CP2103_USB_to_UART_Bridge_Controller_PDBBRK006518-if00-port0 /dev/serial4
    sudo ln -s /dev/serial/by-id/usb-u-blox_AG
    -_www.u-blox.com_u-blox_GNSS_receiver-if00 /dev/serial5
    sudo ln -s /dev/serial/by-id/usb-Silicon_Labs_CP2103_USB_to_UART_Bridge_Controller_0047-if00-port0 /dev/serial6

    I can not open serial port with this code. it's generate error. How can i solve this problem?

    IMG: 3.png

    IMG: 2.png

    IMG: 1.png

     
  • eschwellinger

    eschwellinger - 2017-12-18

    Hi,
    which value has 'udiPort' in your application?

    Should be 3 for using the usb-Prolific_Technology' interface
    BR
    Edwin

     
  • Poncik - 2017-12-19

    Hi Edwin,
    Thank you for fast response.

    In the morning, Δ± read your answer. I changed udiport value to 4 for using usb-DekTec_Digital_Video_BV device. After that port opened and Δ± sent some data to device. After a few attempts the device again generate error . I thought problem was from device. Changing the device did not solve the problem. The same error still occurs. Codesys can not open serial port.

    Best regards

    IMG: 7.png

    IMG: 6.png

    IMG: 5.png

    IMG: 4.png

     
  • Poncik - 2017-12-19

    Hi Edwin,
    I think I solved problem. I think there is an error in the code that I wrote. When Δ± tried with yours code, serial port opened without any error. If the problem persists I will bother you again.
    Thank you so much
    Best Regards.

     

Log in to post a comment.