Author Topic: Linux and Com ports.  (Read 2142 times)

rob1970

  • Newbie
  • *
  • Posts: 18
    • View Profile
Linux and Com ports.
« on: May 08, 2018, 08:40:34 PM »
Hi. I'm trying to get my HMI to work on a Raspberry Pi 3. I got the HMI to run in MONO but I'm not sure how to address the com ports. Using the command lsusb it list my plc on bus 001 Device 7. On my Windows PC it was Com3. Is this something that needs to be set up in mono or do I need to address this as differently in AdvancedHMI to get it to work?

Archie

  • Administrator
  • Hero Member
  • *****
  • Posts: 5322
    • View Profile
    • AdvancedHMI
Re: Linux and Com ports.
« Reply #1 on: May 08, 2018, 09:01:17 PM »
Are you using the Beta version 3.99y? Prior to that version, the serial port drivers do not work.

Depending on your configuration the serial ports would be something like ttyS0 or ttyS1

In a Linux shell you can use this command to see which ports you have:

dmesg | grep tty

rob1970

  • Newbie
  • *
  • Posts: 18
    • View Profile
Re: Linux and Com ports.
« Reply #2 on: May 09, 2018, 05:33:19 PM »
I think the problem is that the Plc uses USB to serial. it is showing up as ttyACM0. I am also using a USB to RS485 adapter that comes up as ttyUSB0. I currently have a test Screen where I can change com names and a label attached to the plc heartbeat bit. I have tried these names but no luck yet. I'm new to linux so I have a lot to learn.

Godra

  • Hero Member
  • *****
  • Posts: 1447
    • View Profile
Re: Linux and Com ports.
« Reply #3 on: May 09, 2018, 06:52:39 PM »
In my setup, USB to serial shows as ttyUSB0 but this link does provide info on why some devices get registered as ttyACM0: https://rfc1149.net/blog/2013/03/05/what-is-the-difference-between-devttyusbx-and-devttyacmx/ .

I would suggest that you temporarily remove USB to RS485 adapter, then in Visual Studio set your COM port as ttyACM0 (or if you remove USB to serial and keep the USB to RS485 adapter then set it to ttyUSB0), run the program and then copy it over to the Pi.

Make sure all other port settings are correct as well (like BaudRate, etc).

These are only suggestions so you can try to make it work.
« Last Edit: May 09, 2018, 10:14:29 PM by Godra »