Welcome to MattzoBricks Forums MattzoTrainController for Bluetooth (MTC4BT) Issue with W5500: UNKNOWN NETWORK TYPE

Viewing 6 reply threads
  • Author
    Posts
    • #8484
      Frank R.Frank R.
      Participant

      Hi all,

      As our setup continues to grow and more trains are being added, I want to use a W5500 module with the ESP32 for improved stability.
Unfortunately, I haven’t been able to get it to work. When booting the ESP, I get the following messages:

      [1] Setup: Starting MTC4BT…
      
[1] Setup: Loading network configuration…

      Config: UNKNOWN NETWORK TYPE: null, falling back to wireless!
      
[0000] [1] [INFO] Logging: Configured.

      Config: File is empty

      As described in the documentation, I added the -DWIRED flag to the common section of my my_platformio.ini:

      [common]

      additional_build_flags =
   
         -DWIRED

      upload_com_port = /dev/tty.usbserial-0001

      However, I also noticed that the -DWIRED flag is already present in the esp32 section of platformio.ini:

      [env:esp32]

      board = az-delivery-devkit-v4
      
build_flags =

      ${common.additional_build_flags}
      
${common.build_flags}

         -DWIRED
      
   -DCONFIG_BT_NIMBLE_MAX_CONNECTIONS=9

      Since I’m seeing the message Config: File is empty, I assume something is wrong with my configuration.
