Since I called it out, I expected a pid file to be created, but it isn't.
Here's my current /etc/mosquito/mosquito.conf file:

# A full description of the configuration file is at
# /usr/share/doc/mosquitto/examples/mosquitto.conf.example

protocol mqtt
port 1883
allow_anonymous true
pid_file /var/run/mosquitto.pid
persistence true
persistence_location /var/lib/mosquitto/
log_dest file /var/log/mosquitto/mosquitto.log

On Tuesday, May 11, 2021 at 10:46:46 PM UTC-5 Eric Koester wrote:

> I'm working around the location of the mosquito.conf file by moving it to 
> where all the init.d files are looking for it - 
> /etc/mosquito/mosquitto.conf.
>
> After doing that, the service starts without errors.  See:
> weewx@Ubuntu20-WEEWX:/etc/rc0.d$ systemctl status mosquitto.service
> ● mosquitto.service - Mosquitto MQTT Broker
>      Loaded: loaded (/lib/systemd/system/mosquitto.service; enabled; 
> vendor preset: enabled)
>      Active: active (running) since Tue 2021-05-11 22:25:14 CDT; 7min ago
>        Docs: man:mosquitto.conf(5)
>              man:mosquitto(8)
>     Process: 7126 ExecStartPre=/bin/mkdir -m 740 -p /var/log/mosquitto 
> (code=exited, status=0/SUCCESS)
>     Process: 7127 ExecStartPre=/bin/chown mosquitto: /var/log/mosquitto 
> (code=exited, status=0/SUCCESS)
>    Main PID: 7128 (mosquitto)
>       Tasks: 1 (limit: 2310)
>      Memory: 2.2M
>      CGroup: /system.slice/mosquitto.service
>              └─7128 /usr/sbin/mosquitto -c /etc/mosquitto/mosquitto.conf
> weewx@Ubuntu20-WEEWX:/etc/rc0.d$ sudo systemctl status mosquitto.service
> ● mosquitto.service - Mosquitto MQTT Broker
>      Loaded: loaded (/lib/systemd/system/mosquitto.service; enabled; 
> vendor preset: enabled)
>      Active: active (running) since Tue 2021-05-11 22:25:14 CDT; 15min ago
>        Docs: man:mosquitto.conf(5)
>              man:mosquitto(8)
>     Process: 7126 ExecStartPre=/bin/mkdir -m 740 -p /var/log/mosquitto 
> (code=exited, status=0/SUCCESS)
>     Process: 7127 ExecStartPre=/bin/chown mosquitto: /var/log/mosquitto 
> (code=exited, status=0/SUCCESS)
>    Main PID: 7128 (mosquitto)
>       Tasks: 1 (limit: 2310)
>      Memory: 1.7M
>      CGroup: /system.slice/mosquitto.service
>              └─7128 /usr/sbin/mosquitto -c /etc/mosquitto/mosquitto.conf
>
> Strangely, I do NOT see a /var/run/mosquitto.pid file when it's running.
> Any idea why?
>
> On Tuesday, May 11, 2021 at 10:22:04 PM UTC-5 Eric Koester wrote:
>
>> On Tuesday, May 4, 2021 at 3:52:59 PM UTC-5 [email protected] wrote:
>>
>>> A few additional things to consider.
>>> From, https://tasmota.github.io/docs/BME280/, your json data is 
>>> ‘nested’. Meaning the incoming names in MQTTSubscribe will be 
>>> BME280_Pressure, BME280_Temperature, and BME280_Humidity. 
>>>
>>
>> What config file do you enter these incoming names into?
>>  
>>
>>> You will want to use the ‘ignore’ option for PressureUnit and TempUnit.
>>>
>>
>> What config file do you put the ignore option into?
>>  
>>
>>> Due to the way MQTTSubscribe handles date/time data, the Time field is a 
>>> bit more interesting. I would also ‘ignore’ it. This just means that 
>>> MQTTSubscribe will not try to check that the data is in the time interval 
>>> being processed by WeeWX. 
>>>
>>
>> What syntax do you use to tell it to ignore the date/time data?
>> In the same config file as the 2 previous?
>>   
>>
>>> Configuring MQTTSubscribe can be a bit daunting, so just shout with any 
>>> additional questions.
>>> rich
>>>
>>
>> I would bet I need to get mosquitto running properly before I start 
>> configuring MQTTSubscribe?
>> I installed mosquitto in the same Ubuntu 20 VM were WeeWX is running.
>> I loaded mosquito from the Ubuntu 20 deb repo with 'sudo apt install 
>> mosquitto'
>>
>> I used the example mosquitto.conf file 
>> (/usr/share/doc/mosquitto/examples/mosquitto.conf) to create a basic 
>> mosquitto.conf.
>> There is a README file in /etc/mosquitto/conf.d which says:
>> "Any files placed in this directory that have a .conf ending will be 
>> loaded as
>> config files by the broker. Use this to make your local config."
>> I believe this means that /etc/mosquitto/conf.d is the correct place for 
>> the mosquitto.conf file?
>>
>> Right now, I'm trying to get mosquitto to autostart as a daemon.  But 
>> it's not starting.
>> When I use the command 'sudo update-rc.d mosquitto defaults' it creates a 
>> bunch of files named K01mosquito in the /etc/rc.0...../etc/rc.6 directories.
>> I looked inside these files and it has the wrong location for 
>> mosquitto.conf file.
>>
>> See excerpt:
>> *start)*
>> *        if init_is_upstart; then*
>> *            exit 1*
>> *        fi*
>> *        log_daemon_msg "Starting network daemon:" "mosquitto"*
>> *        if start-stop-daemon --start --quiet --oknodo --background  
>> --make-pidfile --pidfile ${PIDFILE} --exec ${DAEMON} -- -c 
>> /etc/mosquitto/mosquitto.conf ; then*
>> *            log_end_msg 0*
>> *        else*
>> *            log_end_msg 1*
>> *        fi*
>> *        ;;*
>>
>> Why did the K01mosquitto files get created with the wrong .conf file 
>> location in them?
>> How do I fix that file location without manually editing all those 
>> auto-created /etc/rc.x/K01mosquitto files?
>>
>> Thanks,
>> Eric
>>  
>>
>>>
>>> On Tuesday, 4 May 2021 at 15:09:17 UTC-4 [email protected] wrote:
>>>
>>>> That does sound similar.  Thank you for that pointer!
>>>>
>>>> I want to get the Tasmota firmware to output MQTT messags containing 
>>>> the barometric pressure. 
>>>> Then, weewx would need to take in that MQTT message and assign the data 
>>>> to the stock 'barometer' variable from the database schema.
>>>>
>>>> On Tuesday, May 4, 2021 at 2:02:41 PM UTC-5 [email protected] wrote:
>>>>
>>>>> I have manage to get a weather station to be the main provider of data 
>>>>> to R-Pi based Weewx installation with add on data into the database 
>>>>> coming 
>>>>> from a sensor providing MQTT messages. If that it is similar to what you 
>>>>> are aiming for,  maybe this conversation can provide guidance 
>>>>> https://github.com/bellrichm/WeeWX-MQTTSubscribe/discussions/132
>>>>>
>>>>> On Tuesday, May 4, 2021 at 7:24:13 PM UTC+2 [email protected] wrote:
>>>>>
>>>>>> > DId you read
>>>>>> > https://github.com/bellrichm/WeeWX-MQTTSubscribe/wiki/Configuring
>>>>>>
>>>>>> No, I wanted to make sure MQTT was usable simultaneously with another 
>>>>>> weewx "driver", before I spent a lot of time on it.
>>>>>>
>>>>>> Thanks for the pointer to service vs. driver configuration!
>>>>>> I'll read through it.
>>>>>> On Tuesday, May 4, 2021 at 11:33:07 AM UTC-5 Greg Troxel wrote:
>>>>>>
>>>>>>>
>>>>>>> Eric Koester <[email protected]> writes: 
>>>>>>>
>>>>>>> > Thanks for the pointer, Peter. 
>>>>>>> > I looked through the install instructions and I don't see any 
>>>>>>> mention of 
>>>>>>> > the weewx.conf file. 
>>>>>>>
>>>>>>> DId you read 
>>>>>>>
>>>>>>> https://github.com/bellrichm/WeeWX-MQTTSubscribe/wiki/Configuring 
>>>>>>>
>>>>>>> Agreed that it doesn't say that it is talking about the config file. 
>>>>>>>
>>>>>>> A big point is driver vs service. It seems clear that you want 
>>>>>>> service, where MQTT input is secondary. 
>>>>>>>
>>>>>>>
>>>>>>>

-- 
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 [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/weewx-user/da9bbbd2-15f6-4587-a353-d37c1dcec3ben%40googlegroups.com.

Reply via email to