kevinstoddart7
Posts: 1
Joined: Sun Jun 07, 2020 11:24 pm

Sending images and emails through network with GPIO

Mon Jun 08, 2020 12:07 am

Hi, I'm pretty new to all of this but I'm trying to get into a project where I have a main raspberry Pi and multiple 'slave' Pi's. My aim is to press a button connected to the main Pi that would send a Jpeg image to a particular Pi that it was connected to within a network. Simultaneously sending a pre determined email. The image to load on full screen to the slave Pi untill another image was sent.

The long goal here would eventually to have multiple buttons sending different images to different slave pi's and possibly sending audio as well.

I may be setting my sights too high for a 1st project but I like the challenge! Just looking for some pointers to get me started.

Thanks for any help in advance!

User avatar
penguintutor
Posts: 386
Joined: Tue May 08, 2012 9:11 am
Location: UK
Contact: Website

Re: Sending images and emails through network with GPIO

Mon Jun 08, 2020 7:03 am

There are different ways you could implement this.

You will need a program monitoring for the button press. Python and gpiozero would work well.

There are lots of guides online about sending an email from Python.

The image could be transferred using SSH, http (if you ran a web server), FTP or you could use a remote filesystem like NFS / samba.
I'd suggest looking at using SSH using scp with key based authentication.

To have the remote computer update it's display, it could either periodically check for a new file, or you could issue a command remotely using SSH.

User avatar
thagrol
Posts: 2961
Joined: Fri Jan 13, 2012 4:41 pm
Location: Darkest Somerset, UK
Contact: Website

Re: Sending images and emails through network with GPIO

Mon Jun 08, 2020 6:12 pm

Assuming all Pi will be on the same network I'd consider doing it on one of these ways:
    • Put all the audio and images on a server this can be the main Pi
    • Add an MQTT broker to that.
    • Add software to monitor the buttons (hint: callback are more efficient than polling) and send appropriate MQTT messages.
    • Have the slaves listen for the messages then pull the image/audio from the server and display them.
    • Put all the audio and images on a server this can be the main Pi
    • Have it running the pigpio daemon set up to allow remote gpio access
    • Run a script on each slave to monitor buttons on the master via the remote gpio functionality.

If the network is wired rather than wireless I'd give serious though to netbooting the slaves doing so will make maintenance easier.
Attempts to contact me outside of these forums will be ignored unless signed in triplicate, sent in, sent back, queried, lost, found, subjected to public enquiry, lost again, and finally buried in soft peat for three months and recycled as firelighters

Return to “Beginners”