Author Topic: Raspberry Pi 3 in the House... and Running JMRI!  (Read 9801 times)

0 Members and 1 Guest are viewing this topic.

C855B

  • Crew
  • *
  • Posts: 8101
  • Respect: +1066
Raspberry Pi 3 in the House... and Running JMRI!
« on: June 25, 2016, 08:26:50 PM »
+3
A handful of folks have had success getting JMRI to run on the ultra-cheap Raspberry Pi educational computer, but the earlier iterations imposed "Linux expert" burdens of knowing which bits needed to be downloaded separately, and which modules needed to be added or even recompiled (in some cases). Definitely not plug-and-play, and did nothing to salve my irritation with Linux integrations from my past job(s).

Raspberry Pi 3 changes all that. The supplied boot loader (NOOBS) was setup for Raspbian (Debian for Raspberry Pi) out of the box. I ran the update/upgrade process just to make sure that the OS was current - took about an hour - and voila!, a very impressive little system. And I do mean "little":



It's powerful enough to drive a 1080p monitor at full resolution from a 1080p video stream (my railcam). But would it run JMRI? Yes. And without a lot of fooling around, either. I downloaded the Linux version of JMRI from jmri.org, unpacked it, and it ran. First time:



Digitrax PR3 was plugged into one of the USB ports, and it was Loconet to a Zephyr. Stuff just ran, both from the JMRI throttle window and from my iPhone through WiThrottle server. I didn't try programming anything just yet and I didn't test PanelPro, but all I did was click on DecoderPro, and everything worked as if I was on a real PC.

All in all, not bad for a $35 computer. (Oh, the pretty case will set you back $9. :facepalm: )
...mike

http://www.gibboncozadandwestern.com

We don't make mistakes, we have happy accidents. We just don't tell anybody. -Bob Ross

reinhardtjh

  • Crew
  • *
  • Posts: 1897
  • Respect: +131
Re: Raspberry Pi 3 in the House... and Running JMRI!
« Reply #1 on: June 25, 2016, 10:58:58 PM »
0

I knew you'd like it if you ever got a chance to try one.  The Raspberry Pi 2 works just as well.  The Raspbian flavor of Debian has been pretty much plug n play for JMRI for a year or so now.  The biggest tripping point for most people seems to be understanding to add their user account the dialout group so that they have the privs to access the USB port for the DCC interface (Loconet, NCE or Lenz) of their choice. Just don't run JMRI as root.  They say that's bad (not quite as bad as crossing the streams, but close).

The nice thing about the Pi 3 is the built in WiFi and, of course, the speed bump from the faster processor.  I have a Pi Model B I just built as a DNS/DHCP/NTP server since it's been bumped from other duties by the Pi 2 and Pi 3.  It runs the newest Raspbian Jessie without any problems.
John H. Reinhardt
PRRT&HS #8909
C&O HS #11530
N-Trak #7566

C855B

  • Crew
  • *
  • Posts: 8101
  • Respect: +1066
Re: Raspberry Pi 3 in the House... and Running JMRI!
« Reply #2 on: June 26, 2016, 12:00:14 AM »
0
Unfortunately, from my reading of the setup docs, the root issue remains if you're accessing the GPIO due to the usual arcane Linux lib issues. I'm not doing that yet, but should be, not too far off. Not clear - is user 'pi' root? I'm not real worried at the moment, it's all on a local subnet. I'll move everything off of 'pi' if necessary, however.

Yes, Raspbian Jessie was the key, even for the Pi2B. It mitigated all sorts of woes by including Java, and TxRx was fixed in all of it, as well. It's about as turnkey as you can get at this point.

The only bug I've run into at this point is it still doesn't have enough HP to run the MP4/h.264 codec in VLC. It slams into a performance wall, probably leftovers from the big falling out between Debian coders and the MPEG working group where they can't use the "official" mpeg4 decoder and rely on a hack. Fortunately omxplayer is up to the task for RTSP streams.
...mike

http://www.gibboncozadandwestern.com

We don't make mistakes, we have happy accidents. We just don't tell anybody. -Bob Ross

reinhardtjh

  • Crew
  • *
  • Posts: 1897
  • Respect: +131
Re: Raspberry Pi 3 in the House... and Running JMRI!
« Reply #3 on: June 26, 2016, 12:41:06 AM »
0
Unfortunately, from my reading of the setup docs, the root issue remains if you're accessing the GPIO due to the usual arcane Linux lib issues. I'm not doing that yet, but should be, not too far off. Not clear - is user 'pi' root? I'm not real worried at the moment, it's all on a local subnet. I'll move everything off of 'pi' if necessary, however.

