Verfasste Forenbeiträge
-
AutorBeiträge
-
Matthias Runte
AdministratorMatthias Runte
AdministratorNein, entscheidend ist “events” Knoten. Ich habe Deine Frage zum Anlass genommen, um für Firmware 1.2 eine Beispiel-Konfiguration für diesen einfachen Anwendungsfall zu basteln. Wollte ich eh noch machen.
Es handelt sich um eine einfache Lokomotive mit Powered Up Hub, an den ein Motor und ein PU-Licht angeschlossen sind. Das Licht lässt sich per F1 manuell an und ausschalten. Außerdem schaltet es bei “Vorwärts” automatisch ein, und erlischt bei “Stop” und “Rückwärts”.
Hier ist die Konfiguration:
{
“address”: 1,
“name”: “SIMPLE_LOCO_with_lights”,
“pwrIncStep”: 10,
“pwrDecStep”: 10,
“bleHubs”: [
{
“type”: “PU”,
“address”: “90:84:2b:21:71:46”,
“channels”: [
{
“channel”: “A”,
“attachedDevice”: “motor”
},
{
“channel”: “B”,
“attachedDevice”: “light”
}
]
}
],
“events”: [
{
“triggers”: [
{
“source”: “rr”,
“eventType”: “fnchanged”,
“identifier”: “f1”,
“value”: “on”
},
{
“source”: “loco”,
“eventType”: “dirchanged”,
“value”: “forward”
}
],
“actions”: [
{
“address”: “90:84:2b:21:71:46”,
“channel”: “B”,
“pwrPerc”: 50
}
]
},
{
“triggers”: [
{
“source”: “rr”,
“eventType”: “fnchanged”,
“identifier”: “f1”,
“value”: “off”
},
{
“source”: “loco”,
“eventType”: “dirchanged”,
“value”: “backward”
},
{
“source”: “loco”,
“eventType”: “dirchanged”,
“value”: “stopped”
}
],
“actions”: [
{
“address”: “90:84:2b:21:71:46”,
“channel”: “B”,
“pwrPerc”: 0
}
]
}
]
}Viel Erfolg!
Matthias Runte
AdministratorSchau Dir bitte das Beispiel in MTC4BT/data_example/controller_config.json an. Der Zug “PT60197” in diesem Beispiel verwendet auch Lichter, die manuell geeschaltet werden können und sogar automatisch beim Bewegen und Stoppen des Zuges an und aus gehen.
Mit Firmware Release 1.2 kommen viele weitere Beispiele mit hinzu, die ebenfalls zur Ansicht dienen, wie es gemacht wird.
Matthias Runte
AdministratorUSB! 0,5A reichen für Sensoren und Lichtsignale, alles was mit Servos arbeitet besser 2A.
Matthias Runte
AdministratorHat sich denn der Controller ganz sicher mit dem WLAN verbunden? Falls ja, liegt es am MQTT.
Entweder hast Du den MQTT Service falsch eingerichtet, die IP-Adresse ist nicht korrekt oder eine Firewall blockiert den Zugriff.
Bitte schau noch einmal genau diese Seite hier durch:
Falls Dir Englisch nicht von der Hand geht, so leistet Google Translate gute Dienste.
Januar 14, 2025 um 17:46 Uhr als Antwort auf: First configuration of MTC4BT – how connect to the Lego hub? #8090Matthias Runte
AdministratorMitja,
that’s great news! Happy to hear that it works now. Welcome to Mattzobricks!Cheers,
MattzeJanuar 14, 2025 um 13:06 Uhr als Antwort auf: First configuration of MTC4BT – how connect to the Lego hub? #8087Matthias Runte
Administrator.. and please check that you are not using special characters for the ‘”‘ characters. In JSON files, it needs to be ASCII characters 34 (decimal) which equals x22 (hexadecimal).
Januar 14, 2025 um 13:02 Uhr als Antwort auf: First configuration of MTC4BT – how connect to the Lego hub? #8086Matthias Runte
AdministratorTry it, but my guess is that this is not the problem, but somehow you upload the wrong configuration directory up to the controller.
Januar 14, 2025 um 13:01 Uhr als Antwort auf: First configuration of MTC4BT – how connect to the Lego hub? #8085Matthias Runte
AdministratorTo validate your finding, you should put the content of loco_simple into the controller_config.json file and test it. The file should look like this:
{
“name”: “MTC4BT”,
“espPins”: [],
“locos”: [
{
“address”: 1,
“name”: “60197”,
“bleHubs”: [
{
“type”: “PU”,
“address”: “90:84:2b:cf:81:47”,
“channels”: [
{
“channel”: “A”,
“attachedDevice”: “motor”
},
{
“channel”: “B”,
“attachedDevice”: “motor”,
“direction”: “reverse”
}
]
}
]
},
{
“address”: 2,
“name”: “60051”,
“bleHubs”: [
{
“type”: “PU”,
“address”: “”,
“channels”: [
{
“channel”: “A”,
“attachedDevice”: “motor”
},
{
“channel”: “B”,
“attachedDevice”: “motor”,
“direction”: “reverse”
}
]
}
]
}
],
“locoConfigs”: []
}Januar 14, 2025 um 11:15 Uhr als Antwort auf: First configuration of MTC4BT – how connect to the Lego hub? #8082Matthias Runte
AdministratorPlease check:
– You uploaded the new configuration using the platform.io action “Upload Filesystem image” not “Upload”.Try adding a line break ahead of the data_dir line (I know, that’s a very far fetch).
If this doesn’t help, it becomes difficult to help you from remote. But the problem is
surely in this area where we are presently poking.Januar 14, 2025 um 10:40 Uhr als Antwort auf: First configuration of MTC4BT – how connect to the Lego hub? #8078Matthias Runte
AdministratorThe root cause of your problem is that data_dir is pointing to the wrong directory, or that you have the wrong files in that directory. If you solve this issue, it should work.
Januar 14, 2025 um 10:25 Uhr als Antwort auf: First configuration of MTC4BT – how connect to the Lego hub? #8076Matthias Runte
AdministratorI haven’t compiled the MTC4BT on a Mac yet, but basically everything seems to be alright. In the serial log it also shows that you have configured one hub, so that’s very likely okay if you point with the data_dir variable to the directory where your controller_config.json etc. is in. For validation, you could add another hub for testing, the you should see 2 hubs in the serial log.
It is possible that the PU hub does not connect on first try. Try a couple of times in a row.
Other possible causes:
– The ESP32 hardware is broken. Try another one. I had that a couple of times in the post myself.
– The MAC address is wrong. The beginning looks great, though. 90:84:2b:**:**:** is a typical start for a PU hub.Januar 14, 2025 um 09:58 Uhr als Antwort auf: First configuration of MTC4BT – how connect to the Lego hub? #8073Matthias Runte
AdministratorOkay, please also post the my_platformio.ini file.
The configuration in your Eurostar is two PU train motors attached to one PU hub, correct?
What do you see in the serial log? Does it say that the controller is looking for one hub?
-
Diese Antwort wurde vor 1 Jahr, 2 Monaten von
Matthias Runte geändert.
Januar 14, 2025 um 09:23 Uhr als Antwort auf: First configuration of MTC4BT – how connect to the Lego hub? #8070Matthias Runte
AdministratorHello Mitja,
could you post your controller_config.json file and your my_platformio.ini file here?Thanks!
Cheers,
Mattze-
Diese Antwort wurde vor 1 Jahr, 2 Monaten von
Matthias Runte geändert.
Matthias Runte
AdministratorDanke für die Infos.
Matthias Runte
AdministratorWir können daran leider nichts ändern. Die Dienstleister gehen auf Nummer Sicher und schreiben eine bestimmte Wandstärke vor.
Die Wandstärke ergibt sich aus den Maßen von Legosteinen für die äußere Abmessung und der WEMOS D1 gibt die innere Abmessung vor. Wir haben da alles herausgeholt, was herausgeholt werden kann.
Nun könnte man das Gehäuse größer machen, aber dann sind alle Vorteile, die wir mit diesem Kompromiss erkauft haben, weg. Und es ist fraglich, ob man dann noch die gleiche Leiterplatte nehmen kann.
Wir empfehlen, einen Probedruck machen zu lassen und dem Dienstleister bestätigen, dass der Auftraggeber die dünne Wandstärke in Kauf nimmt. Die Bestellung erfolgt dann auf Risiko des Auftraggebers.
Zur Wahl des Materials können wir nichts sagen, da wir mit dem Dienstleister keine Erfahrungen haben.
Uns interessiert aber brennend, welche Erfahrungen Du hier machst und ob das mit dem Dienstleister funktioniert. Es wäre schön, wenn Du uns nach dem Projekt eine Rückmeldung geben könntest.
Matthias Runte
AdministratorHallo Dietmar,
Punkt 2) Deines letzten Posts macht mich etwas nervös. Kopierst Du die Dateien von github einzeln auf Deinen Rechner? Das richtige Verfahren wäre, das Mattzobricks Projekt auf github zu klonen. Bitte den Master-Branch auschecken. Das aktuelle Versions-Tag ist 1.1. Ich denke, dass dies auch die Probleme mit der nicht gefundenen SPI Library lösen könnte.Wenn Du völlig neu in der Materie ist, versuche doch dann erst einmal, ganz einfache Beispiele mit Visual Studio Code und platformIO zum laufen zu bringen. Das Netz ist voller Anleitungen und geeigneter Beispiele.
Matthias Runte
AdministratorSounds good. When you layout is finished, you’re invited to help us publish it in the projects section of the website.
-
Diese Antwort wurde vor 1 Jahr, 2 Monaten von
Matthias Runte geändert.
Matthias Runte
AdministratorYes, that is correct. Another approach would be to create some more MLC minis, which would relieve you from modifying the hardware or the wiring of particular units. These modifications are often only relevant for specific setups, and therefore only useful for layouts that remains like they are for a longer period of time. Users who change their layout often will be better off with standardized MLC minis.
But that’s just my opinion. You’ve got all tools at hand, so decide yourself.
Matthias Runte
AdministratorHi Des,
happy new year. Please refer to the documentation to find out why this is happening.Have a great year!
Cheers,
MattzeMatthias Runte
AdministratorHallo Dietmar,
das OTA-Passwort musst Du selbst in der Datei network_config.json setzen (“otaPassword”). OTA funktioniert aber erst, wenn Du initial einmal erfolgreich die Firmware und Konfiguration jeweils per USB übertragen hast. Ich würde das für den Anfang erst einmal ganz auslassen und die Firmware und Konfiguration per USB übertragen. Das wird erst dann interessant, wenn Du die Controller irgendwie tief in der Anlage oder in Lokomotiven verbaut hast, und sie nicht immer ausbauen willst, wenn Du die Konfiguration änderst oder ein Firmware Update einspielst.MQTT bitte hier nachlesen: https://mattzobricks.com/de/automation/controllers. Gib mal auf der Konsole des Rechners, auf dem Dein Mosquitto läuft, “ipconfig” ein, da steht die IP-Adresse.
Matthias Runte
AdministratorDas weiß ich nicht. Schau mal in die Spezifikation versuch doch erst einmal, das Ding mit einem einfachen Arduino-Sketch zum Laufen zu bringen.
Matthias Runte
AdministratorHallo Christian, willkommen bei Mattzobricks. Auf den ersten Blick sieht das nicht schlecht aus. Die Kommunikation zwischen Rocrail und dem MTC4PF funktioniert, das sieht man an der Log-Ausgabe des MattzoControllers.
Probiere doch bitte mal, mit einem Arduino-Beispiel Sketch das Motorshield zu testen, indem Du damit den Motor laufen lässt. Sobald das klappt, wird das auch mit dem MTC4PF funktionieren.
Matthias Runte
AdministratorOptions:
– Any variants of the MLC, e.g. for bridges, level crossings or measuring speed. Of course also for anything else, just without the MLC mini case.
– Use it to build an MTC4PF.Matthias Runte
AdministratorHi Jochen, welcome to Mattzobricks. It is true that the Amazon link on the material page leads to an article that is presently not available, but the Ali link works fine.
Section “MLC mini”.
-
Diese Antwort wurde vor 1 Jahr, 2 Monaten von
-
AutorBeiträge
