Tuesday, September 17, 2013

JMRI on Raspberry Pi (Part 1): Gathering hardware and basic setup

The time has come to attempt the installation of JMRI on a Raspberry Pi. This should be an ideal combination of hardware and software for layout control. This system will be relatively low cost, as only the physical hardware will have to be purchased. The average cost will likely be around $70 for the hardware, depending on what additional components are chosen and where the components are purchased. The system will occupy only a small footprint of space, and be low in power consumption. In  addition, the project nicely merges two interesting hobbies into one system, computers and model railroading. Throughout this series, other websites will be referred to when convenient, as there is a vast repository of knowledge available on the Internet, and why re-invent the wheel.
  1. The first step is to gather the hardware. The basic items needed are the following:
    1. Raspberry Pi, Model B from Allied Electronics
    2. USB Converter 120VAC/5V 1A  (I like the Tabeo unit from Toys R Us 1.5A)
    3. USB to mini USB connector for power to the Raspberry Pi
    4. SDHC 4Gig (Minimum) card (Get a class 10, it will boot faster)
    5. Some type of video display (HDMI or NTSC)
    6. Corresponding video cable for the display
    7. USB keyboard
    8. USB mouse
    9. Network cable and Internet connection
    10. A case for the Pi. There are a lot of choices, find one that suits you.
  2. Assemble the Raspberry Pi computer using the above components. Wait to install the SDHC card.
  3. Set up the SDHC card so that the Raspberry Pi can boot from it. This can be done on Windows, Mac or Linux. There are excellent tutorials available, so I am not going to re-invent the wheel. Here is a link to a very nice document stepping through all the aspects of the basic setup of the Raspberry Pi. It gives instructions for each of the platforms.
  4. After you install NOOBS (New Out OF Box Software) to the SD card, place the SD card into the Raspberry Pi and plug in the power. If all goes well, you should boot into an application that allows you to download various operating systems for the Pi. This is a very flexible system. 
  5. Choose the Raspbian OS by clicking on it with the mouse.
  6. Click on 'Install OS' at the bottom of the screen. This will begin the installation of the Raspbian operating system.
  7. Once the install starts, it will take anywhere from about 5 minutes to 15 minutes to complete. It will depend on the size of the SD card used. I used a 32GB SD card, and it took about 11 minutes. Please be patient while the system installs.
  8. Eventually a window will appear that says 'Restore Complete'. Click 'OK'.
  9. The system will then proceed to reboot. The system will then boot into the 'Raspberry Pi configuration tool (raspi-config)' text based menu system.
This is an excellent place to stop. Please see Part 2 of this series for how to use the Raspberry Pi configuration tool.

Further Information:

The website http://www.raspberrypi.org is an excellent place to start learning about the Raspberry Pi. Additionally, there is a free online magazine that you can download from either http://www.themagpi.com/ or the iTunes bookstore. Either way, there is no cost. If a printed copy is preferred, they are available to order directly from the site.

That's it for this installment. Learn something new every day and remember that model railroading is fun!

Saturday, May 22, 2010

Upgrading JMRI to the current stable version (2.8)

I like to keep my software up to date, and with JMRI, that gives you additional decoder definitions, as they keep adding to the list. You can also import them into a current version of JMRI, but I like to keep my software current. I downloaded the latest stable version (2.8) for Windows using the link from the JMRI download page. It is always a good idea to have a backup of your current setup, before doing any upgrades. I keep my roster stored on a server.

1. Once the software is downloaded, open the folder it was downloaded to and double click on the JMRI.2.8.exe icon. This will start the installer.
2. There will be a series of pop up windows with questions to answer. These were my responces:
- Window 1- Backup existing files (leave the box checked if you would like a backup)
- Window 2 - Anyone using this computer radio button selected
- Window 3 - Full installation (Changed from default - I want the SoundPro applicaiton installed)
- Window 4 - Default location for install
- Window 5 - JMRI folder (default)
- Window 6 - Click 'Next'
- Window 7 - Click 'Finish'
3. The software took about 2 minutes to install. (1 Gig Hz Pentium with 512 Meg. of memory)
4. Tested

The software has worked fine so far. All of my defaults were kept, and the system accessed my roster stored on the server without being reconfigured.

Now I just need to update the laptop, and try the new version under Ubuntu........

Friday, November 28, 2008

Decoder Installation – Bachman Spectrum Dash 8 40C (HO scale)

