Verfasste Forenbeiträge
-
AutorBeiträge
-
Hilbert B
AdministratorDes,
I wouldn’t do the PU version, but the MTC4BT version for those esp32’s, do not use the esp32-s3 profile in vscode, that won’t upload because it is an other processor.
Adding a W5500 module to the esp32 will improve things!Hilbert
-
Diese Antwort wurde vor 3 Wochen, 4 Tage von
Hilbert B geändert.
Hilbert B
AdministratorHi Des,
No problem, I have put some time in the coding of this part 😉
Yes, you can remove those includes.
I have tested it with 4 hubs (2 lego and 2 buwizz) and one remote. So it should work (5 devices), I think Mattze tested with even more devices.
It is however highly recommended that when you use a lot of BLE devices on one ESP32 to use a W5500 module for the network connection. The reason for this is that every ESP32 has only one radio, the same is used for both WiFi and BLE. By adding a W5500 (wired Ethernet) we offload the wifi to wired Ethernet thus removing the WiFi and BLE switching, this greatly improved the performance and stability.
We used seeed_xiao_esp32-s3 with external antenna and that one handles 4 BLE devices with ease (a BLE device is either a hub or a remote).
In the Readme.md included in the MTC4BT map. Search for “Wired Ethernet” there you will find how to connect and configure the W5500 module.
Regards, Hilbert
Hilbert B
AdministratorDes,
Can you try and do the same but then with 4 configured devices?
[0077] [1] [INFO] Setup: Number of locos to discover hubs for: 4 [0078] [1] [INFO] Setup: Number of remotes to discover hubs for: 4
At the moment you have 8 devices configured, this keeps the program scanning for all 8. 4 Should be no problem in any case.
With the wired interface you could try more devices.
As a general rule, do not configure more devices than that you are going to use!
Hilbert
Hilbert B
AdministratorHi Des,
I am not seeing anything that it is trying to make a wired connection. In the file “network_config.json” have you something like this:
"network" : { "hostname": "mtc4bt001", "otaPassword": "foobar", "type" : "wired"
If
"type" : "wired"
is not there it won’t do wired.And use the
[env:esp32]
in platformio, this does a-DWIRED
which makes the the W5500 code active.Without these two you never get a wired connection. In the log you should see that it is trying the wired connection.
You should see an message with
Obtained ETH IP address
this indicates that you are using the wired connection.Hope this helps.
Hilbert
Hilbert B
AdministratorHi Des,
Sorry for the late reply, please post the startup log from your ESP, most of the time this gives us enough hints on where it went/goes wrong. (in debug mode)
Regarding the W5500, again, post the startup log (in debug moode)
Without these it is impossible to help.
Regards, Hilbert
PS use the “code” formatting, this helps the readability!
Hilbert B
AdministratorHi Mitja,
At this point you are connected via ETH to your network.
There should come a message that you are connected to MQTT.
Did you get this message?
Hilbert
Hilbert B
AdministratorHi Ulrich,
No we haven’t made any attempt, neither of us has one, and we need to have one, and the documentation, to get it supported.
If it supports the BLE standard, it is probably do-able. You can have a look at the
BuWizz2Hub.cpp
orSBrickHub.cpp
to see how we did those.You can play a sound if you deceode use the ‘f’ functions, and if you want to couple it to the train speed, you need to program that in the decoder. (the *.cpp files that is)
Hilbert
Hilbert B
AdministratorStephan,
Without the serial log, I am guessing what is going on.
Most of the time the serial log will give away what is going on.
What we have seen and put in the configuration that at the time of writing, more than 5 ble devices on a Seeed Xiao ESP32-S3 are not possible, we have seen 9 on a regular esp32.
Also it is not a good practice to configure more devices than you are using!
Hilbert
Hilbert B
AdministratorStephan,
Without the serial log, I am guessing what is going on.
Most of the time the serial log will give away what is going on.
Hilbert
Hilbert B
AdministratorHallo ChrisRey,
Ehm, not entirely, please read:
Using the W5500 Ethernet module
It is now possible to make a wired network connection using the W5500 module. To enable it in the code, add -DWIRED in my_platformio.ini.
For now the pins should be connected as follows:
W5500 pin ESP32 pin
RESET GPIO 26
CS/SS GPIO 5
MOSI GPIO 23
MISO GPIO 19
SCK GPIO 18
GND and 3V3 are also connected, the other pins are not connected.If the code is compiled with the -DWIRED, it will try and connect to the network using the W5500 module. If there is no network cable connected, it will fall back to wifi. This is only done at the STARTUP of the module, it will NOT FALLBACK to WiFI if you disconnect the cable during normal operation, you have to restart the ESP!
OTA will not work when the network connection is over the cable, disconnect the cable and restart the module so it starts in WiFi mode. This limitation is caused by the ArduinoOTA library being hard wired (pun intended) to Wifi.h (at the time of writing).
The IP address is different for Wifi and cable because an other MAC address is used.
If a status LED is configured, it will turn on solid in network discovery. This will get the other statuses when out of setup and in the regular operation mode.
—
At the moment we only support the W5500 module with this wiring, we are in the process of rewriting the Ethernet/WiFi part to support other wiring schemes of this module.
The board you are using, could work, but we do not support that module because the W5500 chipset does other things than the module mentioned by you.
We are in the process of supporting this board:
Hilbert
Januar 14, 2025 um 13:47 Uhr als Antwort auf: First configuration of MTC4BT – how connect to the Lego hub? #8088Hilbert B
AdministratorThere a two hubs defined, but only one has an address.
[0010] [1] [INFO] Setup: Number of locos to discover hubs for: 1
It is looking for one hub.
And it will show BLE devices in the log that the ESP is “seeing”.
Flashing two times means the hub is searching, it should turn solid if it is discovered by MTC4BT.
The serial log should tell you something similar.
Hilbert
Hilbert B
AdministratorWie kommt man an den Quellcode von mattzobricks?
Versuchen Sie es in einem neuen Ordner:
git clone https://github.com/Mattzobricks/MattzoControllers.git
Dann öffne vscode und öffne den “workspace”, der sich in dem neuen Ordner befindet und „MattzConrtrollers“, er heißt „MattzoControllers.code-workspace“
Erstellen Sie eine Kopie von „my_platformio.ini.example“ und benennen Sie sie in „my_platformio.ini“ um.
Weiter:
Wenn Sie platformio in vccode installiert haben, sehen Sie unten in der Leiste: „develop“ und es sollte auch etwas wie „env:“ mit etwas dahinter stehen.
Klicken Sie darauf und wählen Sie: am oberen Rand des Fensters „env:esp32doit-devkit-v1“.
Warum sage ich das, ich sehe Monitorgeschwindigkeit 9600 straan, aber in unserer platformio.ini steht 115200
Wenn Sie jetzt auf das Häkchen unten in der Leiste (neben dem kleinen Haus) klicken, sollte alles anfangen zu bauen.
Möglicherweise müssen Sie den „upload_com_port“ in „my_platformio.ini“ ändern, damit er Ihrer Situation gerecht wird.
Hilbert B
AdministratorHello Maiko,
You don’t have to install anything in rocrail. Just make sure that:
– rocrail is connected to that mqtt server (reload/restart that layout if you changed it);
– the rocrail locomotive address is the same as the one in your config file;
– start the layout.On the serial console you should see messages that it received an lc command, if you don’t see the command any of the uper things went wrong.
Hilbert B
AdministratorDave,
I think you are in the ‘brake’ state. You have to power up the layout in RocRail, the big poweron/off button in rocrail.
After that the ‘brake’ will be off and the motors should start to run.The serial log will indicate having received an lc command with its speed, and the motor should spinning.
Hilbert
Hilbert B
AdministratorDave,
Wrong tree 😉 the controllerId is only for MLC and MTC4PF because its configuration is different.
What you need are the
address
fields in the configuration file, this address is used in Rocrail associate the locomotive with an address in the configuration file.Hope this helps.
Hilbert
Hilbert B
AdministratorHi Dave,
There will never be a controllerID posted. But if you are looking for hub mac addresses? Then an empty controller file like:
{ "name": "MTC4BT", "espPins": [ { "pin": 2, "inverted": false, "attachedDevice": "status" } ] }
Will put the controller in scan mode and this wil produce a log like:
[0016] [1] MQTT: Connecting to 192.168.70.10:1883... [0017] [1] Setup: MattzoTrainController for BLE running. [0018] [0] MQTT: Subscriber configuring last will... [0019] [1] Setup: Number of locos to discover hubs for: 0 [0020] [0] MQTT: Subscriber attempting to connect... [0021] [1] No locomotives found in the configuration, going into BLE scan mode. [0022] [0] MQTT: Subscriber connected [0023] [0] MQTT: Subscriber subscribed to topic 'rocrail/service/command' [0024] [0] BLE : Scanning for 0 hub(s) aborted. [0025] [0] BLE : Scanning for 0 hub(s)... [0026] [0] BLE : Discovered unknown device: (9c:8c:6e:5a:ef:a9). [0027] [0] BLE : Discovered unknown device: HwZ_fb0e3dbbb9002b1710 (00:a0:50:*). [0028] [0] BLE : Discovered unknown device: (67:45:23:56:*). [0029] [0] BLE : Scanning for 0 hub(s) aborted. [0030] [0] BLE : Scanning for 0 hub(s)... [0031] [0] BLE : Discovered unknown device: HwZ_fb0e3dbbb9002b1710 (00:a0:50:*). [0032] [0] BLE : Discovered unknown device: (67:45:23:*). [0033] [0] BLE : Discovered unknown device: (9c:8c:6e:*).
The address strating with
90:...
are lego Pu hubs, addresses starting with50:...
are the new BuWizz 2.0 hubs.BTW this is the development branch (which I am using and developing on, I consider it stable).
Hilbert
Hilbert B
AdministratorHi,
The line
Config: Failed to read config file: deserializeJson() failed with code InvalidInput
indicates that there is something wrong with yourcontroller_config.json
.This should be fixed first, before anything else!
Hilbert
Oktober 14, 2024 um 22:48 Uhr als Antwort auf: Bill of Material fehlt in der “MTC4 Mini with batterie” #7767Hilbert B
AdministratorHallo,
Es solte ein “MX1616 1.5A Dual Motor Driver Module” sein.
Hilbert
Hilbert B
AdministratorHi,
It looks like you have no or empty configuration files.
In main.cpp you have on the top op the file:
#include
#include “../conf/my/controller_config.h”
#include “../conf/my/network_config.h”#include “MLC_check.h”
The ../conf/my include files may not me empty, the easiest thing to do is to copy the default ones (situated in ../conf/default) alter them to fit your configuration.
As a best practice, do not edit the ../conf/default one’s, these will be overwritten when you update/download new versions of the source.
Hilbert
Hilbert B
AdministratorHi Martin,
There should be my_platformio.ini.example I assume you renamed/copied it to my_platformio.ini
And I see that there is missing a [my_common] section, we added this because we saw that platformio wasn’t merging variables as expected. This section could be empty:
[my_common]
build_flags =(I did not test this) or otherwise you can try
[my_common]
build_flags = -DFOOThis makes sure the section is defined, the -DFOO does not influence the build, just makes platformio happy.
I openend a ticket, not sure how fast we pick this one up, because of summer and being more outside, than behind the screen 😉
Hilbert
Dezember 27, 2022 um 23:48 Uhr als Antwort auf: MLC sendet an den Port Extender aber keine Reaktion der Weichenmotoren #5712Hilbert B
AdministratorSorry for replying in English, my German writing is really bad.
But did you wire it according to the article on the site? If so can you test if the vcc has 5 volt? Some breadboards have the two outer lines split in half, if that is the case the pca9685 board does not get the 5 volt needed to power the servo.
Hilbert B
AdministratorHost open, should be host ip (entering this on my phone and something like autocorrect)
Hilbert B
AdministratorHi Tomas,
My guess would be that mqtt hostname cannot be blank. Please enter the mqtt host open in hostname and leave userid blank.
It should probably be the same up address you entered in the network configuration json file. Then it should probably work.
HilbertHilbert B
AdministratorHi David,
To bad to hear that it did not workout for you.
HilbertHilbert B
AdministratorHi,
Sorry for the late reply.It looks like bad wifi coverage. What is the distance to your wifi access point (AP) and is it on the same floor?
In the Netherlands, it is common to have laminate flooring with a subfloor in which aluminium foil has been used. If the AP is not on the same floor, you have very poor wifi conerage.
Hilbert -
Diese Antwort wurde vor 3 Wochen, 4 Tage von
-
AutorBeiträge