Jump to content
RMweb
 

Trip

Members
  • Posts

    102
  • Joined

  • Last visited

Posts posted by Trip

  1. The code needs to be saved as a text document, not a word document. The difference is that a word document contains lots of details that are not relevant to the script, for example font type and size, paragraph spacing and so on. JMRI will not read a script that is in word document format.

     

    Instead, use a text editor, for example Notepad, which just saves the text and nothing else. It should be saved as a python file with the file suffix .py, for example 'my_turnouts.py'. It should be saved in the 'scripts' location folder, open help/locations and see where that is.

     

    There should already be a file in that folder called jmri_bindings.py along with a bunch of other scripts that come with the JMRI distribution (some of which are written by me  ;) )

  2. I should have included instructions on how to use this:

     

    Open the JMRI help menu and select 'locations'. Look for the script location. Save the above text into a file in that folder called 'my_turnouts.py' (or whatever you like). Then, from the 'panels' menu, select 'run script'. That should open the script location and you can select your new script.

     

    If nothing happens open the system console (also from the help menu). There might be error messages there that will help diagnose the problem. 

  3. Here's a script that will do what you want I think:

    import jmri as jmri
    from jmri_bindings import *
    import time
    
    class MyTurnouts():
    
        def __init__(self):
            pass
    
        def setTurnouts(self, turnoutList):
            for point in turnoutList:
                name, action, delay = point
                t = turnouts.getTurnout(name)
                t.setCommandedState(action)
                time.sleep(delay)
    
    # Edit this bit with your own list of turnouts:
    turnoutList = [
        ["LT1", CLOSED, 2],    # set the turnout called LT1 to state 'closed' and wait 2 seconds
        ["LT2", THROWN, 3.5],  # set the turnout called LT2 to state 'thrown' and wait 3.5 seconds
        ["LT3", CLOSED, 0]     # set the turnout called LT3 to state 'closed' and don't wait
    ]
    
    MyTurnouts().setTurnouts(turnoutList)
    
    

    Edit the list of turnouts to match your turnout names (either system or user name will work) and the direction ans delay you want. You're not limited to three, add more lines as you need to. A delay of zero effectively means do the next one at the same time so you can batch them up.

     

    Once you've get that working I'll show you how to do it for multiple routes and have the script fired automatically by the JMRI route.

  4. I'm after a centerline HO3 track cleaner (or similar) in the UK.

     

    1. Anyone selling one? Thought not.

    2. Any UK based alternatives to the centerline track cleaner?

    3. If I buy from the US the shipping is expensive. I might do it anyway. Anyone else want to buy one and split the shipping costs?

     

    cheers

  5. It looks great for the price. My questions would be:

     

    1. is it possible (or will it be) to upgrade to more than 3.5A?

    2. is it possible (or will it be) to connect to a computer for use with jmri/RR&Co etc? It does mention a USB interface but only for firmware upgrades.

     

    Edit: I've now seen the email from the developer upthread. When it gets a Loconet interface I might well buy one.

  6. 1. put the switch to 'set' (away from the motor chassis)

    2. press SWCH and key in address 40

    3. press 'c' and 't' a couple of times (there will be no reaction)

    4. put the switch to 'run' (back towards the motor chassis)

    5. press 'c' or 't' and the motor will react

     

    I've just done that exact procedure on a batch of 12 cobalt ip digitals and it worked every time. 

    • Like 1
  7. Switch is on the bottom by the wiring terminals.

    I've not had the address issue on mine even with shorts and by the description of the gearing problem I think those were the early cobalts which was sorted with V2 and the IP versions.

    Agreed, I've just had a batch of 12 cobalt IP digitals delivered and I don't see any issues with shorts or gearing. And believe me there have been plenty of shorts.

     

    For £15 you get a combined slow motion motor and decoder and frog juicer and a spare SPDT switch. Of course their long term reliability is yet to be established but I think they are worth a punt.

    • Like 1
  8. I had a similar issue with those motors and the instructions are not very clear.

     

    To get the motor to learn an address flick the switch to 'set', press SWCH, enter the address you want it to learn and hit t and c a couple of times. The motor will not move. There is no indication that it's worked. Flip the switch to 'run' (you dot have to cycle power despite what the instructions say) and hitting t and c will actually operate the motor.

     

    If you want to turn auto centering on do the above procedure but use 199 as the address. To turn auto centering off use 198. In both those cases you do need to turn track power off and then on in order to confirm its worked. The motor does not lose its actual address when you do that (assuming you had set one).

×
×
  • Create New...