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

Mqtt support #80

Open
Logikjas opened this issue Jan 21, 2019 · 18 comments
Open

Mqtt support #80

Logikjas opened this issue Jan 21, 2019 · 18 comments
Labels
enhancement New feature or request

Comments

@Logikjas
Copy link

Thanks for the project. Is it possible to make this display other messages, like when my front door opens i get a notification on the marquee scroller, i would guess that it would need MQTT or IFTT support ?

@Qrome Qrome added the enhancement New feature or request label Jan 21, 2019
@moneybag
Copy link

moneybag commented Mar 2, 2019

i think nobody is able here to develop mqtt services

@Qrome
Copy link
Owner

Qrome commented Mar 2, 2019

Just not a priority.

@moneybag
Copy link

I dont know why. You could publish from a Homeautomation-System Data to the Display.
This would be great.

@davericher
Copy link

Not having MQTT in this makes it basically unusable, I recommend checking out http://www.esphome.io. I plan on writing a custom component to emulate this project in an actual home automation friendly framework in the coming month

@Qrome
Copy link
Owner

Qrome commented Apr 26, 2019

Sorry, you find it "basically unusable" -- I don't have any MQTT devices. You are very welcome to help contribute. Or any one.

@davericher
Copy link

There is no such thing has a 'MQTT' device, many people have suggested this to you. https://en.wikipedia.org/wiki/MQTT, your features are cool, I respect the work you are doing, but you are neglecting something that is an easy fix that would make some of your harder tasks significantly easier. I do plan on implementing it, just in another code base, actually, I will probably use a portion of your code for the display and scrolling to boot. What people have been trying to tell you is this project could go from cool to amazing with a few simple additions, but it seems you have not even bothered googling MQTT, which is my concern.

@davericher
Copy link

davericher commented Apr 26, 2019

tldr, I am not asking you to do this for me, or anyone else, I am suggesting you do it for yourself because it would make a thing you worked on even cooler for everyone including yourself. For example, rather than putting a lot of code on the ESP to pull news feeds, you could just have a script running on a computer somewhere else that pulls a shit ton of various feeds, aggregates them, fires off mqtt messages, that are then picked up by your marquee. You could also not have 3 different projects on the go, also you do have an MQTT 'device' if you are using Octoprint/Octopi since it also has an MQTT plugin you could hook into and 'listen' rather then 'poll'

@Qrome
Copy link
Owner

Qrome commented Apr 26, 2019

Yeah, I get it. This is an open source project -- Anyone may make a PR on it. Though it gets a bit tired when people do ask for "their" wish list items as if they are the only thing that would make this project usable.

I have used and played with NodeRed -- looked at the MQTT broker / subscription and client stuff. Sounds like a great addition -- but not everyone is running that stuff. Not saying it may have some future here.

@davericher
Copy link

Practical example:
1 - This one you are already doing a great job at, the time
2 - Octopi - You are polling on an interval, if you instead subscribed there would be no reason to poll, the information would be updated in real time per display cycle
3 - Pihole - They do not currently have a MQTT plugin, but I will 100% write one if you bring it in
4 - News aggregation - You are polling, and because of which you have to limit the amount of news pulled, otherwise there would an excessive amount of requests and memory consumed. There are plenty of solutions for this, personally, I would use home assistant to publish the MQTTmessage, but you could keep it even simpler with something like https://github.com/rcarmo/mqtt-feed-fetcher, this would not need to constantly poll and again could be subscription based, updating only when it needs to
5 - Real time custom messages, fire of a mqtt message, have it take priority on the marquee, could be used for things like alerts, alarms, etc etc

This is just a limited subset of potential applications,
But all of this would not even require you to drop your additional functionality, which works epically on a single device scale, I will not debate that, again the project is good. I think the misunderstanding here is that MQTT is for devices.

I am also not debating that rather than bitching I should just do this myself and submit a PR. if anything I am trying to sell you on the fact you have something neat, and we seem to have similar interests, you should totally check this shit out because you can make your already cool separate devices function as an epically cool collective.

@Qrome
Copy link
Owner

Qrome commented Apr 26, 2019

No debate. Not everyone is using or has the ability to setup MQTT.

Also, Pi-hole monitoring was added today version 2.12

IMG_20190425_201520

@davericher
Copy link

I also printed that same infinity picture thingy :P. If you set some kind of vision for optional flags I am willing to add it in, I do agree not everyone has MQTT, I am thinking we can use the more fun C++ and basically make it so if you do not have an MQTT server configured, the existing stuff works as is, but if you do specify one, some abstractions are swapped out and the ones that are not used do not get included in the compliation thus keeping the size down.

@Qrome
Copy link
Owner

Qrome commented Apr 26, 2019

I have been toying with the idea of abstractions in the compile. Part of it is, right now this thing makes a nice gift -- even to someone that does not know how to compile in Arduino or have a clue about the API keys. The vision for this is to be a Clock / News / Weather station. Easy setup with the web interface.

Perhaps there is room for a new MQTT version -- or abstracted in away that doesn't muddle it up for the non MQTT user.

@heyitsyang
Copy link

heyitsyang commented Jun 19, 2019

Assuming the feature desired is the ability to display test on the clock sent via MQTT, it can be implemented pretty passively so that folks not using MQTT can just ignore feature.

  • If there is no MQTT server defined or if a login to the server fails, then just log the error on serial & ignore as far as the clock is concerned
  • Need a place to define mqtt server URL, port number (default 1883), login, password
  • You'll also need a place to define the topic that the clock will be listening for - you can default to the host clock OTA name
  • If there is no MQTT traffic received, the callback function is never called, so nothing happens

@Dreamoffice
Copy link

Hi
MQTT support would be really great. i like this project, it is the best in the web for max7219 but mqtt is missing :-(

@zanyman24
Copy link

Hi thank you for starting this project. I am adding IFTTT support. If anyone wants to help me with it pls message me 2147145700.

@tg44
Copy link

tg44 commented Aug 3, 2020

I started to work on an MQTT-client implementation!
Here is my fork; https://github.com/tg44/marquee-scroller/tree/mqtt-fork

I started this with a cleanup, bcs I wanted to get all of the data from mqtt (besides the date/time, but I want to get those from ntp if its possible with timezones, or use an api which not need any api keys).

The current possible problems are;

  • if too much message came from the mqtt we can run out of memory
  • if too much message came from the mqtt we can print that long that we will timeout (aka disconnect) from mqtt
  • when the mqtt disconnects it not connects back yet

After I cleaned up my branch, I will probably write some agents for api->mqtt and mqtt->mqtt transformations so I will re-add the weather, octoprint, stock, crypto, yt-counter, twitter-follower, etc functionality as server-side components.

If you or anyone want this functionality here, I would start with the additions of this commit; https://github.com/tg44/marquee-scroller/commit/bd8cb99ca78f333cd4a0a74a2523f66e3933d861

@zanyman24
Copy link

cool stuff man! for disconnect did you try if (!mqtt.Enable)=> reconnect. I am very new to CPP. Do you have a set limit on the message memory?( Do you know when it overloads?)

@tg44
Copy link

tg44 commented Aug 4, 2020

I refactored the whole code-base, and rewrote a lot of parts. Fixed the looping problem (we disconnect bcs we are busy writing stuff to the screen).
I should test out the disconnect part, and also I have no coded memory limit, it will crash and restart if you mess it up :D (I don't think that is a valid problem in this use-case.)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

8 participants