skip to Main Content

I’m facing an issue when I’m trying to run a iothub module project generated using the plugin iotedgehubdev for visual studio code.

The generated debug template is as follows:

{
  "$schema-template": "4.0.0",
  "modulesContent": {
    "$edgeAgent": {
      "properties.desired": {
        "schemaVersion": "1.4",
        "runtime": {
          "type": "docker",
          "settings": {
            "minDockerVersion": "v1.25",
            "loggingOptions": "",
            "registryCredentials": {}
          }
        },
        "systemModules": {
          "edgeAgent": {
            "type": "docker",
            "settings": {
              "image": "mcr.microsoft.com/azureiotedge-agent:1.4",
              "createOptions": {}
            }
          },
          "edgeHub": {
            "type": "docker",
            "status": "running",
            "restartPolicy": "always",
            "settings": {
              "image": "mcr.microsoft.com/azureiotedge-hub:1.4",
              "createOptions": {
                "HostConfig": {
                  "PortBindings": {
                    "5671/tcp": [
                      {
                        "HostPort": "5671"
                      }
                    ],
                    "8883/tcp": [
                      {
                        "HostPort": "8883"
                      }
                    ],
                    "443/tcp": [
                      {
                        "HostPort": "443"
                      }
                    ]
                  }
                }
              }
            }
          }
        },
        "modules": {
          "ModBusModule": {
            "version": "1.0",
            "type": "docker",
            "status": "running",
            "restartPolicy": "always",
            "settings": {
              "image": "${MODULES.ModBusModule.debug}",
              "createOptions": {}
            }
          },
          "SimulatedTemperatureSensor": {
            "version": "1.0",
            "type": "docker",
            "status": "running",
            "restartPolicy": "always",
            "settings": {
              "image": "mcr.microsoft.com/azureiotedge-simulated-temperature-sensor:1.4",
              "createOptions": {}
            }
          }
        }
      }
    },
    "$edgeHub": {
      "properties.desired": {
        "schemaVersion": "1.4",
        "routes": {
          "ModBusModuleToIoTHub": "FROM /messages/modules/ModBusModule/outputs/* INTO $upstream",
          "sensorToModBusModule": "FROM /messages/modules/SimulatedTemperatureSensor/outputs/temperatureOutput INTO BrokeredEndpoint("/modules/ModBusModule/inputs/input1")"
        },
        "storeAndForwardConfiguration": {
          "timeToLiveSecs": 7200
        }
      }
    }
  }
}

The error I’m getting is as follows:

PS C:projects*redacted**redacted*iot-edge-module*redacted*> & "c:Users*redacted*.vscodeextensionsvsciot-vscode.azure-iot-edge-1.25.11iotedgehubdev.14.18iotedgehubdev" start -d "c:projects*redacted**redacted*iot-edge-module*redacted*configdeployment.debug.amd64.json" -v
edgeHub image version is ignored in solution mode.
Network azure-iot-edge-dev is external, skipping
Pulling edgeHubDev ... done
Docker Compose is now in the Docker CLI, try `docker compose up`

ERROR: invalid reference format: repository name must be lowercase
ERROR: Error while executing command: docker-compose -f C:Users*redacted*AppDataLocal.iotedgehubdevdatadatadocker-compose.yml up. Command '['docker-compose', '-f', 'C:\Users\*redacted*\AppData\Local\.iotedgehubdev\data\data\docker-compose.yml', 'up']' returned non-zero exit status 1.

I however can’t seem to find what exactly is causing this error.

  • I’ve tried it with ModBusModule spelled all lower case but this did not resolve the issue. I’ve also tried with the image path specified as "${MODULES<../ModBusModule.debug>}", "${MODULES<../ModBusModule>}", "${MODULDIR<../ModBusModule.debug>}", "${MODULDIR<../ModBusModule>}".
  • I’ve also tried using a hosted Azure container register.

But these things did not resolve the issue I’m having.
Does anyone have any idea as to what this issue might be? Obvious it’s something repository name related but I don’t know what part or where MODULES gets set by iotedgehubdev.

Thanks in advance!

2

Answers


  1. Chosen as BEST ANSWER

    So after some debugging and allot of troubleshooting with different project types and old iotedge projects. I have found what was giving the issues.

    When generating a new module for csharp the following files are missing and need to be added manually.

    1. All the docker files for the module
    2. module.json

    Once these files are added in the output file the image will be set correctly and the docker-compose error will stop.


  2. I followed this MSDOC and git to simulate a sample module of Edge using Visual Studio Code.

    
     "SimulatedTemperatureSensor": {
                "version": "1.0",
                "type": "docker",
                "status": "running",
                "restartPolicy": "always",
                "settings": {
                  "image": "mcr.microsoft.com/azureiotedge-simulated-temperature-sensor:1.4",
                  "createOptions": {}
                }
              },
              "SampleFunction": {
                "version": "1.0",
                "type": "docker",
                "status": "running",
                "restartPolicy": "always",
                "settings": {
                  "image": "${MODULES.SampleFunction}",
                  "createOptions": {}
                }
              }
            }
          }
        }
    
    

    enter image description here

    enter image description here

    • For the Azure IoT Edge module with Modbus template , refer to this git .
    
     " "edgeHub": {
                "type": "docker",
                "status": "running",
                "restartPolicy": "always",
                "settings": {
                  "image": "mcr.microsoft.com/azureiotedge-hub:1.0",
                  "createOptions": "{"HostConfig":{"PortBindings":{"8883/tcp":[{"HostPort":"8883"}],"443/tcp":[{"HostPort":"443"}]}}}"
                }
              }
            },
            "modules": {
              "modbus": {
                "version": "1.0",
                "type": "docker",
                "status": "running",
                "restartPolicy": "always",
                "settings": {
                  "image": "${MODULES.iotedgeModbus.amd64}",
                  "createOptions": ""
                }
              }
            }
          }
        }
    
    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search