Ansicht von 2 Antwort-Themen
  • Autor
    Beiträge
    • #3713
      Edwin BlomEdwin Blom
      Teilnehmer

      Hello,
      First of all congratulations with the excellent work done to automate Lego trains. A few weeks ago I stumbled across this and am now working on a layout with 6 switches, 10 sensors, 4 signals and used by 3 trains.
      I managed to get it up and running on a MacBook Pro, maybe I will write a dummy guide to help other dummies soon 🙂 because I knew nothing about microcontrollers etc and must have managed to encounter all the issues that were somewhere listed on this forum (or not).

      One thing I don’t get going though is combining, for example, switches and signals on a Layout controller. I am using the ESP8266 without any extension boards

      On the LayoutController I have 4 switches on D0 to D3 and two signals on D4 and D5. Switches work, signals do not. The serial monitor says that “this controller does not have such a port”.

      When I set this up as two separate controllers; one for switches and one for signals, all works fine. When I change the signals to D0 and D1 (and the switches to D2-5), the signals work but the switches don’t.

      I looked into the MattzoLayoutController.ino file I noticed the following;
      Under the handling of the signal message it says
      if (rr_port < 1 || rr_port > NUM_SIGNALPORTS) {
      mcLog2(“Message disgarded, as this controller does not have such a port.”, LOG_ERR);
      return;
      }

      With NUM_SIGNALPORTS being 2 and ports being 5 and 6 respectively, this will always throw an error to my opinion.

      I guess I am using the wrong file because I see many folks managed to set it up properly with combinations of switches, signals and sensors. Can someone shine a light on this 🙂 ??

    • #3755
      Matthias RunteMatthias Runte
      Administrator

      Hi Edwin,
      can you send me your MattzoLayoutController configuration file?

      Besides this, keep up the good work with your layout!

      Cheers,
      Mattze

    • #3830
      Matthias RunteMatthias Runte
      Administrator

      Thanks for sending me your configuration. The problem here is, that you need to start counting at 1 for each different component type in Rocrail. Imagine you have 1 switch, 2 signal LEDs and 2 sensors. The components may be connected to pin D0, D1/D2 and D3/D4 respectively, but this does not play a role for the correct numbering of the Rocrail ports.

      The numbering for the Rocrail ports should look like this:
      Switch (pin D0): Port 1
      Signal 1 (pin D1): Port 1
      Signal 2 (pin D2): Port 2
      Sensor 1 (pin D3): Port 1
      Sensor 2 (pin D4): Port 2

      As you can see, the pin allocation on the microcontroller does not play a role for the numbering of the Rocrail ports.

      A small lookout: with firmware 0.5, configuration is going to get somewhat easier (I hope).

Ansicht von 2 Antwort-Themen
  • Du musst angemeldet sein, um auf dieses Thema antworten zu können.