-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathindex.html
149 lines (144 loc) · 6.76 KB
/
index.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
<html><head><meta charset="utf-8" /><meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" /><meta name="description" content="" />
<meta name="author" content="Maxim Sokhatsky" /><title>MQ</title>
<link rel="stylesheet" href="https://n2o.dev/blank.css" />
<link rel="stylesheet" href="https://n2o.dev/zima.css" />
</head><body><nav>
<a href="https://n2o.space">SPACE</a>
<a href="https://mq.n2o.space" style="background:#ededed;">MQ</a>
</nav><header>
<a href="https://github.com/enterprizing/mq"><img src="https://synrc.space/images/Synrc Neo.svg?v=1" /></a>
<h1>MQ</h1>
</header><aside>
<article>
<section>
<h3>SYNOPSIS</h3>
<div>MQ is the SYNRC packeged version of EMQ 2.1.2 message broker.
It consists of four applications: <b>esockd</b>,
<b>emqttd</b>, <b>emq_dashboard</b>, <b>mochiweb</b>.
</div>
</section>
</article>
</aside><main>
<section>
<a name="dash"></a><h3>N2O as EMQ plugin</h3>
<p>
The N2O over MQTT bridge is a drop-in plugin for EMQ broker.
After starting the server you should enable N2O over MQTT bridge EMQ plugin on plugin page
<a href="http://127.0.0.1:18083/#/plugins">http://127.0.0.1:18083/#/plugins</a> and then open the application sample
<a href="http://127.0.0.1:8000/spa/login.htm">http://127.0.0.1:8000/spa/login.htm</a>
</p>
<figure>
<figcaption>Picture 4. N2O 4.5 MQTT as EMQ Plugin</figcaption>
<img src="https://n2o.space/img/emq.png" />
</figure>
<p>
The nice thing about EMQ is that it enables session introspection for N2O connections.
The EMQ Dashboards is written in vue.js and a bit complex for admin application.
The possible and expecting hackaton is on rewriting EMQ admin with <b>hyperapp</b> and <b>n2o</b>.
The IBM library Paho is also too old and fat to fit N2O sizes. Some parts should be replaced
with more modern and compact pinger and connection respawning from <b>n2o.js</b>. This is
expecting further research and imporevement.
</p>
</section>
<section>
<a></a><h3>MQTT versions</h3>
<p>
EMQ is the latest software that has robust iOS and Android MQTT client libraries, just have a look at
<a href="https://github.com/emqtt">https://github.com/emqtt</a> Github organization.
</p>
<figure>
<figcaption>Picture 6. MQTT 3.1.1 vs MQTT 5.0</figcaption>
<img src="https://n2o.space/img/mqtt-v5.svg" />
</figure>
<p>
We made a compatible EMQ plugin and N2O Review sample application with built-in EMQ with minimal dependencies.
Our fork is based on the latest EMQ master and is dedicated for building with our MAD build tool.
</p>
<figure>
<figcaption>Listing 6. Setup MQTT flavoured N2O.</figcaption>
<code>
$ brew install erlang
$ curl -fsSL https://raw.github.com/synrc/mad/master/mad > mad \
&& chmod +x mad \
&& sudo cp mad /usr/local/bin
$ git clone git://github.com/voxoz/mq && cd mq
$ time mad dep com
Writing /apps/review/ebin/review.app
OK
real 1m45.357s
user 0m17.166s
sys 0m5.065s
$ mad rep
Configuration: [{n2o,
[{port,8000},
{app,review},
{pickler,n2o_secret},
{formatter,bert},
{log_modules,config},
{log_level,config}]},
{emq_dashboard,
[{listeners_dash,
[{http,18083,[{acceptors,4},{max_clients,512}]}]}]},
{emqttd,
[{listeners,
[{http,8083,[{acceptors,4},{max_clients,512}]},
{tcp,1883,[{acceptors,4},{max_clients,512}]}]},
{sysmon,
[{long_gc,false},
{long_schedule,240},
{large_heap,8000000},
{busy_port,false},
{busy_dist_port,true}]},
{session,
[{upgrade_qos,off},
{max_inflight,32},
{retry_interval,20},
{max_awaiting_rel,100},
{await_rel_timeout,20},
{enable_stats,off}]},
{queue,[]},
{allow_anonymous,true},
{protocol,
[{max_clientid_len,1024},{max_packet_size,64000}]},
{acl_file,"etc/acl.conf"},
{plugins_etc_dir,"etc/plugins/"},
{plugins_loaded_file,"etc/loaded_plugins"},
{pubsub,
[{pool_size,8},{by_clientid,true},{async,true}]}]},
{kvs,
[{dba,store_mnesia},
{schema,[kvs_user,kvs_acl,kvs_feed,kvs_subscription]}]}]
Applications: [kernel,stdlib,gproc,lager_syslog,pbkdf2,asn1,fs,ranch,mnesia,
compiler,inets,crypto,syntax_tools,xmerl,gen_logger,esockd,
cowlib,goldrush,public_key,lager,ssl,cowboy,mochiweb,emqttd,
erlydtl,kvs,mad,emqttc,nitro,rest,sh,syslog,review]
Erlang/OTP 19 [erts-8.3] [source] [64-bit] [smp:4:4]
[async-threads:10] [hipe] [kernel-poll:false] [dtrace]
Eshell V8.3 (abort with ^G)
starting emqttd on node 'nonode@nohost'
Nonexistent: []
Plugins: [{mqtt_plugin,emq_auth_username,"2.1.1",
"Authentication with Username/Password",false},
{mqtt_plugin,emq_dashboard,"2.1.1","EMQ Web Dashboard",false},
{mqtt_plugin,emq_modules,"2.1.1","EMQ Modules",false},
{mqtt_plugin,n2o,"4.5-mqtt","N2O Server",false}]
Names: [emq_dashboard,n2o]
dashboard:http listen on 0.0.0.0:18083 with 4 acceptors.
Async Start Attempt {handler,"timer",n2o,system,n2o,[],[]}
Proc Init: init
mqtt:ws listen on 0.0.0.0:8083 with 4 acceptors.
mqtt:tcp listen on 0.0.0.0:1883 with 4 acceptors.
emqttd 2.1.1 is running now
>
</code>
</figure>
</section>
<section>
<a name="plugin"></a><h3>Related Documents</h3>
<div>
<ul><li><a href="https://n2o.dev/articles/n2o.htm">N2O: PROTOCOL</a></li><li><a href="https://n2o.dev/articles/web.htm">N2O: SERVER</a></li><li><a href="https://n2o.dev/articles/history.htm">N2O: HISTORY</a></li><li><a href="https://5ht.co/spawnproc.htm">N2O: PRIVATBANK</a></li></ul></div>
</section>
</main><footer>
Made with <span class="heart">❤</span> for EMQ and N2O
</footer></body></html>