Rocrail-Raspberry Pi 3B - Dcc++ Arduino Mega Topic is solved

Post Reply
Juanito
Posts: 15
Joined: 07.06.2019, 18:30

Rocrail-Raspberry Pi 3B - Dcc++ Arduino Mega

Post by Juanito » 08.06.2019, 12:16

Good morning, sirs.
I'm new to the group, and this is my first encounter with the Raspberry Pi 3B. My idea is to manage a central station DCC++ formed by an Arduino Mega, by means of Rocrail installed in the Rasbpberry, but at the moment I don't get it.

The problem I think is how to configure the Rocrail_Properties_Controller. In Device I put ttyACM0, but I get the message:

"13:13:51 could not initialize [ttyACM0], check settings and device permission (group dialout)"

All help will be welcome.
Thank you very much for your attention.
Juan

smitt48
Moderator
Posts: 6073
Joined: 04.04.2014, 01:07
Location: Kralendijk, Bonaire - Dutch Caribbean

Re: Rocrail-Raspberry Pi 3B - Dcc++ Arduino Mega

Post by smitt48 » 08.06.2019, 12:56

Hi Juan,

Welcome to Rocrail.
check settings and device permission (group dialout)
But as user you must be in the dialout group to be able to use this device.
https://wiki.rocrail.net/doku.php?id=fa ... cess_linux
https://wiki.rocrail.net/doku.php?id=raspi:raspi-dev-en

Tom

apemberton
Posts: 91
Joined: 05.12.2017, 11:08
Location: West Hertfordshire, UK

Re: Rocrail-Raspberry Pi 3B - Dcc++ Arduino Mega

Post by apemberton » 08.06.2019, 13:15

Should that be '/dev/ttyAMC0' ? I assume you are using an adapter on serial console port presented on RPi GPIO pins 8 and 10. Then connected to a 3.3V serial port on the Arduino. (I know very little about an Arduino Mega).

When I have used a serial connection on a RPi, I have used a USB to RS232 adapter or in some cases a USB to TTL adapter and that avoids using /dev/ttyAMC0 which could be needed for a console output if necessary. If an USB adapter is used, that shows up as /dev/ttyUSB0. The RPi kernel modules have the most common drivers for USB to serial adapters (FDTI, Prolific, Silabs) available. Although I no longer use an RPi for Rocrail, I used a Prolific based USB to Serial adapter to link to my old Zimo command station with no problems.

Have fun, Tony

Liviu M
Posts: 942
Joined: 03.12.2011, 20:44

Re: Rocrail-Raspberry Pi 3B - Dcc++ Arduino Mega

Post by Liviu M » 08.06.2019, 13:55

Hi Tony,
some adapters register as ttyUSBx, some as ttyACMx. I'm using dmesg (right after connecting the board) to see which is the name the adapter is registered in the system. An Arduino (uno) clone is seen as ttyUSB0

Code: Select all

 9562.382210] usb 1-2: new full-speed USB device number 5 using xhci_hcd
[ 9562.511417] usb 1-2: New USB device found, idVendor=1a86, idProduct=7523
[ 9562.511421] usb 1-2: New USB device strings: Mfr=0, Product=2, SerialNumber=0
[ 9562.511421] usb 1-2: Product: USB2.0-Serial
[ 9563.527668] usbcore: registered new interface driver usbserial
[ 9563.527688] usbcore: registered new interface driver usbserial_generic
[ 9563.527705] usbserial: USB Serial support registered for generic
[ 9563.528155] usbcore: registered new interface driver ch341
[ 9563.528172] usbserial: USB Serial support registered for ch341-uart
[ 9563.528186] ch341 1-2:1.0: ch341-uart converter detected
[ 9563.528605] usb 1-2: ch341-uart converter now attached to ttyUSB0
a Loconet interface as ttyACM0

Code: Select all

[ 9813.155168] usb 1-2: new full-speed USB device number 6 using xhci_hcd
[ 9813.286195] usb 1-2: New USB device found, idVendor=04d8, idProduct=000a
[ 9813.286197] usb 1-2: New USB device strings: Mfr=1, Product=2, SerialNumber=3
[ 9813.286199] usb 1-2: Product: LN-USB Interface2
[ 9813.286200] usb 1-2: Manufacturer: LMMEng.
[ 9813.286202] usb 1-2: SerialNumber: 0001
[ 9813.294344] cdc_acm 1-2:1.0: ttyACM0: USB ACM device
[ 9813.294594] usbcore: registered new interface driver cdc_acm
[ 9813.294595] cdc_acm: USB Abstract Control Model driver for USB modems and ISDN adapters
Best regards,
Liviu

Juanito
Posts: 15
Joined: 07.06.2019, 18:30

Re: Rocrail-Raspberry Pi 3B - Dcc++ Arduino Mega

Post by Juanito » 08.06.2019, 17:00

Thank you very much for your answers.

But, to be clear, in the command
$ sudo adduser xxx dialout,

with xxx = username,

which should username be?

Liviu M
Posts: 942
Joined: 03.12.2011, 20:44

Re: Rocrail-Raspberry Pi 3B - Dcc++ Arduino Mega

Post by Liviu M » 08.06.2019, 19:54

Hi Juanito,
try the command (copy/paste it as it is in a terminal)

Code: Select all

sudo adduser $USER dialout
$USER is an environment variable, the system will automatically replace the $USER with your user name.

Liviu

Juanito
Posts: 15
Joined: 07.06.2019, 18:30

Re: Rocrail-Raspberry Pi 3B - Dcc++ Arduino Mega

Post by Juanito » 14.06.2019, 17:38

Hello friends
Thank you very much for your help. Now the problem is solved.
But it was much simpler than I imagined: simply, in Rocrail's /Controller/Device tab, I had written ttyACM0. And the right thing is /dev/ttyACM0.

And now it works perfectly. I told you I'm a rookie at Raspberry!

Greetings and see you next time.
Juan.

Post Reply

Return to “Raspberry Pi”