Making some progress.  I am back to having weewx running and I now have 
mosquito running as well.  I was able to test that service by mosquitto_sub 
and mosquitto_pub which worked by sending "hello world".  However when I 
check my local Belchertown page, it now says this at the top:

Failed connecting to the weather station. Please try again later! Last 
Updated 26 July 2024, 23:10:00

On Friday, July 26, 2024 at 2:02:17 PM UTC-4 M&M wrote:

> Oh thats right!  I edited the /etc/default/locales file.  I changed it 
> from en_GB.UTF-8 to en_US.UTF-8 since I was trying to fix the time in 
> Belchertown skin to show a 12h time format.  I believe I fixed it and for 
> some reason, i decided to edit the locales file.  I'll change that back 
> when I get to that system.
>
> Thanks.  I believe that is what will fix it.
>
> On Friday, July 26, 2024 at 12:17:42 PM UTC-4 vince wrote:
>
>>
>> https://stackoverflow.com/questions/14547631/python-locale-error-unsupported-locale-settling
>>
>> Have you messed with system locale at the os level or edited it in some 
>> weewx or mqtt config file ? There have been some skeletal reports about 
>> this over the years but I've never really understood the explanations.
>>
>> On Friday, July 26, 2024 at 3:41:42 AM UTC-7 Mark Jenks wrote:
>>
>>> Make sure MQTT is running correctly. You can test it via CLI.     This 
>>> page goes into configuring a cert, you can stop reading at that point.
>>>
>>>
>>> https://medium.com/gravio-edge-iot-platform/how-to-set-up-a-mosquitto-mqtt-broker-securely-using-client-certificates-82b2aaaef9c8
>>>
>>>
>>> On Thursday, July 25, 2024 at 10:27:54 PM UTC-5 M&M wrote:
>>>
>>>> Also I tried commenting out all of the MQTT lines in weewx.conf so that 
>>>> I could get the service running again but it isn't running at all.  Giving 
>>>> me the same error as I posted above.
>>>>
>>>> On Thursday, July 25, 2024 at 11:11:15 PM UTC-4 M&M wrote:
>>>>
>>>>> I'm getting closer.  Mosquito service is running but weewx gives me 
>>>>> the follow error in journalctl:
>>>>>
>>>>> Jul 25 22:59:55 raspberrypi weewxd[25852]: INFO __main__: Terminating 
>>>>> weewx version 5.0.2
>>>>> Jul 25 22:59:55 raspberrypi systemd[1]: weewx.service: Succeeded.
>>>>> Jul 25 22:59:55 raspberrypi systemd[1]: Stopped WeeWX.
>>>>> Jul 25 22:59:55 raspberrypi systemd[1]: weewx.service: Consumed 3h 
>>>>> 44min 13.462s CPU time.
>>>>> Jul 25 23:00:51 raspberrypi systemd[1]: Started WeeWX.
>>>>> Jul 25 23:00:53 raspberrypi weewxd[28347]: INFO __main__: Initializing 
>>>>> weewxd version 5.0.2
>>>>> Jul 25 23:00:53 raspberrypi weewxd[28347]: INFO __main__: Command 
>>>>> line: /usr/share/weewx/weewxd.py /etc/weewx/weewx.conf
>>>>> Jul 25 23:00:53 raspberrypi weewxd[28347]: Traceback (most recent call 
>>>>> last):
>>>>> Jul 25 23:00:53 raspberrypi weewxd[28347]:   File 
>>>>> "/usr/share/weewx/weewxd.py", line 265, in <module>
>>>>> Jul 25 23:00:53 raspberrypi weewxd[28347]:     main()
>>>>> Jul 25 23:00:53 raspberrypi weewxd[28347]:   File 
>>>>> "/usr/share/weewx/weewxd.py", line 107, in main
>>>>> Jul 25 23:00:53 raspberrypi weewxd[28347]:     weewx_root, user_module 
>>>>> = weeutil.startup.initialize(config_dict)
>>>>> Jul 25 23:00:53 raspberrypi weewxd[28347]:   File 
>>>>> "/usr/share/weewx/weeutil/startup.py", line 67, in initialize
>>>>> Jul 25 23:00:53 raspberrypi weewxd[28347]:     
>>>>> importlib.import_module('user.extensions')
>>>>> Jul 25 23:00:53 raspberrypi weewxd[28347]:   File 
>>>>> "/usr/lib/python3.9/importlib/__init__.py", line 127, in import_module
>>>>> Jul 25 23:00:53 raspberrypi weewxd[28347]:     return 
>>>>> _bootstrap._gcd_import(name[level:], package, level)
>>>>> Jul 25 23:00:53 raspberrypi weewxd[28347]:   File "<frozen 
>>>>> importlib._bootstrap>", line 1030, in _gcd_import
>>>>> Jul 25 23:00:53 raspberrypi weewxd[28347]:   File "<frozen 
>>>>> importlib._bootstrap>", line 1007, in _find_and_load
>>>>> Jul 25 23:00:53 raspberrypi weewxd[28347]:   File "<frozen 
>>>>> importlib._bootstrap>", line 986, in _find_and_load_unlocked
>>>>> Jul 25 23:00:53 raspberrypi weewxd[28347]:   File "<frozen 
>>>>> importlib._bootstrap>", line 680, in _load_unlocked
>>>>> Jul 25 23:00:53 raspberrypi weewxd[28347]:   File "<frozen 
>>>>> importlib._bootstrap_external>", line 790, in exec_module
>>>>> Jul 25 23:00:53 raspberrypi weewxd[28347]:   File "<frozen 
>>>>> importlib._bootstrap>", line 228, in _call_with_frames_removed
>>>>> Jul 25 23:00:53 raspberrypi weewxd[28347]:   File 
>>>>> "/etc/weewx/bin/user/extensions.py", line 18, in <module>
>>>>> Jul 25 23:00:53 raspberrypi weewxd[28347]:     
>>>>> locale.setlocale(locale.LC_ALL, '')
>>>>> Jul 25 23:00:53 raspberrypi weewxd[28347]:   File 
>>>>> "/usr/lib/python3.9/locale.py", line 610, in setlocale
>>>>> Jul 25 23:00:53 raspberrypi weewxd[28347]:     return 
>>>>> _setlocale(category, locale)
>>>>> Jul 25 23:00:53 raspberrypi weewxd[28347]: locale.Error: unsupported 
>>>>> locale setting
>>>>> Jul 25 23:00:53 raspberrypi systemd[1]: weewx.service: Main process 
>>>>> exited, code=exited, status=1/FAILURE
>>>>> Jul 25 23:00:53 raspberrypi systemd[1]: weewx.service: Failed with 
>>>>> result 'exit-code'.
>>>>> Jul 25 23:00:53 raspberrypi systemd[1]: weewx.service: Consumed 2.050s 
>>>>> CPU time.
>>>>>
>>>>> On Thursday, July 25, 2024 at 1:47:21 PM UTC-4 vince wrote:
>>>>>
>>>>>> Pat's docs are authoritative for Belchertown and the MQTT stuff looks 
>>>>>> ok to me.  Just follow that.
>>>>>>
>>>>>> https://github.com/weewx/weewx/wiki/mqtt has Tom's instructions for 
>>>>>> installing the MQTT extension.  You can check it at least minimally by 
>>>>>> running "weectl extension list" and it should show up in the list of 
>>>>>> installed extensions.
>>>>>>
>>>>>> Your config file stuff for weewx that you posted looked ok to me.
>>>>>>
>>>>>> On Thursday, July 25, 2024 at 9:54:13 AM UTC-7 M&M wrote:
>>>>>>
>>>>>>> That is correct that I have the MQTT installed as an extension for 
>>>>>>> weewx which is running on the pi.  I checked for a mqtt.service and I'm 
>>>>>>> not 
>>>>>>> seeing one on there.  I'm also not seeing a mosquitto_sub or pub 
>>>>>>> installed 
>>>>>>> so I think I must have missed anothe page to get this installed and 
>>>>>>> working.  From searching around right now, it looks like I need to 
>>>>>>> follow 
>>>>>>> this page:  
>>>>>>> https://obrienlabs.net/how-to-setup-your-own-mqtt-broker/
>>>>>>>
>>>>>>> I'm hoping to get this on a website that doesn't cost anything but 
>>>>>>> one step at a time.
>>>>>>>
>>>>>>> Am I on the right track?  
>>>>>>>
>>>>>>> On Wednesday, July 24, 2024 at 10:50:45 PM UTC-4 vince wrote:
>>>>>>>
>>>>>>>> Connection refused generally means the remote computer is not 
>>>>>>>> accepting incoming connections on that port.   It looks to me like you 
>>>>>>>> are 
>>>>>>>> trying to connect to the MQTT server on the same pi ?   Did you enable 
>>>>>>>> and 
>>>>>>>> start the MQTT server ?
>>>>>>>>
>>>>>>>> Did you test it with mosquitto_sub and mosquitto_pub to know that 
>>>>>>>> the MQTT server is working ok ?
>>>>>>>>
>>>>>>>> The authoritative belchertown docs are at 
>>>>>>>> https://github.com/poblabs/weewx-belchertown?tab=readme-ov-file#mqtt-and-mqtt-websockets-optional
>>>>>>>>  
>>>>>>>> if you haven't gone through them already.  Note that it has a 
>>>>>>>> prerequisite 
>>>>>>>> to install the MQTT extension which itself has prerequisite python 
>>>>>>>> modules.
>>>>>>>>
>>>>>>>> Test with mosquitto_sub/pub first to know your MQTT server is 
>>>>>>>> working as desired, then do the weewx part.
>>>>>>>>
>>>>>>>> On Wednesday, July 24, 2024 at 7:30:33 PM UTC-7 M&M wrote:
>>>>>>>>
>>>>>>>>> Somewhat of a new user here to Weewx.  I am running it on a 
>>>>>>>>> Raspberry Pi Zero W (192.168.0.196) and also installed the 
>>>>>>>>> Belchertown 
>>>>>>>>> skin.  I followed these steps (
>>>>>>>>> https://www.wxforum.net/index.php?topic=43377.0) to install and 
>>>>>>>>> configure MQTT but I'm running into some errors.  Here is what part 
>>>>>>>>> of my 
>>>>>>>>> weewx.conf file looks like for the MQTT stuff:
>>>>>>>>>
>>>>>>>>>     [[MQTT]]
>>>>>>>>>         server_url = mqtt://
>>>>>>>>> random_username:random_...@192.168.0.196:1883 
>>>>>>>>> <http://random_username:random_password@192.168.0.196:1883>
>>>>>>>>>         unit_system = US
>>>>>>>>>         topic = weather
>>>>>>>>>         binding = archive, loop
>>>>>>>>>         aggregation = aggregate
>>>>>>>>>
>>>>>>>>>     [[Belchertown]]
>>>>>>>>>         skin = Belchertown
>>>>>>>>>         HTML_ROOT = /var/www/html/weewx/belchertown
>>>>>>>>>         enable = true
>>>>>>>>>
>>>>>>>>>
>>>>>>>>>         [[[Extras]]]
>>>>>>>>>             #--- MQTT Websockets (for Real Time Streaming) Options 
>>>>>>>>> ---
>>>>>>>>>             mqtt_websockets_enabled = 1
>>>>>>>>>             mqtt_websockets_host = 192.168.0.x
>>>>>>>>>             mqtt_websockets_port = 9001
>>>>>>>>>             mqtt_websockets_ssl = 0
>>>>>>>>>             mqtt_websockets_topic = weather/loop
>>>>>>>>>
>>>>>>>>> I also added user.mqtt.MQTT to restful_services at the end of the 
>>>>>>>>> file.
>>>>>>>>>
>>>>>>>>> The error I'm seeing in journalctl is:
>>>>>>>>>
>>>>>>>>> Jul 24 22:16:40 raspberrypi weewxd[25776]: ERROR user.mqtt: Failed 
>>>>>>>>> to connect to MQTT server (mqtt://
>>>>>>>>> random_username:x...@192.168.0.196:1883 
>>>>>>>>> <http://random_username:xxx@192.168.0.196:1883>): [Errno 111] 
>>>>>>>>> Connection refused
>>>>>>>>> Jul 24 22:16:40 raspberrypi weewxd[25776]: ERROR weewx.restx: 
>>>>>>>>> MQTT: Failed to publish record 2024-07-24 22:15:00 EDT (1721873700): 
>>>>>>>>> MQTT 
>>>>>>>>> client not available
>>>>>>>>>
>>>>>>>>> Any ideas what I'm missing?
>>>>>>>>>
>>>>>>>>>
>>>>>>>>>
>>>>>>>>>
>>>>>>>>>
>>>>>>>>>

-- 
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/c8936c10-0b0f-439e-82d5-c1c83df09ab8n%40googlegroups.com.

Reply via email to