Decoder installed – Digitrax DH123

Disclaimer: These are suggestions only – use at your own risk. I successfully used this series of steps to install decoders in one of these locomotives without damage to the unit. Take your time removing shells, it will save you time repairing or replacing parts in the long run. If you are not comfortable disassembling your expensive locomotive, please save yourself a lot of agony send it out to a reputable dealer.

Note: The section on installing the lights needs some cleanup. I need to find out the correct drill bit size to ream out the light holes, and the correct resistor size for the micro bulbs. I believe the bulbs are Miniatronics.

1) Disassemble unit.
1.1) Remove side frames from trucks.
1.2) Remove two bottom screws from fuel tank
1.3) Remove two screws securing frame to shell. Don't loose plastic keepers.
2) Remove circuit board from top of frame.
3) Disassemble frame halves. Watch drive train for pieces.
4) Motor
4.1) Remove black insulating tape from around motor.
4.2) Be careful not to loose brushes
4.3) Solder orange wire to top of motor
4.4) Solder gray wire to bottom of motor
4.5) Put electrical tape over solder points
4.6) Insulate motor from frame with electrical tape
5) Trucks
5.1) Remove universal joints
5.2) Cut off metal arches from each side
5.3) Solder red wires to the fireman's side of the front and rear trucks
5.4) Solder black wires to opposite side of trucks
5.5) Reassemble frame halves with modified trucks
6) Run wires through center crack in frame. There isn't clearance to run the wires
around the frame between the frame and the shell.
7) Use a piece of foam tape and make a mounting pad at the rear of the locomotive
frame.
8) Lights
8.1) Push out the front and rear lenses.
8.2) Pick up a light kit from (hobby shop) with the correct drill bit
(need to record size here in future)
8.3) Drill out light holes for 1.2mm 1.5 volt micro bulbs
8.4) Put lights in holes, secure with some white glue and let dry.
8.5) Solder common wires together from both front and rear sets of lights.
8.6) Put small heat shrink over leads for later
8.7) Solder (470?) ohm resistor to other lead of both lights (need to double check
resistor value)
8.8) Solder yellow wire to front lights (reverse of decoder instructions)
8.9) Solder white wire to rear lights (reverse of decoder instructions)
8.10) Solder blue wire to common leads
8.11) Use some electrical tape to route wires in the top of the shell
9) Put decoder on foam tape to mount
10) Cut leads to correct length. Leave enough to turn over shell when working on unit.
11) Connect motor and truck wires to corresponding decoder wires
12) Test unit on test track
13) Shrink heat shrink tubing
14) Replace shell, careful not to pinch wires.
15) Replace screws
16) Test unit final time.

Decoder Installation – Athearn GP-35 with DCC quick plug (HO scale)

Decoder installed – Digitrax DH123

Disclaimer: These are suggestions only – use at your own risk. I successfully used this series of steps to install decoders in two of these locomotives without damage to the units. Take your time removing shells, it will save you time repairing or replacing parts in the long run. If you are not comfortable disassembling your expensive locomotive, please save yourself a lot of agony send it out to a reputable dealer.

Run time = approximately 15 minutes (your mileage may vary)

Disassembling
1) Remove couplers.
2) Lift shell off frame. Be careful not to pull too far as the lights are wired to the factory circuit board.
3) Remove the DC operations plug from the DCC quick connector.
4) Plug in the decoder.
5) Replace shell. Take care to re route the light wires so they don't get pinched as the body is replaced.
6) Test for proper operations.

Re-assembly
1) Replace couplers to secure shell to frame.
2) Test for proper operations.
Other upgrades.
1) I replace the factory couplers with Kadee #5's and bronze centering springs. They are drop in replacements.

Decoder Installation – Kato SD-40 pre DCC (HO scale)

Decoder installed – Digitrax DH163K0 (drop in replacement for this locomotive)

Disclaimer:These are suggestions only – use at your own risk. I successfully used this series of steps to install decoders in two of these locomotives without damage to the units. Take your time removing shells, it will save you time repairing or replacing parts in the long run. If you are not comfortable disassembling your expensive locomotive, please save yourself a lot of agony send it out to a reputable dealer.

Run time = approximately 1 hour (your mileage may vary)

Disassembling
1) Remove handrails from cab holes. I used a sharp knife blade held flat between the handrail and the cab to gently pry the handrail out of the hole. They came quite easily.
1.1) One on the engineers side of the cab for long hood.
1.2) Two on the fireman's side of the cab for the long hood.
1.3) One on each side steps for short hood.
2) Gently pull the long hood out of frame. There are two tabs on the long hood, one on each side approximately one inch from the back. Pulling up on the catwalks about 1 inch from the rear helped release the tabs. There is also a tab on each side under the cab. Gently work the cowling off from front to back. Be very careful not to break any of the handrails. The cowling will eventually pop off.
3) With the factory circuit board exposed, slide off the leads to the trucks. There is one lead on each corner of the factory circuit board. I chose to replace the factory incandescents with ultra bright LED's. The choice is up to you.
4) Remove 2 screws from the factory circuit board, and pull up to remove from the motors. Note orientation of the board. The motor leads are tabs tucked under the bus wires on each side of the circuit board. They will slip out when the board is lifted out.
Re assembly
1) Place the new decoder component side down on the motor and tuck the motor leads under the stirrups to each side. Make sure the leads are tight to the circuit board or the body will not fit. I would recommend soldering the motor straps to the stirrups for good contact.
2) Replace the screws holding the decoder to the motor.
3) I elected to remove the 4 wires on the decoder from the factory where the leads from the trucks would slip on, as I couldn't get the connectors to grip tight enough. I then just soldered the truck leads to the 4 corner lugs of the decoder.
4) Test the decoder for basic operation.
5) I elected to replace the factory incandescent with a Miniatronics Corp. Model 12-510-05 ultra bright LED's with the 470 ohm resistors included in the kit.
5.1) I custom bent the LED leads to be slightly further apart, the same width as the lugs on the decoder.
5.2) I soldered the resistor to the cathode and trimmed them to the same length.
5.3) Put heat shrink tubing on the leads to keep the LED's from shorting on the decoder.
5.4) I custom bent the very ends of the leads to sit flat on the decoder lugs. I tested the LED's with the lights on to make sure that the orientation was correct.
5.5) Be very careful when testing the LED's in this fashion so that you don't damage the decoder or other equipment.
6) Keep the LED's very close to the circuit board, but bend the lens back toward the end of the locomotive that you are working with, as LED's are very directional, and give off very little light to the sides or off center.
7) The alignment of the LED's is a very finicky with the light guides in the locomotive body. Be careful not to bend the LED's too far, or bend the resistor as both will break.
8) Test the lights for proper operation.
9) Replace the shell. Pull up gently on the catwalks by the tabs to enable the tabs to slide home easier..
10) Replace the handrails and test.

One item to note is that the LED's are not as bright as the incandescent lights, and is a personal choice.

Other installation notes

1) Kadee #5's and the bronze centering spring in a Kadee coupler box (slightly modified) are a drop in replacement for the factory horn hook couplers.

Decoder Installation – Atlas RS-3 (HO scale)

Decoder installed – Digitrax DH165A0 (drop in replacement for this locomotive)

Disclaimer:These are suggestions only – use at your own risk. I successfully used this series of steps to install a decoders in one of these locomotives without damage to the unit. Take your time removing shells, it will save you time repairing or replacing parts in the long run. If you are not comfortable disassembling your expensive locomotive, please save yourself a lot of agony send it out to a reputable dealer.

Run time = approximately 1 hour (your mileage may vary)

Disassembling
1) Remove handrails from cab holes. I used a tweezers to gently pry the handrail out of the hole. They came quite easily.
1.1) One on the engineers side of the cab for long hood.
1.2) Two on the engineers side of the short hood.
1.3) One one the fireman's side of the short hood.
1.4) Two on the fireman's side of the long hood.
2) Gently pull the long hood out of frame. There are two tabs on the long hood, one on each side at the back. Gently pressing in on the radiator louvers will help release the tabs. There is also a tab on each side under the cab. The tabs on the short hood are right at the front on the sides. Gently work the cowling off from front to back. Be very careful not to break any of the handrails. The cowling will eventually pop off.

3) Note the locations of the wires on the factory circuit board.
4) Remove the plastic covers from the motor leads and gently remove the motor leads.
5) Untwist the loops for the truck leads.
6)Lift the factory circuit board off of it's pegs. The circuit board needs to be higher than the weights in order to remove the rest of the wires.
7) Remove plastic caps from truck leads and remove wires.
8) Remove plastic caps from front and rear LED's and remove wires.
9) The leads on the LED's were stranded wire, so you may want to tin them with a soldering iron before re installation.

