hneemann / Digital

A digital logic designer and circuit simulator.
GNU General Public License v3.0
4.39k stars 441 forks source link

Feature Request: MQTT component #494

Open lnetwalker opened 4 years ago

lnetwalker commented 4 years ago

I would like to see a number of devices which just represent MQTT values. For example a output device which publishes its values to MQTT or a input device which take MQTT values and puts them in my cirquit. With these devices it would be very easy to connect real hardware to simulated circuits. I looked at the sources but my Java knowledge is far too basic to do it by myself. Anybody out there who is able and willing to give this idea a chance ?

hneemann commented 4 years ago

A MQTT component is very easy to implement bacause of the Paho project. There is already a UART plugin which can be use as a base for a MQTT integration. If you describe in more detail what you need, it will be easy to implement.

lnetwalker commented 4 years ago

Thanks for your attention on my suggestion. In the simplest case there would be Inputs and Outputs ( like Buttons and LEDs ) which are connected to MQTT topics. Inputs represent the subscription of a topic, outputs publish their state to topics. In the first step the allowed values ( payload ) for the topics are 0 and 1. In a more sophisticated szenario it could be possible to have something like a regex which extracts values from a payload. I can support this with testing, writing documentation in German and English.

fazerlab commented 3 years ago

With MQTT we can integrated Digital with other tools in software and hardware. I endorse and desire this enhancement. Anyway Digital is a great tool that i used with my students . Thank you.

lnetwalker commented 3 years ago

is there a chance that MQTT is added ? I'm willing to help whereever I can.

hneemann commented 3 years ago

To be honest, I don't think that MQTT will be implemented as part of Digital. This is more suitable to be implemented as a jar component in a separate project, similar to the serial port integration.

jorge-agra commented 3 years ago

Hi. Made a try on this, very raw and in initial stages, since I stumbled on this amazing project at the same time I was looking to MQTT.

You can check and eventually try my first attempt in: https://github.com/jorge-agra/digital-custom-component-mqtt

Just a basic MQTT send component, please exercise some forgiveness :)

Best. JA

lnetwalker commented 3 years ago

Hi, until now I was busy and had no time to check it out, but it seems very promising. Can I download a compiled jar anywhere to check it out ? ( I have currently no development Env )

jorge-agra commented 3 years ago

Hi. Created a jar of it, and added some instructions on how to use it from Digital. Needed some tweaking to be able to load the plugin and the paho client lib.

Good luck using it, you will probably need it :)

Contact me if you need help.

Best.