Welcome to MattzoBricks Forums Sensors Sensors not recognised in by Rocrail

Viewing 8 reply threads
  • Author
    Posts
    • #7845
      Des MatejkaDes Matejka
      Participant

      I have been unable to get two sensor working with Rocrail using the MLC

      I purchased all the component parts built the controller including the 3-D printed enclosure.

      I did not connect all of the pins to the controller board

      I used the LED and D1 and D2 for the sensor.

      I only soldered four pins to the controller board to connect 2 sensors using S & G omitting V.

      The pin connection was tested with a multimeter and appears to be working providing quite low voltage in the range of 1.5 – 4.0 mV.

      The board is designated as EEPROM: 45036 within VS Studio, so the Rocrail Node ID is 45036 and the Address is 1 and 2 respectively for each of the sensor connections.

      Rocrail seems to recognise the sensor via the sensor monitor

      I have used two sensors.

      When using Rocrail there is no feedback or action from the sensors. They behaves as if they are not connected – just dead.
      Subsquently the locomotives can run but do not activate the sensor via the magnet underneath.

      So basically I have reached a dead end at this stage.

      Any assistance would be much appreciated.

    • #7846
      Matthias RunteMatthias Runte
      Keymaster

      Hi Des,
      don’t worry, I believe you are only an inch from the solution. If you see the sensors working in the sensor monitor in Rocrail, you have already solved 99% of the work. The rest should only be a bit of Rocrail configuration, or there is a problem in the MLC configuration.

      My recommendation is to validate that the sensors are triggered in Rocrail by displaying the “Trace” window in Rocrail. Make sure that sensors events are shown in the Trace log, and restart Rocrail after you have changed Rocrail settings via Rocview.

      Just in case, could you please post your MLC config file here?

    • #7847
      Des MatejkaDes Matejka
      Participant

      Thanks for the reply,
      I’m not sure if this is what you need:

      Copyrights © 2002-2024 Robert Jan Versluis.
      All rights reserved.
      —————————————————
      RRRRRR lll
      RRR RRR iii lll
      RRR RRR lll
      RRRRRR ooooo ccccc rrrrrr aaaaaa iii lll
      RRR RRR ooo ooo ccc rrr rrr aaa aaa iii lll
      RRR RRR ooo ooo ccc rrr aaa aaa iii lll
      RRR RRR ooooo ccccc rrr aaaaaa iii lll
      —————————————————
      TM and Copyright 2002-2024 Robert Jan Versluis.
      All Rights Reserved.
      r.j.versluis@rocrail.net
      https://wiki.rocrail.net
      —————————————————
      SupportKey expires in 338 days. [05-11-2025]
      —————————————————
      Rocrail Pro 2.1.5199 [REGULAR]:[Oct 28 2024]
      —————————————————
      processid = 6593
      ip = 192.168.1.207
      pwd = /Users/des/rocrail/Grove_Bricks_Rail
      args = OCmdLn: key=-l value=/Applications/Rocrail/Rocrail.app/Contents/MacOS/../Frameworks, key=-w value=/Users/des/rocrail/Grove_Bricks_Rail, key=-lic value=/Users/des/rocrail/lic.dat,
      ————————————————–
      20241202.082743.872 r9999I main OApp 1263 dpIID = []
      20241202.082743.872 r9999I main OApp 1264 ptIID = []
      20241202.082743.872 r9999I main OApp 1265 svIID = []
      20241202.082743.872 r9999I main OApp 1266 lcIID = []
      20241202.082743.874 r9999I main OModel 0483 parsing [plan.xml]…
      20241202.082743.875 r9999I main OModel 0501 parsePlan file: plan.xml
      20241202.082743.879 r9999I main OModel 0554 parsePlan title: Grove_Bricks_Rail
      20241202.082743.879 r9999I main OModel 5656 init clearingMaps…
      20241202.082743.879 r9999I main OModel 5688 init creatingMaps…
      20241202.082743.881 r9999I main OModel 3574 createFbAddrMap: size=3.
      20241202.082743.883 r9999I main ORoute 0329 add route sensor [L1_01]
      20241202.082743.883 r9999a main OFBack 0369 L1_01 listener added for st:[bk2+]-[bk1-]
      20241202.082743.886 r9999a main OBlock 2251 fbevent added by key [bk1+-all-reverse]
      20241202.082743.886 r9999a main OFBack 0369 bk1+ listener added for bk:bk1
      20241202.082743.886 r9999a main OBlock 2251 fbevent added by key [bk1–all-reverse]
      20241202.082743.886 r9999a main OFBack 0369 bk1- listener added for bk:bk1
      20241202.082743.890 r9999I main OLoc 7601 no restore wanted: reset speed for loco [Maersk_Container_Loco]
      20241202.082743.890 r9999I main OLoc 7605 no restore wanted: reset functions for loco [Maersk_Container_Loco]
      20241202.082743.896 r9999I main OLcDrive 1018 LcDriver 2.1.0 loaded for Maersk_Container_Loco
      20241202.082743.896 r9999I main OLoc 6239 show loco [Maersk_Container_Loco]
      20241202.082743.897 r9999I main OModel 3596 createSwAddrMap: size=0.
      20241202.082743.897 r9999I main OModel 3617 createCoAddrMap: size=0.
      20241202.082743.898 r9999I main OControl 2660 initDigInts lib=[wio] iid=[WIO]
      20241202.082743.902 r9999I main WIOlib 1025 —————————————-
      20241202.082743.902 r9999I main WIOlib 1026 WIOlib 2.1.0
      20241202.082743.902 r9999I main WIOlib 1027 IID : WIO
      20241202.082743.902 r9999I main WIOlib 1028 NodeID : 255
      20241202.082743.902 r9999I main WIOlib 1029 Server : localhost
      20241202.082743.902 r9999I main WIOlib 1030 DCC NodeID : 0
      20241202.082743.902 r9999I main WIOlib 1031 Sensor simulate: on
      20241202.082743.902 r9999I main WIOlib 1032 Sensor timer : 0ms
      20241202.082743.902 r9999I main WIOlib 1033 Sub library : default
      20241202.082743.902 r9999I main WIOlib 1034 RS485 :
      20241202.082743.902 r9999I main WIOlib 1035 Devices in use :
      20241202.082743.902 r9999I main WIOlib 1036 WD Excludes :
      20241202.082743.902 r9999I main WIOlib 1037 —————————————-
      20241202.082743.902 r9999I main OControl 2812 initDigInts OK
      20241202.082743.903 r9999I main OPowerMa 0621 Power Manager instantiated.
      20241202.082743.903 r9999I main OControl 0201 Init short circuit sensor…
      20241202.082743.903 r9999I main OR2Rnet 0898 R2Rnet multicast address [224.0.1.20]
      20241202.082743.903 r9999I clocktic OControl 3106 ClockTicker started.
      20241202.082743.903 r9999I checker OControl 3198 switch position checker started
      20241202.082743.903 r9999I main OR2Rnet 0899 R2Rnet multicast port [8051]
      20241202.082743.904 r9999I main OR2Rnet 0900 R2Rnet local IP []
      20241202.082743.904 r9999I main OR2Rnet 0901 R2Rnet nodeID [255]
      20241202.082743.904 r9999I main OR2Rnet 0902 R2Rnet WIO RASCII [false]
      20241202.082743.904 r9999I r2rwrite OR2Rnet 0580 R2Rnet writer…
      20241202.082743.904 r9999I main OModel 8860 loading occupancy file [occ.xml]
      20241202.082743.904 r9999I mdnsS OMDNSUti 0851 Service thread started, hostname=[Douglas.local]
      20241202.082743.905 r9999a main OModel 6811 try to find location for block [bk1]
      20241202.082743.905 r9999I main OModel 8970 block [bk1]
      20241202.082743.905 r9999I main OModel 8919 restore loco placing for [Maersk_Container_Loco] bkid=[bk2] section=[] enterside=0 placing=0
      20241202.082743.905 r9999a main OModel 6811 try to find location for block [bk2]
      20241202.082743.905 r9999I main OModel 8970 block [bk2]
      20241202.082743.905 r9999W main OModel 8994 block [bk3] not found for restoring occupancy
      20241202.082743.905 r9999W main OModel 8994 block [bk4] not found for restoring occupancy
      20241202.082743.905 r9999W main OModel 8994 block [L3] not found for restoring occupancy
      20241202.082743.905 r9999W main OModel 8947 loco [j52-1] not found
      20241202.082743.905 r9999W main OModel 8994 block [L4] not found for restoring occupancy
      20241202.082743.905 r9999W main OModel 8947 loco [Terrier] not found
      20241202.082743.905 r9999W main OModel 8994 block [R1] not found for restoring occupancy
      20241202.082743.905 r9999W main OModel 8947 loco [j52] not found
      20241202.082743.905 r9999W main OModel 8994 block [R2] not found for restoring occupancy
      20241202.082743.906 r9999I main OModel 5731 init blocks…
      20241202.082743.906 r9999I main OBlock 4869 init block bk1, lockiD=[]
      20241202.082743.907 r9999a main OBlock 1386 block [bk1]: loco [(null)] reports mode[unlock] manual=0
      20241202.082743.907 r9999a main OBlock 1012 set block [bk1] default aspect to 0
      20241202.082743.907 r9999a main OBlock 5877 set block [bk1] aspect to red
      20241202.082743.907 r9999a main OBlock 5877 set block [bk1] aspect to red
      20241202.082743.907 r9999a main OBlock 1012 set block [bk1] default aspect to 0
      20241202.082743.907 r9999a main OBlock 5877 set block [bk1] aspect to red
      20241202.082743.907 r9999a main OBlock 5877 set block [bk1] aspect to red
      20241202.082743.907 r9999a main OBlock 2026 [bk1] CAR COUNT = 0
      20241202.082743.907 r9999a main OFBack 0486 [bk1+] CAR COUNT = 0
      20241202.082743.907 r9999a main OFBack 0486 [bk1-] CAR COUNT = 0
      20241202.082743.907 r9999a main OBlock 4148 Block [bk1] reset counters and event triggers
      20241202.082743.907 r9999I main OBlock 4869 init block bk2, lockiD=[Maersk_Container_Loco]
      20241202.082743.907 r9999a main OBlock 1386 block [bk2]: loco [(null)] reports mode[unlock] manual=0
      20241202.082743.907 r9999a main OLoc 4293 set previous block to [-], new to [bk2]
      20241202.082743.907 r9999a main OLoc 4297 set cur block to [bk2], prev cur block [-]
      20241202.082743.907 r9999a main OBlock 4907 set block [bk2] signals to red
      20241202.082743.907 r9999a main OBlock 5877 set block [bk2] aspect to red
      20241202.082743.907 r9999a main OBlock 5877 set block [bk2] aspect to red
      20241202.082743.907 r9999a main OBlock 4915 set block [bk2] signals to red
      20241202.082743.907 r9999a main OBlock 5877 set block [bk2] aspect to red
      20241202.082743.907 r9999a main OBlock 5877 set block [bk2] aspect to red
      20241202.082743.908 r9999a main OBlock 2026 [bk2] CAR COUNT = 0
      20241202.082743.908 r9999a main OBlock 4148 Block [bk2] reset counters and event triggers
      20241202.082743.908 r9999I main OModel 5739 init seltabs…
      20241202.082743.908 r9999I main OModel 5755 init stageblocks…
      20241202.082743.908 r9999I main OModel 5771 init turntables…
      20241202.082743.908 r9999I main OMVTrack 0529 MVTrack
      20241202.082743.908 r9999I main OMVTrack 0416 Init sensors for the MVTrack…
      20241202.082743.908 r9999I main OWeather 1142 weather pause=0
      20241202.082743.909 r9999I lightrun OLightCt 0182 light control started…
      20241202.082743.909 r9999I main OCompeti 0270 competition ready to go…
      20241202.082743.909 r9999I main OClntCon 1053 MQTT Broker: localhost:1883
      20241202.082743.909 r9999I cconmngr OClntCon 0519 Manager started.
      20241202.082743.909 r9999I broadcas OClntCon 0717 Broadcaster started.
      20241202.082743.909 r9999I main OClntCon 1065 ClientConnection started on port 8051.
      20241202.082743.909 r9999I mqttread OClntCon 0918 MQTT Service started.
      20241202.082743.909 r9999I mqttread OMQTT 0129 trying to connect to broker localhost:1883
      20241202.082743.910 r9999I mqttdisc OClntCon 0887 MQTT broker discovery service started.
      20241202.082743.910 r9999I htm02C5E OHttp 0149 HTTPManager started on 8008.
      20241202.082743.910 r9999I hts02C5E OHttp 0101 HttpService started on 8008.
      20241202.082743.910 r9999I mqttread OMQTT 0137 connected to localhost:1883 with userID/passwd [grove_bricks][–blank–]
      20241202.082743.910 r9999I mqttread OMQTT 0151 willtopic=[rocrail/service/info] willmsg=[<exception text=”abend”/>]
      20241202.082743.910 r9999I mqttread OClntCon 0953 MQTT topic=[]
      20241202.082743.910 r9999I mqttread OMQTT 0413 SUBSCRIBE: Topic=rocrail/service/client
      20241202.082743.910 r9999I mqttread OMQTT 0413 SUBSCRIBE: Topic=rocrail/service/field
      20241202.082743.912 r9999I main OArchive 0557 ————————————————————
      20241202.082743.912 r9999I main OArchive 0558 @Box
      20241202.082743.912 r9999I main OArchive 0559 home = [abox]
      20241202.082743.912 r9999I main OArchive 0560 readonly = [false]
      20241202.082743.912 r9999I main OArchive 0561 Copyright (c) 2002-2024 Robert Jan Versluis, Rocrail.net
      20241202.082743.912 r9999I main OArchive 0562 All rights reserved.
      20241202.082743.913 r9999I main OArchive 0563 ————————————————————
      20241202.082743.913 r9999I main OArchive 0450 read ini [abox/rocabox.ini]
      20241202.082743.914 r9999I main OArchive 0468 categories = []
      20241202.082743.914 r9999I main OModel 2412 Checking all Loco’s for V=0…
      20241202.082743.925 r9999I main OModel 5390 init Track Driver blocks…
      20241202.082743.925 r9999I main OModel 0764 updateFB
      20241202.082743.925 r9999I main OClntCon 0771 mqtt publish to [rocrail/service/command]:[<fbinfo cmd=”fbmods”/>
      ]
      20241202.082743.925 r9999I main OModel 0769 update Boosters…
      20241202.082743.925 r9999I main OClntCon 0771 mqtt publish to [rocrail/service/command]:[<boosterlist/>
      ]
      20241202.082743.976 r9999I cconmngr OClntCon 0559 client [127.0.0.1] connected, count=1
      20241202.082743.976 r9999I 1_121056 OClntCon 0323 command reader started for 127.0.0.1 []
      20241202.082743.977 r9999I infw1210 OClntCon 0130 info writer started for 127.0.0.1 []
      20241202.082744.375 r9999I timedoff OModel 2432 timed off thread started
      20241202.082744.400 r9999I Maersk_C OLoc 3071 Runner for “Maersk_Container_Loco” started.
      20241202.082744.405 r9999I r2rreade OR2Rnet 0500 R2Rnet reader started.
      20241202.082744.407 r9999I r2rreade OR2Rnet 0533 R2Rnet host address: [192.168.1.207]
      20241202.082744.907 r9999I r2rwrite OR2Rnet 0586 R2Rnet writer started.
      20241202.082744.908 r9999I clocktic OClntCon 0771 mqtt publish to [rocrail/service/command]:[<clock divider=”1″ hour=”8″ minute=”27″ ]
      20241202.082744.913 r9999I makeWeat OWeather 0941 make weather started for [none]…
      20241202.082744.981 r9999a 1_121056 OModel 2768 model: themes
      20241202.082744.993 r9999I 1_121056 OClntCon 0423 monitoring for client is on
      20241202.082744.994 r9999I 1_121056 OClntCon 0439 client has control access
      20241202.082744.994 r9999a 1_121056 OModel 2768 model: plan
      20241202.082744.995 r9999I 1_121056 OModel 3099 valid support key:
      20241202.082745.075 r9999a 1_121056 OModel 2768 model: fstat
      20241202.082745.075 r9999I 1_121056 OModel 3389 Sending 0 fstats to client…
      20241202.082745.153 r9999I 1_121056 OControl 2075 provide Rocrail properties: /dev/tty.BLTH,/dev/tty.PT-P710BT6492,/dev/tty.Bluetooth-Incoming-Port,/dev/tty.wchusbserial1440,/dev/tty.usbserial-1440
      20241202.082748.913 r9999I wiodec OWIO 2068 WIO watchdog did start
      20241202.082800.949 r9999I clocktic OClntCon 0771 mqtt publish to [rocrail/service/command]:[<clock divider=”1″ hour=”8″ minute=”28″ ]
      20241202.082823.215 r9999a 1_121056 OModel 2768 model: modify
      20241202.082823.218 r9999I 1_121056 OFBack 1130 modify L1_01
      20241202.082823.219 r9999I 1_121056 OModel 3540 removeFbKey: size=3.
      20241202.082823.220 r9999I 1_121056 OClntCon 0771 mqtt publish to [rocrail/service/command]:[<fbinfo cmd=”fbmods”/>
      ]
      20241202.082823.901 r9999a 1_121056 OModel 2768 model: modify
      20241202.082823.901 r9999I 1_121056 OFBack 1130 modify L1_01
      20241202.082823.902 r9999I 1_121056 OModel 3540 removeFbKey: size=3.
      20241202.082823.903 r9999I 1_121056 OClntCon 0771 mqtt publish to [rocrail/service/command]:[<fbinfo cmd=”fbmods”/>
      ]
      20241202.082901.125 r9999I clocktic OClntCon 0771 mqtt publish to [rocrail/service/command]:[<clock divider=”1″ hour=”8″ minute=”29″ ]
      20241202.082957.187 r9999I hts02C5E OHClient 1334 GET / HTTP/1.1
      20241202.082957.192 r9999I hts02C5E OHClient 0293 issuepath [issues]
      20241202.082957.298 r9999I hts02C5E OHClient 0055 delete client socket 028348E0…
      20241202.083001.307 r9999I clocktic OClntCon 0771 mqtt publish to [rocrail/service/command]:[<clock divider=”1″ hour=”8″ minute=”30″ ]

    • #7848
      Matthias RunteMatthias Runte
      Keymaster

      The file I am looking for is called controller_config.h. This is usually located in a directory like “..\MLC\conf\my”.

    • #7851
      Matthias RunteMatthias Runte
      Keymaster

      In behalf of Des, I am posting his MLC config file here:

      // *********************
      // COPYRIGHT AND LICENSE
      // *********************

      // Author: Dr. Matthias Runte
      // Copyright 2020 by Dr. Matthias Runte

      // License:
      // Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the “Software”), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
      // The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
      // THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

      // *****************
      // PURPOSE AND USAGE
      // *****************

      // MattzoLayoutController (MLC) example configuration file
      // Usage: copy it onto the conf/my/controller_config.h file and adapted it to your needs
      // Documentation: https://www.mattzobricks.com

      // This configuration is the default configuration for the MLC.
      // It serves 2 switches, 2 standard light signals, and 2 sensors.

      // *******************************
      // CONTROLLER WIRING CONFIGURATION
      // *******************************

      // PCA9685 WIRING CONFIGURATION

      // Infos for output port expander PCA9685
      // Usage:
      // – If a USE_PCA9685 port expander is connected to your ESP8266, set USE_PCA9685 to true. Else, it must be set to false.
      // Wiring:
      // – PCA9685 is usually connected to pins D1 (clock) and D2 (data) of the ESP8266.
      // – VCC is sourced from V3V of the ESP8266.
      // – V+ is sourced from VIN of the ESP8266
      // — VIN should be between 5 and 6 Volts.
      // — According to the documentation, the PCA9685 will also sustain 12V, but this is not recommended and we have not tested it.
      // — We have tested run the board with standard USV voltage (4,65V) and it worked without problems.
      // – Connecting GND is mandatory.
      // – OE should also be connected. If pulled high, servo power is switched off. Good to preserve your servos. Cabling is usually easiest if pin D0 is used as OE.
      // Chaining:
      // – Both PCA9685 and the firmware support chaining.
      // – Board 1 has the address 0x40, Board 2 0x41 etc.
      // Servos:
      // – Just connect the servos as designed. Servos connected to PCA9685 must be mapped in SWITCHPORT_PIN_PCA9685.
      // Signals:
      // – Connecting TrixBrix signals to the PCA9685 is somewhat tricky, because of the “common anode” (common plus terminal) of the signal LEDs.
      // – The solution is to connect the middle wire (plus) to V3V of the ESP8266 (NOT the plus pins of the PCA9685 ports), and the outer wires to the PCA9685 pins.
      // – It is important to remember the correct way of setting a pin on the PCA9685 to:
      // — fully on: pwm.setPWM(port, 4096, 0);
      // — fully off: pwm.setPWM(port, 0, 4096);
      // – Generally, it is better practice to connect light signals via MCP23017 port extenders
      // Additional reference: https://learn.adafruit.com/16-channel-pwm-servo-driver?view=all

      // PCA9685 port expander used?
      #define USE_PCA9685 false

      // PCA9685 OE pin supported?
      #define PCA9685_OE_PIN_INSTALLED false
      const uint8_t PCA9685_OE_PIN = D0;

      // Number of chained PCA9685 port extenders
      #define NUM_PCA9685s 1

      // MCP23017 WIRING CONFIGURATION

      // Infos for I/O port expander MCP23017
      // Usage:
      // – If a MCP23017 I/O port expander is connected to your ESP8266, set USE_MCP23017 to true.
      // Wiring:
      // – SCL and SDA are usually connected to pins D1 (clock) and D2 (data) of the ESP8266.
      // – VCC is sourced from V3V of the ESP8266.
      // – GND is connected to GND of the ESP8266. Connecting GND is mandatory!
      // – RESET is connected with an 10K resistor to VCC
      // – Address ports A0, A1 and A2 according to the desired address (0x20, 0x21, …). All connected to GND means address 0x20.
      // Ports:
      // – The ports of the are numbered as follows:
      // – A0..A7: 0..7
      // – B0..B7: 8..15
      // Chaining:
      // – Both MCP23017 and the firmware support chaining.
      // – Board 1 has the address 0x20, board 2 0x21 etc.
      // – Up to 8 boards can be connected.
      // Sensors:
      // – Connecting sensors to the MCP23017 is simple.
      // – Just connect one of of the cable pair to GND, the other one to one of the ports of the MCP23017.

      // MCP23017 port expander used?
      #define USE_MCP23017 false

      // Number of chained MCP23017 port extenders
      #define NUM_MCP23017s 1

      // SERVO WIRING CONFIGURATION

      // Servos are used for motorizing switches and form signals

      // Number of servos
      #define NUM_SERVOS 2

      TServoConfiguration servoConfiguration[NUM_SERVOS] =
      {
      {
      .pin = D0,
      .pinType = 0,
      .detachAfterUsage = true
      },
      {
      .pin = D1,
      .pinType = 0,
      .detachAfterUsage = true
      }
      };

      // LED WIRING CONFIGURATION

      // LEDs are used in signals, level crossing lights or bascule bridge lights
      // As an example, 2 LEDs are required for a light signal with 2 aspects

      // Number of LEDs
      #define NUM_LEDS 4

      TLEDConfiguration ledConfiguration[NUM_LEDS] =
      {
      {
      .pin = D2,
      .pinType = 0
      },
      {
      .pin = D3,
      .pinType = 0
      },
      {
      .pin = D4,
      .pinType = 0
      },
      {
      .pin = D5,
      .pinType = 0
      }
      };

      // SENSOR WIRING CONFIGURATION

      // Sensors are generally used to indicate that a train have reached a specific position on the layout
      // Special forms are remote and virtual sensors (see below)

      // Number of sensors connected or connectable to the controller
      #define NUM_SENSORS 2

      // A special form of a sensor is the “remote sensor”
      // Remote sensors are not electrically connected to this controller, they are triggered via Rocrail commands.
      // Remote sensors can be used for level crossings in Autonomous Mode.
      // Set REMOTE_SENSORS_ENABLED to true to generally enable remote sensors.
      // If you do not control a level crossing in Autonomous Mode with this controller, set to false!
      #define REMOTE_SENSORS_ENABLED false

      TSensorConfiguration sensorConfiguration[NUM_SENSORS] =
      {
      {
      .pin = D6,
      .pinType = LOCAL_SENSOR_PIN_TYPE,
      .remoteMattzoControllerId = -1
      },
      {
      .pin = D7,
      .pinType = LOCAL_SENSOR_PIN_TYPE,
      .remoteMattzoControllerId = -1
      }
      };

      // STATUS LED WIRING CONFIGURATION

      // Digital output pin to monitor controller operation (typically a LED)
      // Set to false if no status LED is installed
      const bool STATUS_LED_PIN_INSTALLED = true;
      // If installed, the pin controlling the status LED
      const uint8_t STATUS_LED_PIN = D8;
      // If installed, set to true to flip high/low state of the status led pin
      const bool STATUS_LED_REVERSE = false;
      // Power level of the status LED (0..1023)
      // Recommended max. power levels: white: 800, blue: 600, green: 500, yellow: 350, red: 300
      const int STATUS_LED_POWER = 300;

      // ****************************
      // LOGICAL OBJECT CONFIGURATION
      // ****************************

      // SWITCH CONFIGURATION

      // Number of switches
      #define NUM_SWITCHES 2

      TSwitchConfiguration switchConfiguration[NUM_SWITCHES] =
      {
      {
      .rocRailPort = 1,
      .servoIndex = 0,
      .servo2Index = -1,
      .servo2Reverse = false,
      .triggerSensors = false,
      .sensorIndex = { -1, -1 }
      },
      {
      .rocRailPort = 2,
      .servoIndex = 1,
      .servo2Index = -1,
      .servo2Reverse = false,
      .triggerSensors = false,
      .sensorIndex = { -1, -1 }
      }
      };

      // SIGNAL CONFIGURATION

      // Number of signals
      #define NUM_SIGNALS 2
      // Maximum number of signal aspects (e.g. 2 for red/green, 3 for red/green/yellow etc.)
      #define NUM_SIGNAL_ASPECTS 2
      // Number of signal LEDs (usually equal to NUM_SIGNAL_ASPECTS)
      #define NUM_SIGNAL_LEDS 2
      // Maximum number of servos for form signals (e.g. one for the primary and another one for the secondary semaphore)
      // If no form signals are used, just set to 0
      #define NUM_SIGNAL_SERVOS 0

      TSignalConfiguration signalConfiguration[NUM_SIGNALS] =
      {
      // signal 0: light signal with 2 aspects, controlled via Rocrail ports 1 and 2
      {
      .aspectRocrailPort = {1, 2},
      .aspectLEDPort = {0, 1},
      .aspectLEDMapping = {
      {true, false},
      {false, true}},
      .servoIndex = {},
      .aspectServoAngle = {},
      .overshootSensorIndex = -1
      },
      // signal 1: light signal with 2 aspects, controlled via Rocrail ports 1 and 2
      {
      .aspectRocrailPort = {3, 4},
      .aspectLEDPort = {2, 3},
      .aspectLEDMapping = {
      {true, false},
      {false, true}},
      .servoIndex = {},
      .aspectServoAngle = {},
      .overshootSensorIndex = -1
      }
      };

      // LEVEL CROSSING CONFIGURATION

      // General switch for level crossing (false = no level crossing connected; true = level crossing connected)
      #define LEVEL_CROSSING_CONNECTED false

      // Number of boom barrier servos configured for the level crossing
      #define LC_NUM_BOOM_BARRIERS 4

      // Number of signals configured for the level crossing
      #define LC_NUM_LEDS 4

      // Number of level crossing sensors
      #define LC_NUM_SENSORS 4

      // Number of tracks leading over the level crossing
      #define LC_NUM_TRACKS 2

      TLevelCrossingConfiguration levelCrossingConfiguration = {};

      // BASCULE BRIDGE CONFIGURATION

      // General switch for bascule bridge (false = no bridge connected; true = bridge connected)
      #define BASCULE_BRIDGE_CONNECTED false

      // Number of bridge Leafs (equals number of bridge servos)
      #define NUM_BASCULE_BRIDGE_LEAFS 0

      TBridgeConfiguration bridgeConfiguration = {};

      // SPEEDOMETER CONFIGURATION

      // General switch for speedometer (false = no speedometer connected; true = speedometer connected)
      #define SPEEDOMETER_CONNECTED false

      TSpeedometerConfiguration speedometerConfiguration = {};

      // ****************
      // NETWORK SETTINGS
      // ****************

      // Trigger emergency brake upon disconnect
      const bool TRIGGER_EBREAK_UPON_DISCONNECT = true;

      // WiFi Hostname
      // Allowed characters: a-z, A-Z, 0-9. From 2nd character, hyphens (“-“) may also be used.
      const char *MC_HOSTNAME = “MLC”;

      // Syslog application name
      const char *SYSLOG_APP_NAME = “MLC”;

    • #7852
      Matthias RunteMatthias Runte
      Keymaster

      Des, it looks as if you did not configure the MLC at all. You should deactivate switches and signals (at least you must sure that they do not conflict with your sensors pinis D1 and D2), and you must set the correct sensor pins.

      ->
      #define NUM_SWITCHES 0
      (also reduce the switches in the switch array to 0 – see empty configuration as example}

      ->
      #define NUM_SIGNALS 0
      (also reduce the signals in the signals array to 0 – see empty configuration as example}

      ->
      // SENSOR WIRING CONFIGURATION

      // Sensors are generally used to indicate that a train have reached a specific position on the layout
      // Special forms are remote and virtual sensors (see below)

      // Number of sensors connected or connectable to the controller
      #define NUM_SENSORS 2

      // A special form of a sensor is the “remote sensor”
      // Remote sensors are not electrically connected to this controller, they are triggered via Rocrail commands.
      // Remote sensors can be used for level crossings in Autonomous Mode.
      // Set REMOTE_SENSORS_ENABLED to true to generally enable remote sensors.
      // If you do not control a level crossing in Autonomous Mode with this controller, set to false!
      #define REMOTE_SENSORS_ENABLED false

      TSensorConfiguration sensorConfiguration[NUM_SENSORS] =
      {
      {
      .pin = D1,
      .pinType = LOCAL_SENSOR_PIN_TYPE,
      .remoteMattzoControllerId = -1
      },
      {
      .pin = D2,
      .pinType = LOCAL_SENSOR_PIN_TYPE,
      .remoteMattzoControllerId = -1
      }
      };

      I know that the configuration is still a bit technical at this stage. When I find the time one day, I am going to implement a web configuration.

    • #7853
      Des MatejkaDes Matejka
      Participant

      Ok Thanks. That is something that I will follow up. It should be easy.
      Thank you.

    • #7854
      Des MatejkaDes Matejka
      Participant

      Hello Matthais,
      The reply and solution to my issue make sense and I understand it.
      It underscores the complexity of the development work that has been undertaken.
      I have been challenged by the process, yet it has been rewarding.
      I look forward to implementing this solution.
      It will take me some time in my schedule to undertake this solution.
      Much appreciated.
      Des

    • #7856
      Des MatejkaDes Matejka
      Participant

      Success achieved!

      This morning in our Lego room named “Grove Bricks” my MOC of the Maersk 10219 Maersk Container Train ran a full circuit and stopped under control of the sensors using Rocrail.

      I have been able to implement the Mattzobricks Train Automation System in just under 12 weeks.

      I must say that I am quite elated because it has been a considerable undertaking at both cost and time.

      There is no sense in which I am displeased about this, quite the contrary I regard it as a great challenge and achievement.

      There is still much to do, but the proof of concept is achieved.

      I intend to write a more detailed account of what I have learnt with the view of being helpful to others.

      Des
      You can view Grove Bricks on Instagram.

      • This reply was modified 1 month, 1 week ago by Des MatejkaDes Matejka.
      • This reply was modified 1 month, 1 week ago by Des MatejkaDes Matejka.
Viewing 8 reply threads
  • You must be logged in to reply to this topic.