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

[DESIGN] - Control Flow Suggestions #132

Open
lmajor91 opened this issue Aug 29, 2022 · 2 comments
Open

[DESIGN] - Control Flow Suggestions #132

lmajor91 opened this issue Aug 29, 2022 · 2 comments
Assignees
Labels
Scope: Engineering Design Design features and ideas Status: Open Anybody may contribute to this feature Type: New Feature New feature

Comments

@lmajor91
Copy link

Control Flow Suggestions

  • 'Up To Date?' could potentially brick a system whose update changes some core function or if there is an entirely new version of
    PeaPod that doesn't function the same way as the old.
    • this can be resolved by properly detecting updates for that specific peapod's version/model number
    • this should have an option to be disabled in case the user doesn't want it to update for whatever reason.
  • sub to config will have to constantly check if the config has been changed. this will increase overhead and possibly decrease
    performance.
    • there should be an option to turn this off if needed; perhaps to save power. if this option exists, it should
      be enabled by default
  • Publish Data to MQTT broker;
    • during the Online? step, if the peapod isn't online it how will it publish data? when I say online does it have an
      internet connection or if its networking module works correctly?
      • this could be changed if peapod can properly communicate with a set endpoint and use the proper protocol
        to communicate with said endpoint
        • endpoint; url (MQTT endpoint, HTTP, webhook, etc.) or a file (a special program/function/script on the
          machine)
      • there should be a step between 'Online?' and 'Choose Program' that does a POST to its endpoint to ensure that the peapod can properly publish data there. Something like the torrent networks' 'announce' endpoint on a tracker
  • MQTT broker/publish endpoint
    • this should either be hotpluggable (it can change during run time) or during the 'Setup MQTT' phase
    • you should be able to connect to whatever MQTT or publisher endpoint, however we might have to modify the
      method of transmission depending on protocol (MQTT, HTTP, FTP, SSH, rsync, etc.)
      • this should either be detected or a manual option should be set to dictate the transfer protocol
      • if this is the case then there should be some universal interface which has a transfer protocol and each protocol is implemented differently. might have to use libraries to accomplish this.
  • Main Loop
    • since plants don't grow over seconds but over hours and days, is it worth it to put the main loop (not to say the controls which manage the plant e.g., water, lighting, etc.) on a timer which checks its broker for any changes then finishes on the 'Act' phase.
    • this could increase power saving since the CPU onboard won't be doing anything therefore saving power.
  • Camera Capture
    • we're going to need some serious machine learning for debris detection or for camera imaging to determine whether or not the plant is growing correctly. or this is just pure speculation and a more 'dumb' implementation should suffice.
  • Software wise is it better to create software designed with specific parameters to flash onto the arduino/peapod or if it should be
    hotpluggable (in terms of settings). Or there can be an option to do both
@lmajor91 lmajor91 added Status: Open Anybody may contribute to this feature Type: New Feature New feature Scope: Engineering Design Design features and ideas labels Aug 29, 2022
@lmajor91
Copy link
Author

main loop already has a sleep between cycles. see here

@lmajor91
Copy link
Author

index.ts handles being offline and continues. here

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Scope: Engineering Design Design features and ideas Status: Open Anybody may contribute to this feature Type: New Feature New feature
Projects
None yet
Development

No branches or pull requests

2 participants