Where Are We At? (MQTTwrapper Class Demo)

(No library is wrapped...)

Go back to example list / Go to the repository of this example on GitHub

HOST (Where is the broker):

URL:
://:/

Preset ...

SEND (Behave as a publisher):

topic =
myname :

RECV (Behave as a subscriber):

topic =


Map (Pick up from the subscriber):

control:

The coordinate points will be pinned and drawn lines when the above subscriber receives them if the coordinate is formatted like the following.

plot lat lng name
lat
Latitude (real-number, -90≦lat≦90)
lng
Longitude (real-number, -180≦lng≦180)
name
the name of the point (option)

Or you can erase your pin by the following message.

erase name

"name" is the name of your pin. But the word "all" is the special one to erase all pins.

README (What is this?):

This is a control panel to try to use the MQTTwrapper class. This library makes your web browser an MQTT-over-WebSocket speaker. And then the protocol is very helpful to send/receive text data (also byte stream) from/to the UNIX stdin/stdout.

Only one simple application is required to connect to the stdin/stdout. That is "Mosquitto."

Try to use me by the following steps.

How to Use Me:

0-1) [PREP.] Install Mosquitto

The installation instructions are on this page.

0-2) [PREP.] Write the configuration for Mosquitto

Copy and save the following text as the file "mosquitto.local.conf" in your favor directory.

1) Start an MQTT broker

Type the following command on your UNIX terminal.

2) Connect me to the MQTT broker

In the "HOST" section, fill in the URL form (Specify "ws://localhost:8000/" to use the above MQTT broker, of course, it's OK to use another broker.) and push the "Connect" button. Then, wait for the button name to be "CONNECTED."

3) Start subscribing

Decide on the topic name in the "RECV" secion and type it into the "topicname" field. Then, push the "Start" button in the same section.

4) Publish your location

Write the same topic name as the one in the "RECV" section. Next, decide on the name of your pin and type it into the "myname" field. Finally, push the "Publish my location" button in the same section. Then you can see your pin on the map.

Or you can also publish the same plotting command from the publisher in the "SEND" section on this HTML. See the "Map" section for the command usage.