I remember reading about that issue when the Pi 3 first came out.  There were a few posts about it in the JMRI Yahoo group.  Supposedly an update to one of the libraries was supposed to fix that, but I'm not sure if it ever happened.  That's something I need to look at because I wanted to add a couple buttons controlling GPIO pins to mine.

The Pi user is not root. It's just a normal user account.  You can sudo to root from it though.  So if JMRI is running on the pi account, you're okay except for the GPIO issue.
John H. Reinhardt
PRRT&HS #8909
C&O HS #11530
N-Trak #7566

reinhardtjh

  • Crew
  • *
  • Posts: 1897
  • Respect: +131
Re: Raspberry Pi 3 in the House... and Running JMRI!
« Reply #4 on: June 26, 2016, 11:39:35 PM »
0
Looks like if you're running Raspbian Jessie then all you have to do is add your user to the gpio group.  There is a device /dev/gpiomem that allows access to the GPIO pins and it's set up for non-sudo, non root access for processes running in the gpio group

ls -al /dev/gpiomem
crw-rw---- 1 root gpio 244, 0 Jun 23 00:47 /dev/gpiomem

Some discussion here: https://www.raspberrypi.org/forums/viewtopic.php?f=28&t=133996
  and here: http://raspi.tv/2015/gpio-zero-introduction
John H. Reinhardt
PRRT&HS #8909
C&O HS #11530
N-Trak #7566

C855B

  • Crew
  • *
  • Posts: 8101
  • Respect: +1066
Re: Raspberry Pi 3 in the House... and Running JMRI!
« Reply #5 on: June 27, 2016, 12:11:19 AM »
0
Good deal. Thanks! I won't be messing with it for GPIO functions for a couple of months, but nice to see that it's straightforward. In the meanwhile, I do need to study up on how JMRI is configured to access the pins. Given the price/performance of the Raspberry Pi, I'm now thinking that my plans to incorporate a DCC/DCC/LCC hybrid bus may give way to a DCC/Ethernet setup. We'll see.
...mike

http://www.gibboncozadandwestern.com

We don't make mistakes, we have happy accidents. We just don't tell anybody. -Bob Ross

Ed Kapuscinski

  • Global Moderator
  • Crew
  • *
  • Posts: 18157
  • Has a degree in American History & Culture.
  • Respect: +2320
    • Conrail 1285
Re: Raspberry Pi 3 in the House... and Running JMRI!
« Reply #6 on: June 27, 2016, 05:49:09 PM »
0
Oh man, I've had a Pi sitting around doing nothing and am definitely getting tired of dragging my laptop into the basement every time I want to use JMRI.

Philip H

  • Crew
  • *
  • Posts: 7431
  • Gender: Male
  • Respect: +488
    • Layout Progress Blog
Re: Raspberry Pi 3 in the House... and Running JMRI!
« Reply #7 on: June 27, 2016, 06:21:00 PM »
0
Could someone here please speak English? Not all of us are Linux nerds ya know.
That said I'm glad to hear this works - I've wanted to get into JMRI for a while now, but with the current layout coming down I have held off. Good to know there's an economical solution.
Philip H.
Chief Everything Officer
Baton Rouge Southern RR - Mount Rainier Division.

"Yes there are somethings that are "off;" but hey, so what." ~ Wyatt

"I'm trying to have less cranial rectal inversion with this." - Ed K.

"There's more to MRR life than the Wheezy & Nowheresville." C855B

basementcalling

  • Crew
  • *
  • Posts: 2468
  • Gender: Male
  • Respect: +216
Re: Raspberry Pi 3 in the House... and Running JMRI!
« Reply #8 on: June 28, 2016, 01:32:48 AM »
0
You serving that with whipped cream?
Peter Pfotenhauer

Iain

  • Crew
  • *
  • Posts: 4405
  • Gender: Female
  • Na sgrìobhaidh a Iain
  • Respect: +206
    • The Best Puppers
Re: Raspberry Pi 3 in the House... and Running JMRI!
« Reply #9 on: July 06, 2016, 06:04:24 PM »
0
A Pine64 board (same price range, better hardware), running Fedora aarch64 (64 bit ARM, same as the Pi3) is pretty wicked.  The problem with the Pi3 is no one is shipping a 64 bit userspace for it, and the cpu still requires non-mainline bits and even binary blobs to boot.

