Appearance
MOKO MKGW Bluetooth gateways
MOKO's Wi-Fi and cellular Bluetooth gateways — the MKGW-mini, MK107 and MKGW1/3 — are set up from MOKO's MKScannerPro phone app rather than a web page, and publish to Omaya in the generic gateway format.
What you do in Omaya
Before you start
- Where it will hang — read gateway placement first.
- The Wi-Fi network it will join (name and password), or a SIM for the cellular models.
- MKScannerPro on a phone, the connector topic from step A below, and the gateway's MAC (printed on the unit).
On the gateway
Power the gateway and open MKScannerPro; it finds the gateway over Bluetooth. Connect to it.
Give it the Wi-Fi network it should use (or the APN for cellular).
Open its MQTT settings and key in the values from Your MQTT settings below — the box there fills them in from your own connector.
Still in the app:
- Upload data option → raw data on (or adv and rsp both on), and timestamp on;
- Filters → RSSI filter off, duplicate data filter off;
- Report period → the shortest offered.
A gateway that filters or de-duplicates is deciding on Omaya's behalf which frames matter, and positioning wants all of them.
Your MQTT settings
The gateway needs two topics: one it publishes its scans to, and one it subscribes to for commands. Both are built from two values Omaya generated for you, and both are inside the topic shown on your connector (step A):
- Organisation id — the second part of the topic. Omaya gave it to your organisation when it was set up; it never changes.
- Connector token — the third part: 16 characters, issued when the connector was created. It is the gateway's password, so treat the topic like one. Rotating it on the connector page stops the old topic at once, and every gateway on that connector then needs the new one.
A worked example
An organisation acme-corp whose connector token is a1b2c3d4e5f60708, and a gateway whose MAC is AA:BB:CC:2A:6F:10:
| Field in MKScannerPro | Enter |
|---|---|
| Host | the Omaya host you sign in to, e.g. omaya.example.com |
| Port | 1883 with SSL/TLS off, or 8883 with SSL/TLS on (one-way, public certificate) |
| Client Id | MKGW-AABBCC2A6F10 |
| Publish topic | omaya/acme-corp/a1b2c3d4e5f60708/generic/ble |
| Subscribe topic | omaya/acme-corp/a1b2c3d4e5f60708/generic/cmd/AABBCC2A6F10 |
| Username / Password | blank |
| Clean session | on |
| QoS | 0 |
| Keep alive | 60 |
- Publish topic — exactly the connector topic, character for character. Every gateway on the same connector uses the same one; Omaya tells them apart by the MAC inside each message. A single wrong character and the messages are dropped without any reply.
- Subscribe topic — MKScannerPro will not save without one, but Omaya never sends the gateway commands, so its exact value does not matter. The pattern above keeps it inside your organisation's space, gives each gateway its own (a command meant for one never reaches the others), and has six parts where Omaya reads only five-part topics — so nothing sent there is ever mistaken for scan data.
- Client Id — the broker allows one connection per Client Id; two gateways with the same one keep knocking each other off. Putting the MAC in it keeps them unique.
Fill in your own
Type your organisation id, token and gateway MAC — or paste the whole topic from the connector page — and copy each value into the app. It works in the page only: nothing you type is sent or saved.
Fill in your gateway's MQTT settings
| Host | the Omaya host | |
|---|---|---|
| Port | 1883 | |
| SSL/TLS | off | |
| Client Id | MKGW-<gateway-MAC> | |
| Publish topic | omaya/<organisation>/<token>/generic/ble | |
| Subscribe topic | omaya/<organisation>/<token>/generic/cmd/<gateway-MAC> | |
| Username / Password | (blank) |
Anything still in <angle brackets> needs your value. Nothing you type here leaves this page.
In Omaya
A. Create the connector
Connectors → IoT Gateway (MQTT) → add:
| Field | Choose |
|---|---|
| Connector Name | e.g. MOKO gateways — HQ |
| Vendor | Generic / Other |
| Protocol | BLE (Bluetooth Low Energy) |
| Active | on |
Save, and copy the host and the topic into the app. The topic looks like omaya/<organisation>/<16-character token>/generic/ble; the token is the gateway's credential, so copy the whole topic.
B. Register the gateway
Device → Gateway → add, with the MAC printed on the unit (the same one the app shows as the device MAC), Device Model Other, and its location, venue and zone. Messages from a gateway Omaya does not know are dropped, so do this before or straight after pointing the gateway at Omaya; one that publishes first is noted and can be registered afterwards.
C. Put it on the floor plan
Place it where it physically hangs, and once every gateway on the floor is up, do the calibration walk.
D. Register what it will hear
Under Device → Sensor, add each tag, beacon or sensor with its MAC and Device Model — and a zone for anything fixed to a wall. Device → Bulk Import takes a spreadsheet; New sensor types handles a model Omaya does not know yet.
E. Check it
Within a minute the gateway shows online on Device → Gateway, and the tags it hears appear on the Live Monitor and on their own pages.
When it disappoints
Connected in the app, nothing in Omaya. The publish topic first, character by character — a wrong token is dropped silently, by design; paste it into the box above to check its shape — then the MAC registered under Device → Gateway.
Two gateways keep going offline in turn. They share a Client Id. Give each its own — the pattern above puts the MAC in it.
Online, but some sensors never report a battery. The scan response is switched off: MOKO buttons carry their battery there. Turn on rsp (or raw data) under Upload data option.
The message format itself is described under MOKO MKGW series.