Re assembly
NOTE: When I reassembled my wires according to the factory wired circuit board, neither of the LED's functioned, and the motor was wired backwards. Don't snap the circuit board down until you have tested operations.
1) Start by replacing the motor leads and the plastic caps.
2) Replace the front and rear LED leads and replace plastic caps.
3) Replace the truck leads to the four outer lugs on the decoder and replace the plastic caps.
4) Test unit. If neither LED lights up, reverse the leads to the LED's.
5) Once the LED's are working, test motor direction in regards to the front/rear LED lighting up. If the direction doesn't coincide with the proper LED lighting up, reverse the motor leads.
6) Gently snap the decoder back on the motor posts. Be very careful of the wires, the LED wires are very stiff where the heat shrink tubing has been applied from the factory.
7) Re route the wires as the should be, and gently twist the truck leads to deal with the excess length.
8) Replace the hood. Pressing on the radiator louvers will help ease the rear tabs back in place. Use the same technique on the short hood. Press hood firmly down to snap into place fully.
9) Replace the handrails.
Other Upgrades
1) I replaced the factory knuckle couplers with Kadee #5's and the bronze return spring. They are a drop in replacement.

Decoder Installation – Atlas GP-7 (HO scale)

Decoder Installation – Atlas GP-7 (HO scale)

Decoder installed – Digitrax DH163A0 (drop in replacement for this locomotive)

Disclaimer:These are suggestions only – use at your own risk. I successfully used this series of steps to install decoders in two of these locomotives with only minor damage to the hidden tabs on one unit. Take your time removing shells, it will save you time repairing or replacing parts in the long run. If you are not comfortable disassembling your expensive locomotive, please save yourself a lot of agony send it out to a reputable dealer.

Run time = approximately 1 hour (your mileage may vary)

Disassembling
1) Remove handrails from cab holes. I used a sharp knife blade held flat between the handrail and the cab to gently pry the handrail out of the hole. They came quite easily.
1.1) One on the engineers side of the cab for long hood.
1.2) Two on the fireman's side of the cab for the long hood.
1.3) One on each side steps for short hood.
2) Gently pull the long hood out of frame. There is a tab on the end of the long hood that can be gently pried back from the bottom. There are two tabs located along the short hood. Gently work the cowling off from front to back. Be very careful not to break any of the handrails. The cowling will eventually pop off.
NOTE: The tabs on the 2nd locomotive cracked when the shell wasn't removed slowly enough. This was remedied with some plastic weld glue. Work the shells off gently!
3) With the factory circuit board exposed, remove the factory tape that keeps the LED's in position. Keep this as it will be re-installed.
4) Begin to remove wires. Do this in a logical fashion. My suggestion is to make a sketch of the connections to the board for later reference. Taking clear digital photo is also a good idea.
4.1) Remove the plastic caps from the four corner connections, set aside for later. Gently unwrap the wires and remove them from the holes. These wires go to the trucks.
4.2) Remove the plastic caps from the two center leads. These are the motor leads. Make a note of the color orientation and remove the wires.
4.3) Remove the plastic caps from the LED's. Again make a note of the colors and their locations and remove the wires.
4.5) Remove the factory motor circuit, note the orientation.
Re assembly
1) On the new decoder, put a piece of electrical tape on the bottom of the decoder between the motor mounting posts. This mimics the factory circuit board.
2) Place new decoder in place.
Suggestion: Test the decoder before doing the installation.
3) Replace LED's by threading the wires through the holes in the decoder. Carefully wrap wire around lug. Replace plastic caps. NOTE: I had to reverse the wires on the short hood LED (front) (as opposed to how the factory circuit board was wired) when I tested the unit as following the factory color code didn't work.
4) Replace the two motor leads by threading the wires through the side lugs on the decoder. Replace the plastic caps.
5) Replace the truck leads by threading the wires through the lugs in the four corners of the decoder and replace the plastic caps.
6) Test the decoder for proper operation.
7) Replace the electrical tape that we removed earlier and wrap the LED's in the same position from the factory. This ensures that the front and rear light guides line up.
Other installation notes

1) Kadee #5's and the bronze centering spring are a drop in replacement for the factory knuckle couplers.
2) When installing the coupler lift levers, I placed a drop of super glue on the two center pins, as these are a press fit and wouldn't stay on the locomotive by themselves.