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
Raspberry Pi
  • Products
  • More
Raspberry Pi
Raspberry Pi Forum Pi HMI with the Official 7" Touchscreen
  • Blog
  • Forum
  • Documents
  • Quiz
  • Events
  • Polls
  • Files
  • Members
  • Mentions
  • Sub-Groups
  • Tags
  • More
  • Cancel
  • New
Join Raspberry Pi to participate - click to join for free!
Featured Articles
Announcing Pi
Technical Specifications
Raspberry Pi FAQs
Win a Pi
Raspberry Pi Wishlist
Actions
  • Share
  • More
  • Cancel
Forum Thread Details
  • State Suggested Answer
  • Replies 2 replies
  • Answers 1 answer
  • Subscribers 674 subscribers
  • Views 689 views
  • Users 0 members are here
  • 3d printer
  • cnc control
  • python 3
  • human-machine_interface
  • raspberry_pi
  • raspberry pi
  • pi camera
  • ras pi
Related

Pi HMI with the Official 7" Touchscreen

bstache
bstache over 8 years ago

So I'm fairly new to the Raspberry Pi, never really dealt with Linux too much before, or a CLI operating system outside of like a Cisco enterprise switch or a few things when Windows gets cranky. I'm pretty fluent in basic code, ladder logic, C++, arduino's whatever-it-is, a TINY bit of Java, and whatever you call the mish-mash between C and assembly I used to program some PIC controllers. Anyway I'm fairly confident in learning some new things and designing something from scratch, but the Pi has me a little confused about a few things.

 

So ever since I was in the local vocational school I've had a thing for robotics and specifically CNC machinery, as using CNC, one can quickly and easily make MANY more things. So for awhile I've been wanting a CNC machine myself. So, being the enterprising and resourceful individual I like to tell myself I am I began listing parts and thinking of some designs for a machine. 3D printing is a obviously a hot new thing and having acess to a Stratasys printer at school was amazing, since gradating I miss having it for quick design for some machine/robot parts. So now I have a big box o' parts.

 

Now here's where things get a little tricky. The electronics out there for these custom or open-source printers. I have a RAMPS board with the smart controller that I intend to use for awhile, but ultimately a control systems upgrade will be necessary due to several features I have on my Printer, like a solenoid-latched door, key-switch controls lockout, lights, webcam streaming, etc. Here's where the Pi comes in. Now some things like Octoprint or Astroprint are cool, but they're specifically for 3D printing (I have an interchangeable head for PCB engraving, or even a laser at some point, dunno) and adding features they don't explicitly have built in is pretty daunting.

 

Obviously to work in real-time and achieve machine synchronization and accuracy, a "real-time" operating system must be used. So I'm thinking microCONTROLLER for that part, Arduino or PIC based since I have those resources. I may even stick to a RAMPS-style build for firmware compatibility at the beginning. The thing is, what these types of boards don't offer is a decent control interface ON the machine. Encoder/button combo with the LCD menus just isn't thrilling me all that much. Which got me looking at this touchscreen I bought on a whim with my Pi 2 that I never really touched. I realize this is a very extensive project that will most likely take a long long time.

 

I have a Pi 2 with the official 7" touchscreen and a Pi camera, compatible WiFi card, and portable m+kb combo thing. I also have a Windows-based computer if i need it for development or whatever. The goal of the project is to be an HMI and possibly G-Code interpreter for the microcontroller actually connected directly to the end hardware of a multipurpose CNC/3D printer. I'd like the Pi to have XYZ and extruder control buttons, switches for the lighting, door latch, or other outputs as well as status of things like the temperatures, prints, time to complete  parts, weight of plastic remaining on spool, i think you get it, as well as the ability to start and stop the G-Code jobs of the printer, with maybe a web-facing interface to upload jobs from my CAD/slicing PC. I'm thinking of using Python as the language to write in as a learning exercise in Python, which i have very little experience in. If this is an unreasonable thought, please let me know.

 

So my questions:

     The HMI GUI. I don't really need the overhead of running a whole desktop environment like Raspbian has shipped. Is there a way I can boot to CLI, autorun script, then my Python program take over and output its GUI? I don't require all the little bits the desktop environment has, because I'll only be running the one program.

 

Then, how do I actually program the GUI? I understand there are "toolkits" that allow you to make things like check boxes and icons and whatnot that you call within Python. Does this work even if I don't have the "desktop" environment? Does anyone have any recommendations?

 

Performance. Can I nuke features/processes/software from the Raspbian install (or build a bare-bones OS and install what I want) to maximize functionality without having a bunch of software I'll never use on there?

 

Webcam. How does one program to stream the webcam, or take pictures with it? I understand the drivers are available or included in Raspbian, but how would one program to encode and send or save that?

 

I think that'll do for starters. Thanks for reading, and in advance for any suggestions or help.

  • Sign in to reply
  • Cancel
  • shabaz
    0 shabaz over 8 years ago

    Hi Jeremy,

     

    There is a lot to discuss based on that, more than I can answer, but here is small bit of information to try to help.

    Generally you don't have to have a desktop environment, but then you're going to have to take control of all low-level graphical operations, or use applications specifically intended for such use. This is fine but means reinventing the wheel sometimes.

    Even if you have a desktop running, you can still make an application take up the entire screen (again, depends on the application). There is overhead to running a desktop, but perhaps a few percent of resources on the Pi (I have not checked).

    You can definitely stop or prevent processes from running if you don't want them, this could be optimization if you feel performance suffers for instance, or to close unwanted ports. You're only looking for response times of tens of milliseconds at best for a user interface

    possibly.

    I'm not familiar with Python but there are toolkits with Python APIs (e.g. pyQt according to google).

    It is also possible to have user interfaces in a web browser. Not the first choice for everyone, but I feel it gives flexibility. The choices are vast to be honest. It might need exploration and playing with demos/tutorials to see what you're comfortable with (for example I wouldn't use PyQt because I'm not familiar with Python, but for others it could be an excellent choice).

    For the camera, there are supplied command line applications as part of the Raspbian bundle for capturing images and saving to the file system. See here for how to do that in a command shell, or Python: https://www.raspberrypi.org/documentation/usage/camera/

    • Cancel
    • Vote Up +1 Vote Down
    • Sign in to reply
    • Verify Answer
    • Reject Answer
    • Cancel
  • bstache
    0 bstache over 8 years ago in reply to shabaz

    Ah, well, 90% of my programming experience has been on hardware such as Arduino, PIC controllers, PLCs, that sort of thing, where there's not really an OS in play and resources are either limited or inaccessible, so I'm not sure how much power I'd actually need for some of what I'd like to do. Thanks for the pointers. continue to research and figure some stuff out!

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Verify Answer
    • 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