Open minnican opened 4 years ago
Hi, Mosquitto is exactly the same MQTT server I am using, so you should be fine. For a topic, you can use whatever makes sense in your environment. I used "sternwarte/allskyheating" because I have several devices in my observatory (i.e. "Sternwarte" in German) that are controlled via MQTT. So if I subscribe to "sternwarte/#" I can monitor all devices there with one subscription.
I am trying to explain a little more in detail:
mqclient.subscribe("sternwarte/allskyheating/#")
<- subscribe to this topic "sternwarte/allskyheating"
def on_message(client, userdata, msg):
m = msg.topic.split("/")
<- split the topic into an array, separator is /
global heating_state
if m[1] == "allskyheating":
<- m[0] would be "sternwarte
m[1] would be "allskyheating"
So if you have topic like "allskyheating" (with no / in the string), you would subscribe to "allskyheating/#" and the if-statement would look like this:
if m[0] == "allskyheating":
The payload can stay "on" and "off" as long as you are sending these as the payload.
N.B. I would try to avoid any white spaces in the topic - not sure whether all MQTT clients & servers support this but better to be safe than sorry.
Thank you for taking the time to reply. I've managed, as I said before, to communicate between my windows laptop and the raspberry pi using Mosquitto but I really can't get your service to work and I have not figured out why? However, for me I have found a very easy solution for turning Pin 11 on and off on the Raspberry Pi and therefore switching on the heating circuit. I've signed up with Cayenne, an online dashboard for controlling IoT devices. There is a section on the dashboard to control the GPIO pins. I can simply click Pin 11 on from anywhere. So once again thanks for your help and your circuit design that I'm now using on my Allsky Camera.
Hello I have just installed the system on my raspberry. But I don't understand how to make it work. Tell you about mqtt commands but I don't know. Could you explain me please thank you so much
Hello I am still trying to get mqtt to work I still don’t understand. I have been trying for 3 weeks I am desperate I have install MQTT on windows 10, but I don't know how it works. On the raspberry how to do for the file allskyheating.py jr does not understand. Thank you very much for your help.
Bonjour je suis toujours en train d’essayer a faire fonctionner mqtt je ne comprend toujours pas . j'essaye depuis 3 semaines je désespère J'ai installer MQTT sur windows 10, mais je ne sais pas comment ça fonctionne. Sur le raspberry comment faut il faire pour le fichier allskyheating.py jr ne comprend pas. merci beaucoup de votre aide.
If you want to learn about how MQTT works, see this great tutorial: https://learn.sparkfun.com/tutorials/introduction-to-mqtt/all
With that, you can follow along the my comments from July 6 (see above). I hope this will help.
Just a small comment from my side. You could avoid using a relay which takes current on its own and is a bit bulky. I am using a N-MOSFET transistor (IRLML6244) to switch the ground connection of the resistors and connect the other side of the resistors to VCC. This is a much smaller and cheaper solution than using a relay and you could directly add it to the breadboard. It also saves the power to switch the relay. I like the idea using MQTT to control it.
Hi @hdiessner
Thanks to share this, this is what i'm looking for actually to realize my heater.
Just few questions:
Thanks you !!
Oh I never measured the temperature or the speed as the dome is mounted on top of my observatory and difficult to reach. My only "measurement" was checking whether or not the acrylic dome has dew. During fall & winter, when I enable the heating at sunset, the dome stays free of dew so I never had to tinker with temperature measurement or more resistors.
My dome is an acrylic half-sphere with 10cm (4 inch) diameter.
Number of resistors could be increased or decreased as necessary - I found 6 resistors were a good balance between enough heat and low energy consumption. If you add too many resistors, the amperes required might be too high for the cable or power supply you are using and you don't want the cam to catch fire if it gets too hot. If you really need more heat, you also might consider buying a ready-made dew heater for lenses and re-purpose it for the dome cam.
Thanks for the reply First It is gaving good idea for relay.
Note that you can also use ceramic resistances for better heat dissipation.
Second you have demonstrated that you can heat with 5 volts. Many personns use 12 volts separated from the pi.
I use a small fan (30mm) and the heating of the Pi to warm up the dome. Works well so far -------- Ursprüngliche Nachricht --------Von: troublestarter @.> Datum: 17.09.23 20:40 (GMT+01:00) An: hdiessner/Allskycam-heating @.> Cc: GanymedRN @.>, Comment @.> Betreff: Re: [hdiessner/Allskycam-heating] I really want to use this but.... (#2) Thanks for the reply First It is gaving good idea for relay. Note that you can also use ceramic resistances for better heat dissipation. Second you have demonstrated that you can heat with 5 volts. Many personns use 12 volts separated from the pi.
—Reply to this email directly, view it on GitHub, or unsubscribe.You are receiving this because you commented.Message ID: @.***>
Hi and thanks for your project.
I'm afraid I'm not very good at programming the raspberry pi yet and even though I've read your instructions 100 times I still can't figure out the customisation of the allskyheating.py file.
So to try and get familiar I managed to install Mosquitto on my Windows 10 system and I can get a message sent from there to the raspberry pi. However, I'm not sure whether Mosquitto is the same as MQTT you are using.
The server I'm using for Mosquitto is "SimonLaptop" so I think I just add this to line 49.
I'm not sure about the name for a topic and how to correctly add it to the file. I see yours is " /sternwarte/allskyheating/#" but I don't understand this path and why you have used just "allskyheating" on line 29.
For my Mosquitto test I'm using the topic "New Subject". I use the command mosquitto_sub -h SimonLaptop -t "New Subject"
On the raspberry pi I use this mosquitto_sub -h SimonLaptop -t "New Subject"
To send a message I type mosquitto_pub -h SimonLaptop -t "New Subject" -m "Testing allskyheating"
And this appears on the raspberry pi terminal "Testing allskyheating"
Finally, I presume I can leave "on" and "off" as they are if they are the commands I "publish" to the "topic"?
Is there anyway you could break this down for me a little more please?
Thanks.