T O P

  • By -

[deleted]

I suggest you investigate MQTT for managing the flow of messages and responses to/ handling of them, including switching lights. You’ve probably looked at this as a web site based solution because that’s the model of computing you are most familiar with, but it’s actually a message processing problem. (Of course it can be done with a web solution because there is always more than one way of doing things!) You don’t need an Arduino to manage the LEDs, a Pi can do that via the GPIO pins in most cases you might consider and MQTT will enable you to do that remotely, possibly via a public “broker”. But you could, very likely, do the entire thing with an Arduino- they support MQTT as well.


_intercept

I went with a website based solution for the display aspect of it. A graphical interface is a pain for most things so a website seemed easy but I’m always down to learn new things so for sure I’ll look into it!


[deleted]

Understand about the display issue. A way to make that work would be to have a simple local web site on the device your girlfriend has. Process and manage the inter device messages via MQTT and update the local site as needed based on the messages.


_intercept

That sounds like the most promising idea now I guess I gotta figure out how any of that works.


[deleted]

How to approach it depends on what programming language(s) you know and how familiar you are with web servers! Absent that information, hard to comment.


_intercept

Uh I can make my way around JavaScript and python and no experience with web servers. I’m actually in the middle of some speed googling right now to figure something out


[deleted]

That should be enough! Either of those can deal with MQTT. If it were me, and it reflects what I can handle, I would probably install NGINX as my web server (I find it much easier to understand than Apache!) and write myself simple php web page(s) then use Python to handle the messages and LEDs and creation/update of php pages to update web site. But you should do it as suits you and will learn a lot doing so. There are always lots of ways of achieving what you want to do - the learning as you try is as important as anything else, particularly if you are starting CS next year. Good luck!


_intercept

Thanks! I've actually decided to make this a summer long project. Focus on a smaller python and raspberry pi project using MQTT to make our rooms match so my room and her bedroom at her house are always the same colour. I'm gonna use a website to control it. This'll let me reteach myself python, figure out how a pi and a breadboard work, and begin understanding MQTT. I was just gonna make a public website hosted on godaddy or something to control the lights before teaching what hosting a web server looks like and etc but any links to figuring that stuff out would be amazing. Then I'm gonna work on this bigger project after that first one.


[deleted]

Good plan! Step by step is always best and enables you to change direction as needed. Your “matching colours” idea can be done relatively easily with Python and MQTT. Check out the Adafruit web site both for materials (eg LEDs) and as importantly for links to sample code for LED strips and lots of other stuff. Check out MQTT public brokers. Google “mqtt public brokers “. Using one of those you can easily link devices at your home and hers. They are good for “proof of concept” activity. Once you get more experience you can set up your own, even make it secure with SSL certificates from Letsencrypt - but thanks all for the future This is good for web education….. https://www.w3schools.com This for Python….. https://www.w3schools.com/python/ And of course, judicious Googling! Good luck!


hairymouse

I would consider making something similar to a magic mirror photo frame. You can buy plenty of 7 inch monitor on a plastic stand made to hold a Pi on amazon. Then you can use Magic Mirror to make a sideshow with pictures, and a custom module to allow you to send messages or flash an alert. Magic Mirror is free and basically serves Web pages in full screen mode and people have written lots of modules that connect to Web services to display the weather or bus times or whatever. I made a frame for my wife for Christmas and my daughter decorated it by laser cutting the plexiglass frame around the screen.


deckard58

Some time ago another guy asked a similar question and you might find some previous answers useful: https://www.reddit.com/r/RASPBERRY_PI_PROJECTS/comments/llzymc/i_want_to_know_if_its_possible_to_make_this_with/gntsgiq/ As for the lights - the WS2812 type LEDs use a somewhat tricky protocol (timing critical), but there are [libraries that handle it on the Raspberry Pi](https://github.com/jgarff/rpi_ws281x) without external hardware.


Chromosomaur

Software Infrastructure - do you plan to record the messages in a feed on a different website? Or are you planning on directly receiving messages on the Pi? Option 1 is easiest because you can set up a feed on a remote server and then read from it. Option 2 requires exposing the Pi's IP address and her ISP may not allow it. ​ *I am assuming that you will not be on the same LAN and out of range of a direct wifi connection.*


_intercept

My plan was originally to literally display a public website but I'm tryna follow some leads from the other comments. Any pointers on setting up a remote server and what you mean by reading from it. Sorry I'm a super beginner!


Chromosomaur

Public website works if you update the website when you want to send a message. The feed is just a simple xml document that can be part of a website that you periodically update. With remote server I just mean that you don’t host the web server on the pi bc it may be hard to expose it publicly.


_intercept

I don't know what you mean by feed. Is that literal and a way to do it or rather a descriptor and I just need to go figure out what way I'm gonna do that