Closed HoracioDos closed 5 years ago
What do you mean common problem? In that everyone is experiencing it or just you can't get past it?
You have told the skin to NOT use SSL. Update your skin option to use SSL.
mqtt_ssl = 1
You also should not subscribe to #
. Change that to be just the loop topic.
Hi. Please don't be mad at me. When I googled how to configure it with websockets I found that many people without enough knowledge is having trouble to make it work. Yes, As I can't get past it I humbly asked for help. There are not second intentions. Please keep in mind that english is not my mother language. Thanks for your help
Not mad at all.
I just wasn't sure if you meant the skin had a problem. I use it daily with websockets and don't have any problems. That's why I think the option you had set was wrong.
Hopefully you are working now!
Hello! I should have explained myself differently. I changed mqtt_topic = "weather/loop" and mqtt_ssl = 1 but I still can't connect. If I setup mosquitto to use plain websockets without TLS/SSL why should I set mqtt_ssl to 1? What I'm missing?
PS: I've added a port forward rule for 80 and 9001 in my router. Now I'm testing websockets with HiveMq test socket tool and it works fine but the skin still can't connect. I'm lost now.
Yes I think I am confused now.
mqtt_ssl = 1
. If you wish to use HiveMQ as your broker, look at this post on the forums from someone else using HiveMQ. It may help you.
If you wish to use localhost as your MQTT Websockets broker, download and install mqttadmin website and use that to connect to your websockets. Once you get that tool to work with your websockets, then the skin should start to work too.
Ok I think I understand more.
Your configuration is telling your Chrome browser to go to localhost for MQTT.
Chrome see's localhost is your PC and not the server.
You need this to be your server.
Also your Websockets is on port 80 now?
Change:
[[[Extras]]]
mqtt_enabled = 1
mqtt_host = "IP ADDRESS OF YOUR PI. LIKE 192.168.1.100"
mqtt_port = 80
Yes I think I am confused now.
- If you are using SSL/TLS. You need
mqtt_ssl = 1
.- If you are not using SSL/TLS, set it to 0.
If you wish to use HiveMQ as your broker, look at this post on the forums from someone else using HiveMQ. It may help you.
I used HiveMq because it was quicker for me to forward ports and try a small test. I already have a mosquitto broker running in a raspberry pi with some arduino clients doing silly stuff. By the way, your mosquitto install guide is excellent!
If you wish to use localhost as your MQTT Websockets broker, download and install mqttadmin website and use that to connect to your websockets. Once you get that tool to work with your websockets, then the skin should start to work too.
Good to know!!
Finally! You are the man!!! I've been chasing my tail for hours.
I swaped "localhost" for the internal ip address (192.x.x.x) in nginx site configuration and in weewx.conf (both places) and it works now. As I tried so many combinations I lost the track of them. mqtt_port is still 9001 just like mosquitto websockets setup. I don't know if it's ok for me to tell you that I made a small donation for coffee last night.
Thanks for all inconvenience
Thanks for the coffee! And I'm glad you got it working. Sorry I was confused earlier but I am glad you are working now!
Hello! I've installed your extension without problems but I can't make it work with websockets without SSL. It seems to be a common problem. Weewx V3.9.1 is running in a Raspberry Pi with Raspbian Stretch 9.6 Mosquitto Server is v3.1.1 and client V1.5.6
This is my config: weewx.conf
Nginx Site config.
sudo netstat -tulpn | grep -E '1883|9001'
Mosquitto Config
mosquitto_sub -h localhost -t weather/loop/# -u "user" -P "pwd" (output)
{"UV": "13.4687140864", "cloudbase_meter": "404.057634127", "outHumidity": "79.9993663432", "pressure_mbar": "1053.16600212", "rain_cm": "0.0", "barometer_mbar": "1053.16600212", "consBatteryVoltage_volt": "11.4897605947", "dewpoint_C": "-2.73389218279", "inTempBatteryStatus": "0.0", "rainBatteryStatus": "0.0", "windGust_kph": "0.000203954349963", "referenceVoltage_volt": "12.8755590251", "heatindex_C": "0.306093482847", "dayRain_cm": "0.508", "inDewpoint_C": "-0.511552874707", "outTempBatteryStatus": "0.0", "altimeter_mbar": "1055.96899606", "windchill_C": "0.306093482847", "appTemp_C": "-2.04603501469", "outTemp_C": "0.306093482847", "windGustDir": "359.996198059", "heatingVoltage_volt": "10.8612010464", "humidex_C": "0.306093482847", "rain24_cm": "0.508", "rxCheckPercent": "19.8511750505", "hourRain_cm": "0.0", "inTemp_C": "17.2224569074", "windSpeed_kph": "0.000169961958303", "usUnits": "16.0", "txBatteryStatus": "1.0", "windBatteryStatus": "0.0", "supplyVoltage_volt": "13.101027417", "rainRate_cm_per_hour": "0.0", "dateTime": "1550072698.0", "windDir": "359.996198059", "inHumidity": "29.9991551332", "radiation_Wpm2": "962.051006173"}