mqtt and Apache and mod_websocket_mosquitto
Moderators: Digit, Rene, Willem4ever, Bwired
mqtt and Apache and mod_websocket_mosquitto
Hi,
After thinking about node.js I also want to try apache with mosquito.
I followed the instructions and compiled from willems github site
https://github.com/willem4ever/mod_websocket_mosquitto
Everything compiled ok and I can enable the module.
But how can I check if it works? I don't know how to write a simple html as subscriber to display the messages. I use the matt.html, but gives nothing
http://www.kroonen.eu/mqtt/mosq.html
Any idea where I can check things and to configure in html
regards Richard
After thinking about node.js I also want to try apache with mosquito.
I followed the instructions and compiled from willems github site
https://github.com/willem4ever/mod_websocket_mosquitto
Everything compiled ok and I can enable the module.
But how can I check if it works? I don't know how to write a simple html as subscriber to display the messages. I use the matt.html, but gives nothing
http://www.kroonen.eu/mqtt/mosq.html
Any idea where I can check things and to configure in html
regards Richard
Re: mqtt and Apache and mod_websocket_mosquitto
Hi,
I can connect, but no messages receive and after a short who I get this socket read error, any ideas
root@fitpc2:/var/www/mqtt# mosquitto
1392843363: Warning: Mosquitto should not be run as root/administrator.
1392843363: mosquitto version 0.15 (build date 2012-12-29 18:54:18+0000) starting
1392843363: Opening ipv4 listen socket on port 1883.
1392843363: Opening ipv6 listen socket on port 1883.
1392843368: New connection from 127.0.0.1.
1392843368: New client connected from 127.0.0.1 as mjsws/bJjY2KolxGTwlX.
1392843380: New connection from 127.0.0.1.
1392843380: New client connected from 127.0.0.1 as mosq_pub_4194_fitpc2.
1392843388: Socket read error on client mjsws/bJjY2KolxGTwlX, disconnecting.
1392843393: New connection from 127.0.0.1.
1392843393: New client connected from 127.0.0.1 as mjsws/SclqIi2HtMCEVG.
1392843395: New connection from 127.0.0.1.
1392843395: New client connected from 127.0.0.1 as mjsws/IdZ2UNUtq6aEnO.
1392843406: Socket read error on client mjsws/IdZ2UNUtq6aEnO, disconnecting.
I can connect, but no messages receive and after a short who I get this socket read error, any ideas
root@fitpc2:/var/www/mqtt# mosquitto
1392843363: Warning: Mosquitto should not be run as root/administrator.
1392843363: mosquitto version 0.15 (build date 2012-12-29 18:54:18+0000) starting
1392843363: Opening ipv4 listen socket on port 1883.
1392843363: Opening ipv6 listen socket on port 1883.
1392843368: New connection from 127.0.0.1.
1392843368: New client connected from 127.0.0.1 as mjsws/bJjY2KolxGTwlX.
1392843380: New connection from 127.0.0.1.
1392843380: New client connected from 127.0.0.1 as mosq_pub_4194_fitpc2.
1392843388: Socket read error on client mjsws/bJjY2KolxGTwlX, disconnecting.
1392843393: New connection from 127.0.0.1.
1392843393: New client connected from 127.0.0.1 as mjsws/SclqIi2HtMCEVG.
1392843395: New connection from 127.0.0.1.
1392843395: New client connected from 127.0.0.1 as mjsws/IdZ2UNUtq6aEnO.
1392843406: Socket read error on client mjsws/IdZ2UNUtq6aEnO, disconnecting.
Re: mqtt and Apache and mod_websocket_mosquitto
It looks like the mosq.html is not fine.
If someone has a small html code how to have a subscribed something so I can use it.
regards Richard
If someone has a small html code how to have a subscribed something so I can use it.
regards Richard
Re: mqtt and Apache and mod_websocket_mosquitto
Have you checked the Apache logs, any strange messages in there?
Re: mqtt and Apache and mod_websocket_mosquitto
Robert
No errrors in log from apache.
Have youj som html code to test?
regards Richard
No errrors in log from apache.
Have youj som html code to test?
regards Richard
Re: mqtt and Apache and mod_websocket_mosquitto
We are not using apache as a webserver, i think Willem is the only one, but not sure.....
Re: mqtt and Apache and mod_websocket_mosquitto
Richard,
Even better, a live example:
http://www.hekkers.net/domotica/Smartmeter.aspx
The interesting part for you starts at line 324 (view source).
This example works with Apache and Willem's module.
If you need more info just let me know.
Even better, a live example:
http://www.hekkers.net/domotica/Smartmeter.aspx
The interesting part for you starts at line 324 (view source).
This example works with Apache and Willem's module.
If you need more info just let me know.
Re: mqtt and Apache and mod_websocket_mosquitto
Hi,
Thnx for the code.
I still gets disconnected, the browser session is disconnected with socket error after in exact 60 sec.
So it looks like a timer somewhere?
http://www.kroonen.eu/temp/meter.html
Richard
Thnx for the code.
I still gets disconnected, the browser session is disconnected with socket error after in exact 60 sec.
So it looks like a timer somewhere?
http://www.kroonen.eu/temp/meter.html
Richard
- RDNZL
- Forum Moderator
- Posts: 1008
- Joined: Sun Sep 24, 2006 1:45 pm
- Location: Dordrecht, The Netherlands
- Contact:
Re: mqtt and Apache and mod_websocket_mosquitto
If you use Apache, try this:
So you can test if it's a Apache wait time out, if this solves it, enable it again an try too play with values, otherwise you make Apache more vulnerable for ddos attacks..
Code: Select all
$ sudo a2dismod reqtimeout
$ sudo service apache2 restart
Regards, Ron.
Re: mqtt and Apache and mod_websocket_mosquitto
Richard,
I get this, does this mean it's working?
I get this, does this mean it's working?
Re: mqtt and Apache and mod_websocket_mosquitto
Ron,
That solves it. thnx
@Robert,
Now te values are now better. Ialalalla
regards Richard
That solves it. thnx
@Robert,
Now te values are now better. Ialalalla
regards Richard
Re: mqtt and Apache and mod_websocket_mosquitto
@robert,
You have also value total power usage. I think it's the normal + low tariff.
How do I did you write it in node.js, within the smartmeter.js that reads de p1 meter
regards Richard
You have also value total power usage. I think it's the normal + low tariff.
How do I did you write it in node.js, within the smartmeter.js that reads de p1 meter
regards Richard