\
Thanks much,
Mairi Dulaney, RHCE
Member, Free Software Foundation and Norfolk Southern Historical Society

http://jdulaney.com

Kisatchie

  • Crew
  • *
  • Posts: 4179
  • Gender: Male
  • Respect: +60
Re: Raspberry Pi 3 in the House... and Running JMRI!
« Reply #10 on: July 06, 2016, 06:13:31 PM »
0
A Pine64 board (same price range, better hardware), running Fedora aarch64 (64 bit ARM, same as the Pi3) is pretty wicked.  The problem with the Pi3 is no one is shipping a 64 bit userspace for it, and the cpu still requires non-mainline bits and even binary blobs to boot.

I have no idea whatsoever what that means.


Hmm... don't try to
explain. Kiz is dense...


Two scientists create a teleportation ray, and they try it out on a cricket. They put the cricket on one of the two teleportation pads in the room, and they turn the ray on.
The cricket jumps across the room onto the other pad.
"It works! It works!"

Iain

  • Crew
  • *
  • Posts: 4405
  • Gender: Female
  • Na sgrìobhaidh a Iain
  • Respect: +206
    • The Best Puppers
Re: Raspberry Pi 3 in the House... and Running JMRI!
« Reply #11 on: July 06, 2016, 07:03:19 PM »
0
I have no idea whatsoever what that means.


Hmm... don't try to
explain. Kiz is dense...



A Pine64 is a single board computer similar to the Raspberry Pi, but with a better processor, more ram, and about the same price.

Fedora is a GNU/Linux distribution, same as Raspbian.
Thanks much,
Mairi Dulaney, RHCE
Member, Free Software Foundation and Norfolk Southern Historical Society

http://jdulaney.com

ednadolski

  • Crew
  • *
  • Posts: 3128
  • Respect: +396
Re: Raspberry Pi 3 in the House... and Running JMRI!
« Reply #12 on: July 06, 2016, 10:39:09 PM »
0
I have no idea whatsoever what that means.

A bit scary, but I did understand it....  :facepalm:

I should probably research this, but I'll just ask:   are there any boards or daughtercards for the Pi that support a lot of GPIO lines?    For Arduino there is a 48-pin I/O MUX, and the Arduino Mega supports 54 lines, but it would be interesting to know what is available for the Pi system.

Ed

railnerd

  • Crew
  • *
  • Posts: 621
  • Gender: Male
  • Respect: +156
Re: Raspberry Pi 3 in the House... and Running JMRI!
« Reply #13 on: July 07, 2016, 01:34:08 AM »
0
A bit scary, but I did understand it....  :facepalm:

I should probably research this, but I'll just ask:   are there any boards or daughtercards for the Pi that support a lot of GPIO lines?    For Arduino there is a 48-pin I/O MUX, and the Arduino Mega supports 54 lines, but it would be interesting to know what is available for the Pi system.

Ed

Sorry for the continual geek-speeq, but at the NMRA convention SIG room, MRCS is demoing one of my hobby projects: a breakout board that allows the PiZero (or other 40-pin Raspberry Pi) to attach to their existing IOX boards with a 5V I2C interface.

  http://www.modelrailroadcontrolsystems.com

I assume Seth & Chuck will have more info about "C/MRI-Pi" or "PiNode" soon.  The same board can either support C/MRI over Ethernet, LocoNet over TCP, or your own hacking.

-Dave

peteski

  • Crew
  • *
  • Posts: 21476
  • Gender: Male
  • Honorary Resident Curmudgeon
  • Respect: +1999
    • Coming (not so) soon...
Re: Raspberry Pi 3 in the House... and Running JMRI!
« Reply #14 on: July 07, 2016, 01:46:17 AM »
+1
Sorry for the continual geek-speeq . . .

Why apologize? You are in the DCC/Electronic forum and the info is model-railroading-related. You are in perfect compliance!  ;)
--- Peteski de Snarkski

-"Look at me, I'm satirical!!!"
-"Look at me, I'm anal retentive!!!"
-"Look at me, I have the most posts evahhhh!!!"
-"Look at me, I'm snarky!!!!"
-"Look at me, I have OCD!!!"
-"Look at me, I'm a curmudgeon!!!!"
-"Look at me, I'm not negative, just blunt and honest!!!"