Ansicht von 12 Antwort-Themen
  • Autor
    Beiträge
    • #3136
      Michael BartschMichael Bartsch
      Teilnehmer

      MattzoLayoutController

    • #3292
      Rob AlblasRob Alblas
      Teilnehmer

      Hi,

      I am trying to setup a MattzoLayoutcontroller with the PCA9685. I’m struggling a bit with the setup in rocrail. I have 5 switches and 3 signals attached to the PCA. The switches are on ports 0 to 4, the signals on ports 8 to 13. When I use these ports in rocrail, I get the following message on the serial com: “Message disgarded, as this controller does not have such a port.”

      Does anybody know what the issue is here?

      Thanks,
      Rob

    • #3296
      Rob AlblasRob Alblas
      Teilnehmer

      Hi,

      I switched to the MattzoLayoutController without the PCA9685. I successfully setup the controller with switches on D0, D1, D2, a signal on D4 and D5 and two sensors on D6 and D7. However, as soon as I connect a switch to D3 I cannot program/flash the controller anymore. From the internet I understand that this has something to do with the voltage of the pin. Being a newbie, I don’t understand how I can program it when a switch motor is connected to D3. Any help is greatly appreciated!

      Rob

    • #3297
      Thomas RodriguesMax
      Teilnehmer

      Hi Rob, what kind of power supply do you use and is everything connected trough a breadboard?

    • #3298
      Rob AlblasRob Alblas
      Teilnehmer

      Hi Max,

      Yes, everything is connected to a breadboard. When programming/flashing the ESP8266 I use the USB-port of my computer. When starting it up I use an iPad-charger which supplies 2,1 A.

      Rob

    • #3309
      Thomas RodriguesMax
      Teilnehmer

      Hi Rod! I did not forget you 🙂
      Rather to get a workaround working, I would like to have your original setup (with the PCA9685) working as it is the more prefered solution..

      – You wrote that you have 5 switches and 3 signals.
      As the main feature from the PCA is that it is powered down between the switch commands you should connect the signals directly to the ESP.

      – The config of your ESP with a connected PCA as follows:
      1. LayoutController needs to #include “MattzoLayoutController_Configuration_PCA9685.h”
      2. Swap the value of “// Digital pins for signal LEDs” and “// Digital input PINs for hall, reed or other digital sensors” and vice versa.

      I.E:
      // Digital pins for signal LEDs
      const int NUM_SIGNALPORTS = 5;
      uint8_t SIGNALPORT_PIN[NUM_SIGNALPORTS] = { D3, D4, D5, D6, D7 };
      uint8_t SIGNALPORT_PIN_TYPE[NUM_SIGNALPORTS] = { 0, 0, 0, 0, 0 };

      // Digital input PINs for hall, reed or other digital sensors
      const int NUM_SENSORS = 8;
      uint8_t SENSOR_PIN[NUM_SENSORS] = { D3, D4, D5, D6, D7 };
      uint8_t SENSOR_PIN_TYPE[NUM_SENSORS] = { 8, 9, 10, 11, 12, 13, 14, 15 };
      uint8_t SENSOR_PIN_TYPE[NUM_SENSORS] = { 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40 };

      The corresponding port in Rocrail begins with 0.

      If this does not help, we need your Rocrail and ESP config.

      Greetings!

    • #3314
      Rob AlblasRob Alblas
      Teilnehmer

      Hi Max,

      Thanks! For the moment I have decided to build Signal, Switch and Sensorcontrollers (and those all work flawlessly 🙂 ). Once I have my track running I will come back to the Layoutcontroller as they definitely are the better solution!

      Rob

    • #3718
      Oscar WagnerOscar WAGNER
      Teilnehmer

      Bonjour,
      J’ai un problème avec MattzoLayoutControler.ino: lors du televersement j’ai un message d’erreur concernant “abs” dans les lignes 716, 729 et 813 :”call of overloaded ‘abs(unsigned int)’ is ambiguous”.
      Que faut-il faire? Merci

      • #3745
        Lucas HLucas H
        Teilnehmer

        Hi Oscar,

        As a quick workaround I ended up commenting out these three lines of code. As long as you don’t use the levelcrossing function of the layout controller you should be fine.

        Hopefully this will be addressed by a more experienced user with a permanent solution.

        Hope this helps for now!

        • #3746
          Lucas HLucas H
          Teilnehmer

          I ran into this error again last night but commenting out the lines of code turned out to be working only for a limited time and is definitely not the desired solution! Even with a successful upload of the MattzoLayoutController firmware the ESP8266’s WiFi got all kinds of issues after the second boot. After some further testing, I think I found the root issue for this error. It seems that the new board firmware (version 3.0.2) for the ESP8266 is the cause of the problem. The solution I found to be working successfully is to downgrade the firmware version of the ESP8266 to 2.7.4 via the Arduino IDE boards manager. After you done so, restart Arduino IDE, upload the firmware again and you should be good to go!

          Let me know if this helps!

          • Diese Antwort wurde geändert vor 2 Jahren, 7 Monaten von Lucas HLucas H.
    • #3748
      Oscar WagnerOscar WAGNER
      Teilnehmer

      Bonjour Lucas, merci d’avoir répondu à ma demande. En fouillant github j’ai peut être trouvé une autre solution, j’ai remplacé “abs” par “fabs” et maintenant je n’ai plus de problème. Mais je ne sais pas si c’est une bonne solution car je ne connais pas C++. Le téléversement se passe bien.

      • #3749
        Lucas HLucas H
        Teilnehmer

        Hi Oscar,

        Thanks for your reply and insight on the issue! I’m not too familiar with C++ either but for what I know this could work indeed. I’ll try this solution as well to see if it works with the latest board firmware of the ESP8266 and if the controller is then working properly. Unfortunately, I don’t use the Boom Barrier function of the layout controller so I don’t know what the implications will be of the changed code.

        Maybe some of the developers have some further insight on this issue?

    • #3754
      Matthias RunteMatthias Runte
      Administrator

      Hi folks,
      I have read your comments above. I am pretty busy at the moment, but I have just created a bug report in our internal bug tracking tool. I will check out if I can reproduce the problems with the new ESP-8266 firmware (V3.x.x). I will also have a look at the proposed abs() / fabs() work-around.

      Thanks for your esteem.

      Cheers,
      Mattze

      • #3844
        Matthias RunteMatthias Runte
        Administrator

        Update:
        – I reviewed the reported problems on board manager 3.0.2.
        – First of all I created a fix for the abs() / fabs() problem, which impacts the level crossing implementation. I did not do regression testing on level crossings yet, but I am quite confident that there are no negative side effects. The fix will be included in the upcoming firmware release 0.5.
        – The firmware compiles with board manager 3.0.2 now, and I can confirm the reported WiFi connectivity problem. I didn’t find a solution yet, but Joos is also working on it and we might find a solution soon.
        – For now I have placed a note in the General Section that only board manager version 2.7.4 is supported, and not version 3.0.0 and above.
        – The root cause might have to do with a major WiFi library change introduced with board manager 3.0.0.

        • Diese Antwort wurde geändert vor 2 Jahren, 5 Monaten von Matthias RunteMatthias Runte.
    • #3814
      Joos BuijsJoos Buijs
      Administrator

      Hi all,

      I’ve been playing around with the MC4PU and MattzoLayoutControllers for some weeks now, and I’m gradually increasing the difficulty until I can control my full layout for a show early December.
      I already got the MC4PU working, as well as the layout controller without MCP23017 with up to 6 sensors and a (Trixbrix) switch.

      I’m currently experimenting with extending the ESP8266 with the MCP23017. I have connected everything almost as shown on the layout controller page, except for the red wire bridge going to ground instead of 3.3V, which I believe is a mistake in the wiring diagram.
      This is my current setup, with the resistor (temporarily) via a dupont extension, and a male-male dupont cable as sensor replacement (I have reed relais in the rails but this is easier for desk-debugging).

      However, without the sensor on port A0 connected I get a lot of debug messages mentioning that sensor <x> got triggered, where <x> is one of the sensors I configured if I configured more.
      Alternatively I sometimes get no triggers at all, even when I connect the sensor to GRND.

      I have started the configuration file from scratch, and checked whether all Mattzo libraries and the layout controler files were identical to firmware 0.4.1, which they are, except for the occasional added debug message.

      This is my configuration file for 1 sensor on port 0 (A0).

      If anyone could point me in the right direction for further debugging that would be much appreciated.

      Kind regards,

      Joos

      • Diese Antwort wurde geändert vor 2 Jahren, 6 Monaten von Joos BuijsJoos Buijs. Grund: replaced file download links
    • #3829
      Matthias RunteMatthias Runte
      Administrator

      Hi Joos,
      hmm, good question. The configuration file looks quite good as far as I see it… in my setups, the MattzoLayoutController with the attached MCP23017 was running without problems, even with a lot of sensors.

      I will build and test some more MattzoLayoutControllers in the upcoming future and test it with firmware 0.5, which is to be released soon. Maybe the problem do not show with firmware 0.5. Let me know if you want to help us testing, then I will grant you early access to the firmware.

      Thanks for the heads up regarding the wiring diagram.

      Cheers,
      Mattze

      • #3831
        Joos BuijsJoos Buijs
        Administrator

        Hi Mattze,

        Thanks for your reply.
        I haven’t been able to troubleshoot much but I managed to get the sensor inputs working with a small sketch using similar code as the layout controller, so no hardware or library causes. The layout controller works fine until I add the third sensor on the MCP23017. Then it goes crazy with a stream of false triggers…

        I was going to add debug messages to the code anyway to further debug so I might as well do this on the 0.5 version and help you guys. If you could send the details that would be great!

        Kind regards,
        Joos

        • #3836
          Joos BuijsJoos Buijs
          Administrator

          This morning I found that the resistor I added via a Dupont cable sometimes lost contact, causing the MCP to go crazy and sending all kinds of noise signals. As a remedy I connected RESET directly to 3V3. I can now run my layout for a couple of minutes before it goes crazy again, but I’ll buy a better resistor and see if that helps.

          I hope that anyone with similar issues reads this in the future: check your RESET resistor!

          • #3843
            Matthias RunteMatthias Runte
            Administrator

            Lucky to hear that. Good luck with your next steps!

          • #3847
            Joos BuijsJoos Buijs
            Administrator

            I’m happy to report that I solved the issue!

            The cause apparently was not the board firmware version, MCP library version, resistors, or USB power source. This week I ordered a new (and different type) ESP-8266 and this one does not have this issue (with the same MCP, resistors, power source, code, etc.).

            So, for me this one did not work in combination with an MCP23017:
            Ai-Thinker NodeMCU-8266 – ESP-12S
            This one works:
            ESP8266 NodeMCU V2 which has an ESP-12F (in my case)

            If other users have a similar (or different) experience I would be happy to know!

    • #3839
      Thomas RodriguesMax
      Teilnehmer

      Hey Joos thank you for your feedback!

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