Keyboard Shortcuts
Likes
- Jmriusers
- Messages
Search
Motorhomer
Hi Thomas? Thanks for the reply, I will not be able to test this now till later tonight. You are correct with both sensors on positioning[1] and positioning[2] are =1 it will hunt between the two positions, both IF statements will run, but the route code in JMRI should not allow both to be ON which is what I think?is happening. I could try " else if " this will be getting about 4 IF statements?if it gets working?so will see if this works. Not sure what you mean with part 2 will have a think about this. The problem is what ever I do with the Arduino code. If JMRI is sending out instructions to move to position 1, then position 2, then position 1 when all I want it to do is move to 1 and stop. No matter what I do the arduino will move to these positions as instructed to do so. I think this is something to do with JMRI and CMRI control. Its something to do with setting it up as a route controlled by screen sensors. operating the turnouts individually?for each position it all work ok with the Arduino code Will have another try tonight On Fri, 21 Feb 2020 at 04:43, thomasmclae via Groups.Io <mclae5-lists=[email protected]> wrote: Having a quick look at the code, what happens if both positioning[1] and positioning[2] are =1? |
Having a quick look at the code, what happens if both positioning[1] and positioning[2] are =1?
In that case, you execute both If statements. Possible fixes: 1. Change the second if into elseif (Or elif, not in IDE to check syntax.) That way you do either a or b, not both. First condition has precedence over second. (If A is true, B is ignored). or 2. Split the code into sensor parsing, set single var with value of action to take (bAction = 1 or bAction = 2). This can be as complicated as needed, but results in single unambiguous result. You then have a switch/case statement for each result that sets stepper motor (Or lights, servo, etc.). A simple Serial.println statement shows what the sensor logic produced, letting you tweak that separate from action on the result. Oh, and put a Serial.print("...."); at the top of the loop. That helps resolves if both conditions are true in one loop pass. Thomas DeSoto, TX |
Locked
Re: I am Missing Something
Phil, While there are a number of issues, they can be fixed. The first thing is a decision on whether to use signal heads or signal masts. ?Either work, but for me masts seem more prototypical because the present aspects whereas heads show appearances (colors). ?If you have hardware that head based, there is an option in signal masts for creating as mast based on heads. ?When the mast has to show "diverging approach" it can set the appropriate head appearances. Based on the xml file, you will be using Layout Editor, blocks, sections, transits, dispatcher. There is residual data left over from the OBlock/Portal/OPath experiment that is causing messages on the system console. ?The easy way to clean that up has a number of steps:
The left over data will be gone. The next steps depend on the signal head/mast decision. If you want, I can clean things up based on your signal decision and upload an updated file. Dave Sand ----- Original message ----- From: Phil Law <tlcphil@...> Subject: [jmriusers] I am Missing Something Date: Thursday, February 20, 2020 6:39 PM ? I am new to JMRI well been working with it for three weeks and not much further ahead. I will apologies now for the long explanation and multiple pictures as I am hoping to get as many information as possible. ? My setup Digitrax DCS51 , PR 4 interface, BDL168. JMRI 4.1.8 ? I have a test oval on my dining room table consisting of 6 block with the train traveling in the clockwise direction. There are 3 sections of 2 blocks each. The virtual signal heads work correctly as the train passes through the blocks and are numbered using odd number 1-A to 11-F. The virtual mast head have some problems LM5-C does not change colour that I think will correct itself once the bigger issue is corrected. The goal is to be able to run two trains so they will not run into each other.
So what is the problem? ? When I go to create Sections and check the Directional Sensors Logic I get an error . This problem even existed when I used my Mac computer in full virtual mode. Here is how I go about creating my loop. ? 1 Place 6 anchors ? 2 Join the anchors with track segments getting green squares around the anchors. ? 3 Create the blocks 1 through 6 ? 4 Run the train around the loop to let JMRI create the sensor addresses ? 5 Allocate the Blocks and Sensor names. ? 6 Create the Signal Mast head name and allocate them. All but LM5-C work correctly. You might have noticed that this location has been a problem in the past. ? When I tried to import the Occupation Block I got anther warning. I am assuming that is all related to the same problem. I have missed a step some where. ? Did I need to open some script at some time? ? I have place the screen shots in the my photo called Clarifications, hopefully the link below will work. ? ? ? Sent from for Windows 10 ? |
Locked
Re: Trying to get Signal Mast logic working with Dispatcher
Thanks, don't know what I was thinking - the Signal I added the logic to was Sg_I33 and once I allocated the section, it worked fine. I did find that I needed to terminate the train and start a new one if I changed the logic in the signals, especially if I added the two sensors.?
Now it's on to discover the in's and outs of alternate sections. Scott |
Locked
Re: I am Missing Something
Thanks Dave yes it is up load hopefully it is what you are?looking for and you can see what I am doing wrong. On Thu, Feb 20, 2020 at 8:27 PM Dave Sand <ds@...> wrote:
|
Locked
New file uploaded to [email protected]
[email protected] Notification
Hello, This email message is a notification to let you know that the following files have been uploaded to the Files area of the [email protected] group. Uploaded By: Phil Law <tlcphil@...> Description: Cheers, |
Locked
Re: I am Missing Something
Phil, You screen shots are a mixture of "Layout Editor/Blocks/Sections" and "OBlocks/Portals/OPaths". ?Dispatcher uses "Layout Editor/Blocks/Sections/Transits" while Warrants uses "Control Panel Editor/OBlocks/Portals/OPaths". You need to pick one method. ? Based on group message traffic, I suspect most people lean towards the Dispatcher/Layout Editor/Blocks/Sections/Transits approach. To solve specific problems we need to see the xml file. ?If you want you can upload it to the group's ProblemsBeingWorkedOn file area. ?Create a folder with your name so it does not get lost with the others. Dave Sand ----- Original message ----- From: Phil Law <tlcphil@...> Subject: [jmriusers] I am Missing Something Date: Thursday, February 20, 2020 6:39 PM ? I am new to JMRI well been working with it for three weeks and not much further ahead. I will apologies now for the long explanation and multiple pictures as I am hoping to get as many information as possible. ? My setup Digitrax DCS51 , PR 4 interface, BDL168. JMRI 4.1.8 ? I have a test oval on my dining room table consisting of 6 block with the train traveling in the clockwise direction. There are 3 sections of 2 blocks each. The virtual signal heads work correctly as the train passes through the blocks and are numbered using odd number 1-A to 11-F. The virtual mast head have some problems LM5-C does not change colour that I think will correct itself once the bigger issue is corrected. The goal is to be able to run two trains so they will not run into each other.
So what is the problem? ? When I go to create Sections and check the Directional Sensors Logic I get an error . This problem even existed when I used my Mac computer in full virtual mode. Here is how I go about creating my loop. ? 1 Place 6 anchors ? 2 Join the anchors with track segments getting green squares around the anchors. ? 3 Create the blocks 1 through 6 ? 4 Run the train around the loop to let JMRI create the sensor addresses ? 5 Allocate the Blocks and Sensor names. ? 6 Create the Signal Mast head name and allocate them. All but LM5-C work correctly. You might have noticed that this location has been a problem in the past. ? When I tried to import the Occupation Block I got anther warning. I am assuming that is all related to the same problem. I have missed a step some where. ? Did I need to open some script at some time? ? I have place the screen shots in the my photo called Clarifications, hopefully the link below will work. ? ? ? Sent from for Windows 10 ? |
Locked
USB-CAN flow control
Does JMRI use hardware flow-control on the LCC USB port?
Sometime since the 4.6 to 4.16 upgrade, the USB port occasionally looses comms to CAN but is quite happy to listen to CAN traffic. This has occurred with several USB-CAN boards and two different manufacturers. As best as I can tell, it occurs just as the panel loads and a script sets the initial state of about 70 mainline signals. Since modifying the script to delay about 100mS, the problem appears to only occur very rarely. Regards Nom |
Locked
I am Missing Something
¿ªÔÆÌåÓý? I am new to JMRI well been working with it for three weeks and not much further ahead. I will apologies now for the long explanation and multiple pictures as I am hoping to get as many information as possible. ? My setup Digitrax DCS51 , PR 4 interface, BDL168. JMRI 4.1.8 ? I have a test oval on my dining room table consisting of 6 block with the train traveling in the clockwise direction. There are 3 sections of 2 blocks each. The virtual signal heads work correctly as the train passes through the blocks and are numbered using odd number 1-A to 11-F. The virtual mast head have some problems LM5-C does not change colour that I think will correct itself once the bigger issue is corrected. The goal is to be able to run two trains so they will not run into each other.
So what is the problem? ? When I go to create Sections and check the Directional Sensors Logic I get an error . This problem even existed when I used my Mac computer in full virtual mode. Here is how I go about creating my loop. ? 1 Place 6 anchors ? 2 Join the anchors with track segments getting green squares around the anchors. ? 3 Create the blocks 1 through 6 ? 4 Run the train around the loop to let JMRI create the sensor addresses ? 5 Allocate the Blocks and Sensor names. ? 6 Create the Signal Mast head name and allocate them. All but LM5-C work correctly. You might have noticed that this location has been a problem in the past. ? When I tried to import the Occupation Block I got anther warning. I am assuming that is all related to the same problem. I have missed a step some where. ? Did I need to open some script at some time? ? I have place the screen shots in the my photo called Clarifications, hopefully the link below will work. ? ? ? Sent from for Windows 10 ? |
Locked
Re: Problems Using NCE USB Interface Version 7 ?
Kevin Ellis
¿ªÔÆÌåÓýDave, ? I think I might of figured out the problem.? Been chatting with folks at NCE.? The version/distribution date of the USB Interface is after the fact of the missing resistors so that was not the problem.? We decided to check the CAB BUS ports on the PCP and USB Interface to make sure the pins were straight (not bent or broken).? With a flash-light I noticed that one of the pins (3rd from the left) on the USB Interface appeared to either be bent or broken.? That seems to explain why no response ever came back to the USB Interface from the CAB. ? I have sent this information on to NCE asking what needs to be done to either fix it or get it replaced.? I suspect they will replace it, but I will keep you posted. ? Regardless, thank you for all your help and I will let you know when this issue gets resolved.? Thanks again¡ ? Kevin Ellis ? From: Dave Heap
Sent: Wednesday, February 19, 2020 11:40 PM To: [email protected] Subject: Re: [jmriusers] Problems Using NCE USB Interface Version 7 ? ? Kevin,
? Your call. But make sure you ask for "with resistors". NCE seems to have been shipping them without resistors lately... ? If they want you to send something back, make sure you send all of the following (irrespective of what they say): Power Cab NCE USB PCP Both cables ? Ask them to make that combination work. This sort of problem can be specific to the particular combination. ? Dave in Australia ? ? |
Locked
Re: Trying to get Signal Mast logic working with Dispatcher
Scott, When you discover the SML for a mast, the existing SML (including any manually defined sensors) is deleted and re-created. There are a couple of things to remember when using to Section direction sensors with signal mast logic. The sensors are added to the SML using a state of Inactive. ?For Sg_I35 they would be B2S_Reverse and B2AS_Reverse. ?Since the specified transit runs left to right, this mast will always be Stop/Danger. ? When the panel is first loaded, the direction sensors are Inactive. ?This means the signal masts will be in what I call ABS mode since the sensors are not controlling the mast. ? When Dispatcher is started, all of the direction sensors are set to Active. ? This causes the masts using direction sensors to display Stop. When a train is allocated, the appropriate direction sensors are set Inactive which causes the masts to display an aspect based on normal SML rules. ?When the protected block (the block beyond the mast) becomes active, Dispatcher sets the direction sensor to Active. I put occupancy sensors and the direction sensors on the panel so that I can see what is happening. Dave Sand ----- Original message ----- From: "Scott Walton via Groups.Io" <jscottwalton@...> Subject: [jmriusers] Trying to get Signal Mast logic working with Dispatcher Date: Thursday, February 20, 2020 1:20 PM I'm slowly adding the Internal Sensors to the signal mast logic to get them to stay as "Stop" when the block is not yet allocated.? When I add the Forward Sensor for the next block to list of sensors for the Signal Mast, the mast then stays as Stop (the "Active" checkmark against the logic block gets turned off. If I delete and run "Discover" again, it goes back on, then when I add the sensor for the dispatcher, it goes off (and the mast stays at Stop). What am I doing wrong? The Panel file is in ProblemsBeingWorkedOn, folder Scott_Walton. There are also two scripts there (main_init.py which resets the state of all turnouts on the panel to their initial state, and init_sensors.py, which sets all "UNKNOWN" sensors? to "INACTIVE"). Both sensors can be used with LocoNet Simulator to see the state of the signals. A train will run automatically with the AutoActiveTrains_Simulator.py script. The specific signal mast that is causing the issues is Sg_I35 (the only one of two masts that I have added the Dispatcher sensors for yet).? The transit that applies to this is "Main_South_East_Bound", with an initial block of B2S.? Does anyone have a hint about what the problem might be? Scott Walton |
Locked
Re: Corrupt Panel
Hi Dave,
Thanks again - I will try that. I am also now having a problem with my jython scripts randomly crashing out whilst running now I loaded the new JMRI version. It is always at the same line - which is getting the state of a sensor - but happens at random times for random sensors ( the name of the sensor is an argument to the program ) It complains there is no such attribute when trying to get the sensor value. This never happened with the previous JMRI version. Is there anything I can do ? I think it is this line in the code: sensors.provideSensor(self.curr_sect).getState() Thanks once more Dave |
Locked
Re: Wifi throttles report
I agree with Robin, using a game controller makes Engine Driver a great throttle.
I use these, easy to hold and use with one hand. I often leave the phone under the layout, the game pad easily works 50' away. The joystick gives direction and speed, the buttons can control 5 functions. Mike Ruby |
Motorhomer
Hi all
?
I am trying to control a turntable (stepper motor) on an Arduino with CMRI. At the present sending a bit output from JMRI using a steady state turnout on the turn out table works all ok. Clicking to throw or close the turnout send out a 1 or 0 bit on the set address and I then use an IF statement on the Arduino code. The problems comes when I try to use an internal sensor and the route table to control each position of turnout I get more than one output from JMRI to the output when one position is selected.. Below is the setup and problem
I have a turnout table as shown with each address set to a CMRI address to the Arduino code
?
Below are the sensors internal addresses
Below is the layout turntable with the sensors placed over the turntable at the output positions. the turntable is set to not be DCC so is only really a picture on the screen (does not do anything)
now the routes two made with the setup info
route two
So this is the setup on JMRI now the Arduino code
#include <Stepper.h>
#include <CMRI.h> #include <Auto485.h> #define CMRI_ADDR 1 #define DE_PIN 2 Auto485 bus(DE_PIN); Stepper myStepper(200, 22, 23, 24, 25); CMRI cmri(CMRI_ADDR, 24, 48, bus); int positioning[4]; int currentlocation = 0; int steps; int location1 = 0; int location2 = 10; int location3 = 30; int location4 = 100; void setup() { ? ? Serial.begin(9600); ? ? myStepper.setSpeed(10); ? ? Serial.println("Setup complete"); } void loop(){ ? ? ? ? cmri.process(); ? ? positioning[1] = (cmri.get_bit(7)); // 0 steps ? ? positioning[2] = (cmri.get_bit(8)); ?// 10 steps ? ? positioning[3] = (cmri.get_bit(9)); // 30 steps ? ? positioning[4] = (cmri.get_bit(10)); // 100 steps ? ? ? ? if (positioning[1] == 1 && currentlocation != 0){ ? ? ? Serial.println("Location_1 steps 0"); ? ? ? int steps = location1 - currentlocation; ? ? ? myStepper.step(steps); ? ? ? Serial.println(steps); ? ? ? currentlocation = 0; ? ? } ? ? if (positioning[2] == 1 && currentlocation != 10){ ? ? ? Serial.println("Location_2 steps 10"); ? ? ? int steps = location2 - currentlocation; ? ? ? Serial.println(steps); ? ? ? myStepper.step(steps); ? ? ? currentlocation = 10; ? ? } } ?
To the problem. When operating each turnout one at a time from closed to throw then back to closed the stepper motor works goes to the correct position and stops.
?
When operating it by the sensors through the route the number two position is all on but going back to number one position it will hunt between one and two a number of times then eventually stop at number one. It seems like the JMRI or CMRI is sending out multiple same commands when using the route table.
?
Below is is the arduino serial output when using just the turnouts with the CMRI monitor for one moment to position two then back to position one
?
Now same thing with using the layout sensors and routes to go to position two from position one
?
now back to position one from two (monitors where cleared before hand)
?
?
Hopefully you can see in the Arduino monitor there are more than one command being received. I will try to get a video on YouTube of this but not sure this will post on here.
?
I am not clear on the CMRI monitor to fully understand what is happening. I have tried setting delays on the routes, changing he sensors to inactive when setting routes but still I get the same. This is only happening on routes. If I set this up with lights as the output and sensors control the lights on/off it all works ok but will then not have the routes which might be the best way forward.
?
Any ideas?
?
Steve
?
?
? |
Locked
Trying to get Signal Mast logic working with Dispatcher
I'm slowly adding the Internal Sensors to the signal mast logic to get them to stay as "Stop" when the block is not yet allocated.? When I add the Forward Sensor for the next block to list of sensors for the Signal Mast, the mast then stays as Stop (the "Active" checkmark against the logic block gets turned off. If I delete and run "Discover" again, it goes back on, then when I add the sensor for the dispatcher, it goes off (and the mast stays at Stop). What am I doing wrong? The Panel file is in ProblemsBeingWorkedOn, folder Scott_Walton. There are also two scripts there (main_init.py which resets the state of all turnouts on the panel to their initial state, and init_sensors.py, which sets all "UNKNOWN" sensors? to "INACTIVE"). Both sensors can be used with LocoNet Simulator to see the state of the signals. A train will run automatically with the AutoActiveTrains_Simulator.py script.
The specific signal mast that is causing the issues is Sg_I35 (the only one of two masts that I have added the Dispatcher sensors for yet).? The transit that applies to this is "Main_South_East_Bound", with an initial block of B2S.? Does anyone have a hint about what the problem might be? Scott Walton |
Locked
Re: Adjusting CV's on a consisted locomotive
Jerry,
As long as you leave CV19 and the normal address, the rest can be changed just fine. -Ken Cameron, Member JMRI Dev Team www.jmri.org www.fingerlakeslivesteamers.org www.cnymod.org www.syracusemodelrr.org |
Locked
Adjusting CV¡¯s on a consisted locomotive
If I wish to tweak some CV settings in a locomotive that is part of an NCE advanced consist using DecoderPro Programming on the Main, do I first need to remove the loco from the consist or can I just address and program the individual loco while it is still consisted?
Thanks, Jerry Breon Mooresville, NC |
Locked
Re: Using NCE Light-it as a signal head decoder
mnutt,
You need to provide a little more info for the last part of your question: "... to control sensors?" There was a post in the group a few months ago about the best way to implement the Light-Its in JMRI. Speed |
Locked
Re: Corrupt Panel
Dave, It appears that there are masts that have been removed from the panel but still have signal mast logic defined. ?Since they are no longer on a panel, the block before the mast (facing block) cannot be determined. Go to Tools >> Tables >> Signals >> Signal Mast Logic and sort by clicking on the Source header. ?Then delete the bad SML. Depending on the actual status, you may also want to delete the masts from the Signal Masts table. ?A little trick, sort by Aspect. ?If the aspect is Unknown, that implies that the mast is not a source and/or destination mast in a signal mast logic definition. Dave Sand? ----- Original message ----- From: "David Smith via Groups.Io" <daversmth@...> Subject: Re: [jmriusers] Corrupt Panel Date: Thursday, February 20, 2020 3:29 AM Hi Dave, Thanks for your help. I installed the 4.18 JMRI and recreated that sidings area of the layout in the panel in the new version Everything works fine now ?but I get an error when the panel is loaded - it does not seem to cause a problem but I would like to get rid of the error. The latest panel is in the same files area and called DavesLayout01.20Feb.xml 09:21:24.683 ( 21137) ERROR [AWT-EventQueue-0] DefaultSignalMastLogic.java:2102? - No facing block found for source mast Mst_W_Sd1a 09:21:24.683 ( 21137) ERROR [AWT-EventQueue-0] DefaultSignalMastLogic.java:2102? - No facing block found for source mast Mst_W_Sd1b 09:21:24.688 ( 21142) ERROR [AWT-EventQueue-0] DefaultSignalMastLogic.java:2102? - No facing block found for source mast Mst_W_Sd2a 09:21:24.688 ( 21142) ERROR [AWT-EventQueue-0] DefaultSignalMastLogic.java:2102? - No facing block found for source mast Mst_W_Sd2b |
Locked
Re: Wifi throttles report
Lou,
You might want to try a gamepad with your Android phones running EngineDriver.? You get operation without looking at the screen (I lock the screen and put it in my pocket after selecting the loco).? Beside the joystick for speed and direction,? there are function buttons which you can assign in EngineDriver as desired.? EngineDriver has some nice? preference options that prevent accidental direction change, etc.
Here is the one I have been using for a couple years.? Very cheap, easy to hold while uncoupling cars or checking a switchlist:
Robin Becker
San Diego CA
Robin
|