Willkommen bei MattzoBricks › Foren › MattzoTrainController for Bluetooth (MTC4BT) › controller_config.json
- Dieses Thema hat 15 Antworten und 2 Teilnehmer, und wurde zuletzt aktualisiert vor 2 Jahren, 2 Monaten von volkmar weiss.
-
AutorBeiträge
-
-
Januar 29, 2022 um 09:44 Uhr #4901volkmar weissTeilnehmer
Hi, da ich neu in der Materie bin und mit VScode usw. nichts zu tun habe, frage ich mal wo liegt der Fehler in meiner controller_config.json? Hardware ist AZDelivery ESP32 Dev Kit C V4 NodeMCU (Drauf steht ESP32 Wroom-32 BT4.2)
[1] Setup: Starting MattzoTrainController for BLE…
[1] Setup: Loading network configuration…
Syslog: Server: 192.168.0.210:514
Syslog: Hostname: MTC4BT1
Syslog: Appname: MTC4BT1
[1] Logging: Configured.
[1] Setup: Loading controller configuration…
[1] Config: Read controller name: MTC4BT
[1] Config: Read ESP pin configuration (2).
[1] Config: Read function configuration (1).
[1] Config: Hub ‘D��?␑’ or channel ���?␁ not configured in this loco’s ‘bleHubs’ section.
Guru Meditation Error: Core 1 panic’ed (LoadProhibited). Exception was unhandled.
Core 1 register dump:
PC : 0x40186f93 PS : 0x00060530 A0 : 0x800d7f74 A1 : 0x3ffcb910
A2 : 0x00000000 A3 : 0x3ffcd0f8 A4 : 0x3ffcce7c A5 : 0x00000000
A6 : 0x0000004f A7 : 0x3ffccf30 A8 : 0x800eccf2 A9 : 0x3ffcb8c0
A10 : 0x00000003 A11 : 0x3ffcd0f8 A12 : 0x0000007f A13 : 0x0000ff00
A14 : 0x00ff0000 A15 : 0xff000000 SAR : 0x00000010 EXCCAUSE: 0x0000001c
EXCVADDR: 0x00000038 LBEG : 0x400014fd LEND : 0x4000150d LCOUNT : 0xffffffe9ELF file SHA256: 0000000000000000
Backtrace: 0x40186f93:0x3ffcb910 0x400d7f71:0x3ffcb930 0x400d865f:0x3ffccc00 0x400eef56:0x3ffccc50 0x40090892:0x3ffccc70
Rebooting…
ets Jun 8 2016 00:22:57rst:0xc (SW_CPU_RESET),boot:0x13 (SPI_FAST_FLASH_BOOT)
configsip: 0, SPIWP:0xee
clk_drv:0x00,q_drv:0x00,d_drv:0x00,cs0_drv:0x00,hd_drv:0x00,wp_drv:0x00
mode:DIO, clock div:2
load:0x3fff0018,len:4
load:0x3fff001c,len:1044
load:0x40078000,len:10124
load:0x40080400,len:5828
entry 0x400806a8ich habe die Beispielkonfiguration genommen und die mac Adresse des Sbrick eingetragen und den Namen geändert, sonst nichts.
{
“name”: “MTC4BT”,
“espPins”: [
{
“pin”: 5,
“inverted”: false,
“attachedDevice”: “light”
},
{
“pin”: 23,
“inverted”: false,
“attachedDevice”: “light”
}
],
“fn”: [
{
“name”: “status”,
“device”: “espPin”,
“pin”: 23
}
],
“locos”: [
{
“address”: 1,
“name”: “60197”,
“speedStep”: 10,
“brakeStep”: 20,
“bleHubs”: [
{
“type”: “SBrick”,
“address”: “96:35:3D:19:FD:C8”,
“channels”: [
{
“channel”: “B”,
“attachedDevice”: “light”,
“direction”: “forward”
},
{
“channel”: “D”,
“attachedDevice”: “motor”,
“direction”: “forward”
}
]
}
],
“fn”: [
{
“name”: “f2”,
“device”: “bleHub”,
“address”: “96:35:3D:19:FD:C8”,
“channel”: “B”
},
{
“name”: “f4”,
“device”: “espPin”,
“pin”: 5
}
]
}
]
}wenn ich die controller_config.json leer lasse, dann kommt folgender Fehler:
[1] Setup: Starting MattzoTrainController for BLE…
[1] Setup: Loading network configuration…
Syslog: Server: 192.168.0.210:514
Syslog: Hostname: MTC4BT1
Syslog: Appname: MTC4BT1
[1] Logging: Configured.
[1] Setup: Loading controller configuration…
[1] Config: Read controller name: MTC4BT
[1] Config: Read ESP pin configuration (0).
[1] Config: Read function configuration (0).
[1] Config: Read loco configuration (0).
[1] Setup: Initializing BLE…
[1] Setup: Controller configuration completed.
[1] Wifi: Connecting to jojofritz.[1] MQTT: Connecting to 192.168.0.210:1883…
[1] Setup: MattzoTrainController for BLE running.
[1] Setup: Number of locos to discover hubs for: 0
[0] Wifi: Connected (IPv4: 192.168.0.233).
[0] OTA: Initialized.
[0] MQTT: Subscriber configuring last will…
[E][WiFiUdp.cpp:183] endPacket(): could not send data: 12
[0] MQTT: Subscriber attempting to connect…
[E][WiFiClient.cpp:258] connect(): socket error on fd 56, errno: 113, “Software caused connection abort”
[0] MQTT: Subscriber connect failed, rc=4294967294. Try again in a few seconds…
[0] MQTT: Subscriber configuring last will…
[0] MQTT: Subscriber attempting to connect…
[E][WiFiClient.cpp:258] connect(): socket error on fd 57, errno: 113, “Software caused connection abort”
[0] MQTT: Subscriber connect failed, rc=4294967294. Try again in a few seconds…
[0] MQTT: Subscriber configuring last will…
[0] MQTT: Subscriber attempting to connect…
[E][WiFiClient.cpp:258] connect(): socket error on fd 58, errno: 113, “Software caused connection abort”
[0] MQTT: Subscriber connect failed, rc=4294967294. Try again in a few seconds…
[0] MQTT: Subscriber configuring last will…
[0] MQTT: Subscriber attempting to connect…in mosquitto.conf habe ich stehen:
allow_anonymous true
listener 1883- Dieses Thema wurde geändert vor 2 Jahren, 3 Monaten von volkmar weiss.
- Dieses Thema wurde geändert vor 2 Jahren, 3 Monaten von volkmar weiss.
-
Januar 29, 2022 um 14:50 Uhr #4922Steven ElstonTeilnehmer
Ändern Sie Ihren MAC: „96:35:3D:19:FD:C8“ in Kleinbuchstaben: „96:35:3d:19:fd:c8“ und versuchen Sie das. Ich habe das gleiche Problem mit dem MQTT-Broker….
change your MAC : “96:35:3D:19:FD:C8” to lower case letters: “96:35:3d:19:fd:c8” and try that. I am having the same issue with the MQTT broker….
- Diese Antwort wurde geändert vor 2 Jahren, 3 Monaten von Steven Elston. Grund: added poor translation
-
Januar 29, 2022 um 15:42 Uhr #4924Steven ElstonTeilnehmer
brachte mosquitto zum Laufen, indem er den Dienst in den Windows-Diensten abschaltete und mosquitto -c mosquitto.conf -v aus dem cmd-Fenster aus dem mosquitto-Verzeichnis ausführte. wird das wahrscheinlich als Startbefehl in die Windows-Dienste einfügen
got mosquitto to work by shutting off service in windows services and ran mosquitto -c mosquitto.conf -v from the cmd window from the mosquitto dir. probably will put that as a startup command in the window services
- Diese Antwort wurde geändert vor 2 Jahren, 3 Monaten von Steven Elston. Grund: added poor translation
-
Januar 29, 2022 um 16:36 Uhr #4938volkmar weissTeilnehmer
Thanks for the help with the Mac addresses, I think that worked.
It also connects to the SBrick but then comes the same MQTT error message, no matter if it is started as a service or manually. -
Januar 29, 2022 um 16:41 Uhr #4939Steven ElstonTeilnehmer
The IP address for the MQTT and the wifi are both the same on my machine as I run the entire system from a laptop. I do see that you have .210 and .233 maybe that is the issue?
-
Januar 29, 2022 um 17:03 Uhr #4940volkmar weissTeilnehmer
192.168.0.210 is the laptop where runs MQTT and Rocview
192.168.0.233 is the ip address that the esp32 gets from the fritzbox.in the network_config.json
server and broker ip : 192.168.0.210
-
-
Januar 29, 2022 um 17:15 Uhr #4941Steven ElstonTeilnehmer
ah, yes..I was looking at your details wrong. 🙁 I am a novice at this system as well. 😮 I was having the same issue with MQTT until I ran the command prompt. In your mosquitto.conf file, located in C:/program files -> mosquitto you have the same ‘allow_anonymous true’ and ‘listener 1883. that you have in you VS script? that was a mistake I made earlier..
-
Januar 29, 2022 um 17:31 Uhr #4942volkmar weissTeilnehmer
Many thanks for the help and suggestions, it’s in the mosquitto.conf, but not in the VS code. Where else does it have to be?
-
Januar 29, 2022 um 17:47 Uhr #4944Steven ElstonTeilnehmer
Before I lead you down a wrong path, I was just referring to the newtork json mqtt broker entry that you already have. Sorry for the confusion. I do remember reading in the tutorial about having to move and not copy some certain file(s) into the Arduino folders let me see if I can reference them.
-
Januar 29, 2022 um 17:55 Uhr #4945Steven ElstonTeilnehmer
Yes-here: Controllers->firmware, under code structure: If you use one or more of the Arduino based controllers (MTC4PF, MTC4PU, MLC), then you need to MOVE (NOT COPY!) the files in the “library” folder to the Arduino library folder. On Microsoft Windows, do something similar like:
Navigate to C:\Users\Mattze\Documents\MattzoController\libraries
Move the “MattzoBricks” folder to C:\Users\Mattze\Documents\Arduino\libraries
The exact directory names will vary on your computer system.The following table contains a list of files and their purpose as of firmware version
**that is what I remembered** Sorry if it doesn’t help. I am learning just like you! 🙂
-
Januar 29, 2022 um 18:16 Uhr #4947volkmar weissTeilnehmer
I had done that before, but I think you only have to do that for the Powerfunctions version, because Arduino is used there and VSCode is used for the Bluetooth version
-
Januar 29, 2022 um 18:26 Uhr #4948Steven ElstonTeilnehmer
👍
- Diese Antwort wurde geändert vor 2 Jahren, 3 Monaten von Steven Elston.
-
Januar 30, 2022 um 18:39 Uhr #4959Steven ElstonTeilnehmer
I had a thought…maybe your router needs to have port 1883 open to pass?
-
Januar 31, 2022 um 08:10 Uhr #4961volkmar weissTeilnehmer
yes, that’s what I thought too and I set mosquitto as allowed on the firewall, the mqtt error is gone now too. Now I just have to figure out why the train isn’t moving. Locomotive is created, track created, vc-1 selected as control center, but nothing moves. MQTT with localhost and port 1883 is set in the Rocrail properties. forget something?
-
Januar 31, 2022 um 09:40 Uhr #4962Steven ElstonTeilnehmer
I set my localhost to the ip address, but I am still figuring out rocrail. I got the motor to respond but cannot get the lights to work. did you look at the debug script running to make sure everything is communicating? Rocrail is complex, I just started on the wiki tutorial and can’t even get the demo to run correctly :0
I am glad you were able to get the MQTT working.
-
Februar 2, 2022 um 12:36 Uhr #4970volkmar weissTeilnehmer
Solved my problems now. If anyone else has, here are some tips. Edit the mosquitto.conf with a program with admin rights (e.g. Notepad++) I had the commands allow_anonymous true
listener 1883 written in there but they are only accepted if the file was edited with admin rights.
Then I have the Sbrick app on my cell phone, which shows completely different MAC addresses with 2 Sbricks (wrong) than in the serial monitor on the Arduino (correct). SBrick also has the assignment of the ports differently than Mattze, in the controller config there is port B and D and in the Sbrick app it is A and C. And the strange thing is, I have 2 Sbricks, an old version and a new one, one has A and C and one has B and D so that it works, despite the same configuration in the config file.Hab jetzt meine Probleme gelöst. Falls die noch jemand hat , hier einige Tipps. Die mosquitto.conf unbedingt mit einem Programm mit Adminrechten bearbeiten (z.b. Notepad++) ich hatte die Befehle allow_anonymous true
listener 1883 da reingeschrieben aber die werden nur angenommen wenn die Datei mit Adminrechten bearbeitet wurde.
Dann habe ich die Sbrick App auf dem Handy , die zeigt mit bei 2 Sbricks ganz andere MAC Adressen an (falsche) als im seriellen Monitor bei Arduino (richtig) . Auch die Belegung der Ports hat SBrick wohl anders als Mattze , in der controller config steht Port B und D und in der Sbrick App ist das A und C . Und das ganz merkwürdige ist, ich habe 2 Sbricks, eine alte Version und eine neue, bei einer ist A und C und bei einer B und D belegt damit es funktioniert, trotz gleicher Konfiguration in der config Datei..- Diese Antwort wurde geändert vor 2 Jahren, 2 Monaten von volkmar weiss.
-
-
AutorBeiträge
- Du musst angemeldet sein, um auf dieses Thema antworten zu können.