General thoughts on (getting started with) HA (hassbian)

That means your image was bad. That image appears before everything even starts downloading.

But I downloaded a new image, wrote it to the SD card and tried again with the same result…?

I have another Pi - I’ll try again and report back.

@petro - I was just looking at the hass.io Getting Started page and saw that it talks exclusively about the Pi 3. My Pis are P1 2’s. Maybe that’s the problem? It also says, “Follow this guide if you want to easily get started with Home Assistant, or if you have no or little Linux experience.” I have lots of Linux experience - it’s my primary OS.

Yeah that might be it. I have little to no linux experience, which is why I switched to hass.io when it came out. It is limited but you don’t really have to putz with the OS in hass.io. It’s perfect for beginners and people who want to have a ‘hands off’ approach to home assistant.

It makes no difference 2 or 3. A pi 1 will be painfully slow, but a pi 2 or pi 3 (not b+) should be fine.

I’m quite comfortable with the OS. It’s HA that’s killing me. I’ll just stick with hassbian.

Those are messages posted by the listener after you subscribe to the topic.

What did you see in the putty session you used to publish a message to the topic?

You should have two instances of putty open, one subscribed and listening, one to publish.

you should have seen something like;

$ mosquitto_pub -d -u user -P pass -t "dev/test" -m "Hello world"
Client mosqpub/794-NUC sending CONNECT
Client mosqpub/794-NUC received CONNACK
Client mosqpub/794-NUC sending PUBLISH (d0, q0, r0, m1, 'dev/test', ... (11 bytes))
Client mosqpub/794-NUC sending DISCONNECT

then in the listener you should have seen something like:

$ mosquitto_sub -d -u user -P pass -t "dev/test"
Client mosqsub/533-NUC sending CONNECT
Client mosqsub/533-NUC received CONNACK
Client mosqsub/533-NUC sending SUBSCRIBE (Mid: 1, Topic: dev/test, QoS: 0)
Client mosqsub/533-NUC received SUBACK
Subscribed (mid: 1): 0
Client mosqsub/533-NUC received PUBLISH (d0, q0, r0, m0, 'dev/test', ... (11 bytes))
Hello world
Client mosqsub/533-NUC sending PINGREQ
Client mosqsub/533-NUC received PINGRESP
Client mosqsub/533-NUC sending PINGREQ
Client mosqsub/533-NUC received PINGRESP
Client mosqsub/533-NUC sending PINGREQ
Client mosqsub/533-NUC received PINGRESP
Client mosqsub/533-NUC sending PINGREQ
Client mosqsub/533-NUC received PINGRESP
Client mosqsub/533-NUC sending PINGREQ
Client mosqsub/533-NUC received PINGRESP
Client mosqsub/533-NUC sending PINGREQ
Client mosqsub/533-NUC received PINGRESP
Client mosqsub/533-NUC sending PINGREQ
Client mosqsub/533-NUC received PINGRESP
Client mosqsub/533-NUC sending PINGREQ
Client mosqsub/533-NUC received PINGRESP
Client mosqsub/533-NUC sending PINGREQ
Client mosqsub/533-NUC received PINGRESP

I think the PINGREQ & PINGRESP are just “keep alive” functions while you are subscribed to a topic and actively listening.

Weird. Yesterday I was able to authenticate/connect. Today I’m getting “Error: Connection refused”
I tried running systemctl status mosquitto.service and it returned

mosquitto.service - LSB: mosquitto MQTT v3.1 message broker
   Loaded: loaded (/etc/init.d/mosquitto; generated; vendor preset: enabled)                                              
   Active: active (exited) since Mon 2018-07-09 09:17:19 MST; 24h ago
     Docs: man:systemd-sysv-generator(8)                                                                                  
  Process: 332 ExecStart=/etc/init.d/mosquitto start (code=exited, status=0/SUCCESS)                                      
   CGroup: /system.slice/mosquitto.service                                                                                
                                                                                                                          
Jul 09 09:17:18 home-assistant systemd[1]: Starting LSB: mosquitto MQTT v3.1 message broker...                            
Jul 09 09:17:19 home-assistant mosquitto[332]: Starting network daemon:: mosquitto.                                       
Jul 09 09:17:19 home-assistant systemd[1]: Started LSB: mosquitto MQTT v3.1 message broker.   

I’m going to try restarting HA.

I restarted HA. Same result. SO confused! :persevere:

that is good that the service is running.

now…

open two instances of putty connected to the same pi.

in one use the subscribe command. you should see the connection responses from above.

in the other use the publish command. you should see in that one the responses above for the publisher and in the listener you should see it pop up with hello world then go back to listening as in the screen shot above.

What do you see in both instances if you do what I just said?

I hate to contradict, but this means the mosquitto service has exited, with a normal exit code - a running service is like this

$ systemctl status mosquitto.service 
● mosquitto.service - LSB: mosquitto MQTT v3.1 message broker
   Loaded: loaded (/etc/init.d/mosquitto; generated; vendor preset: enabled)
   Active: active (running) since Thu 2018-04-05 17:49:23 BST; 3 months 4 days a
     Docs: man:systemd-sysv-generator(8)
   CGroup: /system.slice/mosquitto.service
           └─281 /usr/sbin/mosquitto -c /etc/mosquitto/mosquitto.conf

Warning: Journal has been rotated since unit was started. Log output is incomple

It seems to have exited normally, but no indication why.

To restart mosquitto do

sudo systemctl restart mosquitto.service

once mosquitto is up and running, you can follow the instruction by @finity

mosquitto and HA are two independent programs, so starting one will not affect the other.

1 Like

oops… you’re right. I skimmed right over that and just saw “active”. That’s what I get for reading too quickly.

Thanks for the correction.