OK, I edited the /etc/mosquitto/mosquitto.conf so it is like your example: listener 1883 allow_anymous true
weewx@Ubuntu20-WEEWX:~$ sudo mosquitto -c /etc/mosquitto/mosquitto.conf 1640984047: Error: Unable to write pid file. weewx@Ubuntu20-WEEWX:~$ mosquitto -c /etc/mosquitto/mosquitto.conf 1640984054: Error: Unable to write pid file. weewx@Ubuntu20-WEEWX:~$ mosquitto 1640984406: mosquitto version 2.0.10 starting 1640984406: Using default config. 1640984406: Starting in local only mode. Connections will only be possible from clients running on this machine. 1640984406: Create a configuration file which defines a listener to allow remote access. 1640984406: For more details see https://mosquitto.org/documentation/authentication-methods/ 1640984406: Opening ipv4 listen socket on port 1883. 1640984406: Opening ipv6 listen socket on port 1883. 1640984406: mosquitto version 2.0.10 running 1640984413: New connection from 127.0.0.1:42095 on port 1883. 1640984413: New client connected from 127.0.0.1:42095 as MQTTSubscribe-5503 (p2, c1, k60, u'None'). 1640984418: Client MQTTSubscribe-5503 disconnected. On Friday, December 31, 2021 at 1:15:31 PM UTC-6 vince wrote: > On Friday, December 31, 2021 at 11:04:00 AM UTC-8 Eric K wrote: > >> This confirms that mosquitto 2.x requires passwords (where version 1.x >> does not). >> see: https://mosquitto.org/documentation/migrating-to-2-0/ >> > > No, it doesn't. > The example I posted worked fine either way. > > I ran it successfully with allow_anonymous and no user specified. > I also ran it with allow_anonymous=false and a user created and specified. > > > The password requirement appears to be the change that breaks my working >> mosquitto setup. >> > > Disagree. > > >> In Ubuntu 21.04 with mosquitto 2.0.10 using my config file for mosquitto >> 1.6.12: >> >> weewx@Ubuntu20-WEEWX:~$ mosquitto -c /etc/mosquitto/mosquitto.conf >> 1640977238: The 'port' option is now deprecated and will be removed in a >> future version. Please use 'listener' instead. >> 1640977238: Error: Unable to write pid file. >> >> > Unable to write pid file is because you are running something requiring > privileges as a unprivileged user 'weewx'. > Preface your command with "sudo". > You need mosquitto to start as root so it can bind to the privileged port > 1883. > > >> and using the default mosquitto config (not sure where it's finding that >> default file - no path is shown) >> >> > If you look at the mosquitto docs, it says it runs a default configuration > in the absence of a specified config file. > > weewx@Ubuntu20-WEEWX:~$ mosquitto >> 1640976300: mosquitto version 2.0.10 starting >> 1640976300: Using default config. >> 1640976300: Starting in local only mode. Connections will only be >> possible from clients running on this machine. >> 1640976300: Create a configuration file which defines a listener to allow >> remote access. >> > > Yes - in this case you didn't specify a config file so it runs > localhost-only for developer debugging purposes. > This is documented on their website. > > You want to read > https://projects.eclipse.org/projects/iot.mosquitto/releases/2.0 more > carefully. > It explains. > > And just go with the example I posted which definitely works. > > -- You received this message because you are subscribed to the Google Groups "weewx-user" group. To unsubscribe from this group and stop receiving emails from it, send an email to weewx-user+unsubscr...@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/weewx-user/858c26fb-654a-4658-9599-176d5080ded2n%40googlegroups.com.