Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add MQTT Handling for Retrieving and Publishing Camera Name #44

Open
wants to merge 6 commits into
base: main
Choose a base branch
from

Conversation

melissadjadoun
Copy link

@melissadjadoun melissadjadoun commented Jul 24, 2024

This pull request addresses the feature request outlined in PlanktoScope/PlanktoScope#225 to retrieve and publish the camera name via MQTT.

Changes Made:

  • Modified run method in mqtt.py:
  • Set up MQTT to listen on the topic camera/info.
  • Added logic to respond to the action { "action": "get" } on the topic camera/info.
  • The response includes the camera name and is published to the topic status/camera/info.

Copy link
Member

@ethanjli ethanjli left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Here's my initial review. The next step will be to test this with changes to the Node-RED dashboard.

control/planktoscopehat/planktoscope/camera/mqtt.py Outdated Show resolved Hide resolved
control/planktoscopehat/planktoscope/camera/mqtt.py Outdated Show resolved Hide resolved
control/planktoscopehat/planktoscope/camera/mqtt.py Outdated Show resolved Hide resolved
control/planktoscopehat/planktoscope/camera/mqtt.py Outdated Show resolved Hide resolved
Copy link
Member

@ethanjli ethanjli left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It looks like you made some changes in the adafruithat version of the hardware controller and you made some other changes in the planktoscopehat version of the hardware controller. For this PR, please always keep the adafruithat/planktoscope/camera/mqtt.py file identical to the planktoscopehat/planktoscope/camera/mqtt.py file - for example, make all of your edits in the planktoscopehat/planktoscope/camera/mqtt.py file, and then before each commit/push to GitHub make sure you copy the planktoscopehat/planktoscope/camera/mqtt.py file to adafruit/planktoscope/camera/mqtt.py (overwriting the previous file at that path).

control/adafruithat/planktoscope/camera/mqtt.py Outdated Show resolved Hide resolved
control/adafruithat/planktoscope/camera/mqtt.py Outdated Show resolved Hide resolved
control/planktoscopehat/planktoscope/camera/mqtt.py Outdated Show resolved Hide resolved
control/planktoscopehat/planktoscope/camera/mqtt.py Outdated Show resolved Hide resolved
control/adafruithat/planktoscope/camera/mqtt.py Outdated Show resolved Hide resolved
control/adafruithat/planktoscope/camera/mqtt.py Outdated Show resolved Hide resolved
control/adafruithat/planktoscope/camera/mqtt.py Outdated Show resolved Hide resolved
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants