element14 Community
element14 Community
    Register Log In
  • Site
  • Search
  • Log In Register
  • Community Hub
    Community Hub
    • What's New on element14
    • Feedback and Support
    • Benefits of Membership
    • Personal Blogs
    • Members Area
    • Achievement Levels
  • Learn
    Learn
    • Ask an Expert
    • eBooks
    • element14 presents
    • Learning Center
    • Tech Spotlight
    • STEM Academy
    • Webinars, Training and Events
    • Learning Groups
  • Technologies
    Technologies
    • 3D Printing
    • FPGA
    • Industrial Automation
    • Internet of Things
    • Power & Energy
    • Sensors
    • Technology Groups
  • Challenges & Projects
    Challenges & Projects
    • Design Challenges
    • element14 presents Projects
    • Project14
    • Arduino Projects
    • Raspberry Pi Projects
    • Project Groups
  • Products
    Products
    • Arduino
    • Avnet & Tria Boards Community
    • Dev Tools
    • Manufacturers
    • Multicomp Pro
    • Product Groups
    • Raspberry Pi
    • RoadTests & Reviews
  • About Us
  • Store
    Store
    • Visit Your Store
    • Choose another store...
      • Europe
      •  Austria (German)
      •  Belgium (Dutch, French)
      •  Bulgaria (Bulgarian)
      •  Czech Republic (Czech)
      •  Denmark (Danish)
      •  Estonia (Estonian)
      •  Finland (Finnish)
      •  France (French)
      •  Germany (German)
      •  Hungary (Hungarian)
      •  Ireland
      •  Israel
      •  Italy (Italian)
      •  Latvia (Latvian)
      •  
      •  Lithuania (Lithuanian)
      •  Netherlands (Dutch)
      •  Norway (Norwegian)
      •  Poland (Polish)
      •  Portugal (Portuguese)
      •  Romania (Romanian)
      •  Russia (Russian)
      •  Slovakia (Slovak)
      •  Slovenia (Slovenian)
      •  Spain (Spanish)
      •  Sweden (Swedish)
      •  Switzerland(German, French)
      •  Turkey (Turkish)
      •  United Kingdom
      • Asia Pacific
      •  Australia
      •  China
      •  Hong Kong
      •  India
      • Japan
      •  Korea (Korean)
      •  Malaysia
      •  New Zealand
      •  Philippines
      •  Singapore
      •  Taiwan
      •  Thailand (Thai)
      • Vietnam
      • Americas
      •  Brazil (Portuguese)
      •  Canada
      •  Mexico (Spanish)
      •  United States
      Can't find the country/region you're looking for? Visit our export site or find a local distributor.
  • Translate
  • Profile
  • Settings
1 Meter of Pi
  • Challenges & Projects
  • Design Challenges
  • 1 Meter of Pi
  • More
  • Cancel
1 Meter of Pi
Blog Space Vegetables - #6 : Software Design
  • Blog
  • Forum
  • Documents
  • Polls
  • Files
  • Events
  • Mentions
  • Sub-Groups
  • Tags
  • More
  • Cancel
  • New
  • Share
  • More
  • Cancel
Group Actions
  • Group RSS
  • More
  • Cancel
Engagement
  • Author Author: feiticeir0
  • Date Created: 29 Oct 2020 5:28 PM Date Created
  • Views 535 views
  • Likes 5 likes
  • Comments 4 comments
  • 1meterofpi
  • 1 meter of pi
  • space vegetables
  • 1meter of pi
Related
Recommended

Space Vegetables - #6 : Software Design

feiticeir0
feiticeir0
29 Oct 2020

While waiting for the kit to arrive and to be able to start piecing all together, it's time to start thinking how are the three Raspberry PIs be able to talk to each other.

The following picture shows this - the exchange of messages between them.

image

 

RPI4

The RPI 4 will store all the sensor information in a SQLITE3 database. The samples will be taken every 15m or 30m, still in study.

Two python scripts will be used:

  • Getting all the information from the sensors and storing it in the database
  • Using XMLRPC, a client will connect to the XMLRPC server (running in the server where the Automation HAT MINI is) and will issue order to turn on or off the pumps or lights, according to the sensor data. This will also be store in the database:
    • Pumps on or off
    • Lights on or off

The RPI4 will also have a Flask app providing some web services for the Raspberry PI zero to query with some information.

 

RPI 3B+

The Raspberry PI 3B+ will control the Automation Hat MINI and, if needed, a relay with 4 channels to control what it can't be controlled with the HAT - outputs/relays availability.

A Python XMLRPC server will be running here, waiting for instructions and commands from the RPI4 to take actions - using the Automation HAT or the relay .

 

Raspberry PI Zero

The Raspberry PI zero will take photos of the Hydroponics setup (and hopefully the crops) twice a day. This will allow to follow the progress of the vegetables growth (or not) in time.

Before it posts to Twitter, using Web Services, will query them for some info to post, along with the photo, to Twitter.

 

Well, it sounds well and easy on paper... Let's hope !

 

Happy programming and growing !

  • Sign in to reply

Top Comments

  • DAB
    DAB over 5 years ago +2
    Keep it simple and implement one thread at a time and you can keep control of the process. DAB
  • DAB
    DAB over 5 years ago in reply to feiticeir0 +2
    Ah, you misunderstood. I call threads the end to end flow from input to output. Threading within a processor is entirely different. So what I meant was to work through your data flow and implement them…
  • feiticeir0
    feiticeir0 over 5 years ago in reply to DAB +1
    I was trying to avoid threading.. But I'm curious. Where would I implement a thread ? Instead of having multiple python scripts ?
Parents
  • DAB
    DAB over 5 years ago

    Keep it simple and implement one thread at a time and you can keep control of the process.

     

    DAB

    • Cancel
    • Vote Up +2 Vote Down
    • Sign in to reply
    • More
    • Cancel
  • feiticeir0
    feiticeir0 over 5 years ago in reply to DAB

    I was trying to avoid threading.. But I'm curious. Where would I implement a thread ? Instead of having multiple python scripts ?

    • Cancel
    • Vote Up +1 Vote Down
    • Sign in to reply
    • More
    • Cancel
Comment
  • feiticeir0
    feiticeir0 over 5 years ago in reply to DAB

    I was trying to avoid threading.. But I'm curious. Where would I implement a thread ? Instead of having multiple python scripts ?

    • Cancel
    • Vote Up +1 Vote Down
    • Sign in to reply
    • More
    • Cancel
Children
  • DAB
    DAB over 5 years ago in reply to feiticeir0

    Ah, you misunderstood.

     

    I call threads the end to end flow from input to output.

    Threading within a processor is entirely different.

     

    So what I meant was to work through your data flow and implement them one at a time so you can test them end to end before you integrate them all into a continuous program.

     

    DAB

    • Cancel
    • Vote Up +2 Vote Down
    • Sign in to reply
    • More
    • Cancel
  • feiticeir0
    feiticeir0 over 5 years ago in reply to DAB

    Oh my, of course ! Since I can remember (I've been programming 24 years now) I always "divide to conquer" !  Start with small programs, integrate them with small tasks and make sure they work before moving on to the "big picture" ! . The XMLRPC client/server are already tested. image

    The database is already created and populated with random data. I'm moving now to the Web Services with Flask to test the retrieving of data from the DB.

    I'm expecting, of course, during the actual programming of the system that changes will have to be made - I can't now actually test with the pumps and the sensors, but small test scripts are already in place to be tested when the kit arrive - if  UPS didn't lie, it will be next Friday ! image

     

    Best regards

    • Cancel
    • Vote Up +1 Vote Down
    • Sign in to reply
    • More
    • Cancel
element14 Community

element14 is the first online community specifically for engineers. Connect with your peers and get expert answers to your questions.

  • Members
  • Learn
  • Technologies
  • Challenges & Projects
  • Products
  • Store
  • About Us
  • Feedback & Support
  • FAQs
  • Terms of Use
  • Privacy Policy
  • Legal and Copyright Notices
  • Sitemap
  • Cookies

An Avnet Company © 2025 Premier Farnell Limited. All Rights Reserved.

Premier Farnell Ltd, registered in England and Wales (no 00876412), registered office: Farnell House, Forge Lane, Leeds LS12 2NE.

ICP 备案号 10220084.

Follow element14

  • X
  • Facebook
  • linkedin
  • YouTube