Skip to content

Error in Initialization of Actuator when Empty #30

@FelizCoder

Description

@FelizCoder

Description:

While running the FastAPI application, there is an import error related to actuator initialization, specifically indicated by the message: ERROR Import error: is not a valid pin name. This error occurs when the application attempts to initialize actuators with the GPIO settings defined in the .env file. The expected behavior is that an empty Actuator should be initialized without errors.

Steps to Reproduce:

  1. Start the FastAPI application using the command:
    fastapi.exe dev .\app\main.py
  2. Observe the logs for any error messages during the initialization of actuators.

Expected Behavior:

An empty Actuator should be initialized properly without throwing any import errors related to pin names.

Actual Behavior:

The application throws an import error indicating that a pin name is invalid, preventing the initialization of actuators.

Additional Context:

  • Configuration settings related to actuators, such as SOLENOID_GPIO, PROPORTIONAL_GPIO, and PUMP_GPIO, are defined in the .env.example file.
  • The ActuatorRepository classes depend on these GPIO settings for instantiation.

Suggested Areas to Investigate:

  • Check the .env file to ensure that the GPIO pin configurations are set correctly, especially ensure that all pin names are valid and formatted appropriately.
  • Review the initializations in the SolenoidActuator, PumpActuator, and any other repository classes that rely on GPIO settings for potential issues with pin definitions.
  • Consider whether any mock GPIO mode is being used unintentionally and whether this affects the initialization of empty Actuators.

References:

  • .env.example: Look for the expected pin configurations and ensure they are set correctly.
  • app/repositories/GPIO/solenoid_valves.py and app/repositories/GPIO/pumps.py: Check how these classes handle the GPIO pins during their initialization.

Feel free to provide more details or logs if available to help diagnose the issue further.

Metadata

Metadata

Assignees

No one assigned

    Labels

    wontfixThis will not be worked on

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions