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

RS232 Error 5004

Jayman
2018-11-15
2018-11-16
  • Jayman - 2018-11-15

    Hello, I'm working on a project where I want to connect to my Raspberry Pi 3 B+ via RS232. I want to use the on board RX/TX pins.

    I've made a small program to test it but I keep getting an 5004 Error on my COM.Open function.
    I've used some code from a GitHub repo as reference but I'm still getting error's.

    I've attached a printscreen of the code running with the 5004 error visible.
    I've checked around and tried multiple things I've seen from other posts but nothing worked so far.

    I'm using CodeSys V3.5 SP13 Patch 1
    CAA SerialCom Library

    Thanks in advance.
    Jay.

    IMG: COM.PNG

     
  • Jayman - 2018-11-16

    Hello,

    Yes I've enabled the tty, i've used the raspi-config and I've set in interfacing options serial to disable for login as I've seen on other guides. But the hardware port it self is enabled.

    However I'm using ttyAMA0, is this wrong?

    dmesg | grep -i tty
    [Β  Β  0.000000] Kernel command line: 8250.nr_uarts=1 bcm2708_fb.fbwidth=800 bcm2708_fb.fbheight=480 bcm2708_fb.fbswap=1 vc_mem.mem_base=0x3ec00000 vc_mem.mem_size=0x40000000Β  dwc_otg.lpm_enable=0 console=tty1 consoleblank=0 root=PARTUUID=cd7583a6-02 rootfstype=ext4 elevator=deadline fsck.repair=yes rootwait
    [Β  Β  0.000806] console [tty1] enabled
    [Β  Β  0.873401] 3f201000.serial: ttyAMA0 at MMIO 0x3f201000 (irq = 87, base_baud = 0) is a PL011 rev2
    [Β  Β  0.877887] 3f215040.serial: ttyS0 at MMIO 0x0 (irq = 166, base_baud = 31250000) is a 16550
    [Β  Β 14.824360] Bluetooth: RFCOMM TTY layer initialized
    

    Jay.

     

Log in to post a comment.