Re: [mqtt] Can you help ... Simple web page that sends a topic and a number to RSMB

92 views
Skip to first unread message

Matteo Collina

unread,
Oct 3, 2012, 6:12:04 PM10/3/12
to mq...@googlegroups.com
Hi Gary,

I did a presentation last week that got some hype (thanks again, all of you):
I've built a MQTT broker just to do that kind of project, It may help you out.

There is a NetworkButton example in the site, and a thermostat example
in the slides. It's really easy, there is also some arduino code as example.
Anyway, here is the recipe.

On your Arduino:
  1. setup the PubSubClient with qest.me as a server.
  2. provide a callback to handle the message coming to Arduino.
  3. subscribe to the topic "gary/first-device".
On your webpage:
  1. Add a form which do a post to some node/php/ruby script.
  2. In that code, you do an HTTP PUT passing the parameter payload=yourmessage to http://qest.me/topics/gary/first-device.
And here you are.

Let me know if you have problems :).

Cheers,

Matteo

Alexandros Kritikos

unread,
Oct 4, 2012, 9:19:27 AM10/4/12
to mq...@googlegroups.com
Hi Gary,

We have released a blog post a few weeks ago that shows how to get an MQTT client interacting with a simple web page using the webMethods Nirvana Javascript API. This gives you web socket or various comet transports automatically based on the browser you use and its capabilities. Have a look at:

http://blog.my-channels.com/2012/10/04/how-to-build-a-web-interface-to-an-mqtt-device-with-nirvana/

Hope this helps,

Alex Kritikos
my-Channels (A Software AG company)

On Oct 4, 2012, at 12:50 AM, Gary B <gb.uk....@gmail.com> wrote:

Hi,

New to MQTT and at the moment I have an Arduino communicating with RSMB succesfully.

I now want to create a very simple webapge as a test, that has a text box that i can enter a number and sends it to a topic "Data_In" on RSMB  and a number, as an example 20.

Hopefully this isn't too hard, but I have spent hours on the internet but cannot find an example of how to achieve this, although I did find one using websockets but I could not find out exactly how this would be carried out in a webpage.

So I am asking here for any help as I really do want to get MQTT to control my Boiler and Thermostat as a start to my project.

Thanks

Regards

Gary



--
--
To learn more about MQTT please visit http://mqtt.org
 
To post to this group, send email to mq...@googlegroups.com
To unsubscribe from this group, send email to
mqtt+uns...@googlegroups.com
 
For more options, visit this group at
http://groups.google.com/group/mqtt
 
 
 

Alexandros Kritikos

unread,
Oct 4, 2012, 9:24:08 AM10/4/12
to mq...@googlegroups.com

Alex Kritikos
my-Channels (A Software AG company)

Andy Piper

unread,
Oct 4, 2012, 3:44:46 PM10/4/12
to mq...@googlegroups.com
Have you looked at http://mqtt.io - should do what you want?

-- 
Andy Piper
Sent with Sparrow

Alexandros Kritikos

unread,
Oct 5, 2012, 1:24:51 AM10/5/12
to mq...@googlegroups.com
You can also point the mqtt.io web page to the Nirvana realm / topic as described in our blog post and see different clients and protocols interoperate. 

Alex Kritikos
my-Channels (A Software AG company)
Reply all
Reply to author
Forward
0 new messages