Has anyone experienced this or could suggest how to debug it properly?

      Thanks in advance!

    • #8485
      Matthias RunteMatthias Runte
      Keymaster

      Hi Frank,
      welcome to the forum. Could you post your network_config.json, please?

      Thanks!

    • #8487
      Frank R.Frank R.
      Participant

      Thank you and thanks for the fast reply!

      Sorry… I missed the whole network part in the network_config.json.
      It is working now after I added “network” : {“type” : “wired”}.

    • #8488
      Matthias RunteMatthias Runte
      Keymaster

      Good to hear, perfect!

    • #8489
      Mitja CernichMitja Cernich
      Participant

      Hi, i have the same problem:

      network_config.json

      {
      “logging”: {

      “min_level”: “info”,
      “serial”: {

      “enabled”: true
      },
      “syslog”: {

      “enabled”: true,
      “server”: “192.168.x.y”,
      “port”: 514,
      “appname”: “MTC4BT”
      }
      },
      “network” : {

      “hostname”: “mtc4bt”,
      “otaPassword”: “xxxxxx”,
      “type” : “wired”
      },
      “wifi”: {

      “SSID”: “Rocrail”,
      “password”: “Rocc”,
      “wait”: 500
      },
      “mqtt”: {

      “broker”: “192.168.0.200”,
      “port”: 1883,
      “keepalive”: 10,
      “ping”: 0
      }
      }

      my_platformio.ini

      [platformio]
      default_envs = esp32

      ; This controller must be configured through config files in the folder you define below.
      ; Configure your network in the network_config.json file.
      ; Configure the controller in the controller_config.json file.
      ; See the /data_example folder for example configuration files.
      ; Run platformio.exe run --target uploadfs to upload the data-folder content to the ESP32.
      ; moved to my_platformio.ini
      ; for Linux you have to add a / before $PROJECT_DIR
      data_dir = /$PROJECT_DIR/data/MTC4BT1

      [common]
      ; To show memory usage every minute, uncomment the line -DTICKER=1
      ; To see what the hubs report back on not cached messages uncomment the lines,
      ; this is for debugging only and should only be used if instructed to do so
      ; To reduce the delays in the BLE driver loops change the value of DRIVERTASKDELAY,
      ; changing this yourself without a hint of the developers may cause strange behaviors
      ; and even crashes!
      additional_build_flags =
      -DWIRED
      ; -DTICKER=1
      ; -DDEBUGNOTIFYBUWIZZ2
      ; -DDEBUGNOTIFYPU
      ; -DDEBUGNOTIFYPUREMOTE
      ; -DDRIVERTASKDELAY=100
      ; -DPUFREELISTACTIONDELAY=250
      upload_com_port = /dev/cu.usbserial-0001
      ; for macOS, just as example
      ;upload_com_port = /dev/tty.usb

      [env:esp32]
      ; Use either the ‘upload_port’ line above if the ESP32 is connected to your PC’s USB port or enable/configure the three lines below to use OTA updates.
      ; The IP address should match that of the controller on your network.
      ; The <otaPassword> should match the current password from the network_config.json you previously uploaded to the controller.
      ;upload_protocol = espota
      ;upload_port = 192.168.x.y
      ;upload_flags =
      ; –auth=<ota password>

      ;[env:seeed_xiao_esp32-s3]
      ;upload_protocol = espota
      ;upload_port = 192.168.x.z
      ;upload_flags =
      ; –auth=<ota password>

      from the monitor on boot of eps32:

      [1] Setup: Starting MTC4BT…
      [1] Setup: Loading network configuration…
      Syslog: Server: 192.168.x.y:514
      Syslog: Hostname: mtc4bt
      Syslog: Appname: MTC4BT
      [0000] [1] [INFO] Logging: Configured.
      Config: File is empty
      [0002] [1] [INFO] Setup: Loading controller configuration…
      [0003] [1] [INFO] Config: Read controller name: MTC4BT
      [0004] [1] [INFO] Config: Read ESP pin configuration (0).
      [0007] [1] [INFO] CTRL: Local channels initialized.
      [0008] [1] [INFO] Setup: Controller configuration completed.
      [0009] [1] [INFO] setup: WiFi Event ID: 4
      [0016] [1] [INFO] Wait for WiFi/ETH…
      [0017] [1] [INFO] MQTT: Connecting to 192.168.0.200:1883…
      [0018] [1] [INFO] Setup: Initializing BLE…
      [0019] [1] [INFO] Setup: MattzoTrainController for BLE running.
      [0020] [1] [INFO] Setup: Number of locos to discover hubs for: 2
      [0021] [1] [INFO] Setup: Number of remotes to discover hubs for: 0
      [0024] [0] [INFO] BLE : Scanning for 2 hub(s)…

      Where am i going wrong? thank you so much

    • #8490
      Matthias RunteMatthias Runte
      Keymaster

      Could you swtch debug info on and post the console output again? Thanks.

      • #8491
        Mitja CernichMitja Cernich
        Participant

        How can I switch the debug info on? Thanks

        • #8492
          Mitja CernichMitja Cernich
          Participant

          OK i switch from “info to “debug” in network_config.json on logging > min_level

          [1] Setup: Starting MTC4BT…
          [1] Setup: Loading network configuration…
          Syslog: Server: 192.168.x.y:514
          Syslog: Hostname: mtc4bt
          Syslog: Appname: MTC4BT
          [0000] [1] [INFO] Logging: Configured.
          Config: File is empty
          [0001] [1] [DEBUG] No lookuptable found, or empty
          [0002] [1] [INFO] Setup: Loading controller configuration…
          [0003] [1] [INFO] Config: Read controller name: MTC4BT
          [0004] [1] [INFO] Config: Read ESP pin configuration (1).
          [0005] [1] [DEBUG] Number of events loaded: 0.
          [0006] [1] [DEBUG] Number of events loaded: 0.
          [0007] [1] [INFO] CTRL: Local channels initialized.
          [0008] [1] [INFO] Setup: Controller configuration completed.
          [0009] [1] [INFO] setup: WiFi Event ID: 4
          [0010] [1] [DEBUG] [WiFi-event] event: 0

          [0011] [1] [DEBUG] WiFi interface ready
          [0012] [1] [DEBUG] [WiFi-event] event: 2

          [0013] [1] [DEBUG] WiFi client started
          [0014] [1] [DEBUG] [WiFi-event] event: 18

          [0015] [1] [DEBUG] Ethernet started
          [0016] [1] [INFO] Wait for WiFi/ETH…
          [0017] [1] [INFO] MQTT: Connecting to 192.168.0.200:1883…
          [0018] [1] [INFO] Setup: Initializing BLE…
          [0019] [1] [INFO] Setup: MattzoTrainController for BLE running.
          [0020] [1] [INFO] Setup: Number of locos to discover hubs for: 2
          [0021] [1] [INFO] Setup: Number of remotes to discover hubs for: 0
          [0022] [1] [DEBUG] SetE-Brake: 1
          [0023] [1] [DEBUG] SetE-Brake: 1
          [0024] [0] [INFO] BLE : Scanning for 2 hub(s)…

          • #8493
            Mitja CernichMitja Cernich
            Participant

            I don’t know how, but not it working:
            [0031] [1] [DEBUG] [WiFi-event] event: 20

            [0032] [1] [DEBUG] Ethernet connected
            [0033] [1] [DEBUG] [WiFi-event] event: 22

            Obtained ETH IP address: 192.168.0.100
            ETH connected
            IP address:
            192.168.0.100
            MAC Address: A2:A3:B3:96:47:ED

    • #8494
      Hilbert BHilbert B
      Keymaster

      Hi 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

      • #8495
        Mitja CernichMitja Cernich
        Participant

        Hi Hilbert,
        after a few minutes it started working

Viewing 6 reply threads
  • You must be logged in to reply to this topic.