Skip to content

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

  1. Create the connector and copy its host and topic — A
  2. Register the gateway by its MAC — B
  3. Place it on the floor plan and do the calibration walk — C
  4. Register the tags and sensors it will hear — D
  5. Check it end to end — E

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 ​

  1. Power the gateway and open MKScannerPro; it finds the gateway over Bluetooth. Connect to it.

  2. Give it the Wi-Fi network it should use (or the APN for cellular).

  3. Open its MQTT settings and key in the values from Your MQTT settings below — the box there fills them in from your own connector.

  4. 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.
The five parts of a gateway's publish topic The topic is omaya, then the organisation id, then the connector token, then the vendor format, then the radio protocol. Omaya validates the token against the organisation and vendor before it reads the payload; a topic that does not match is dropped without a reply. omaya/acme-corp/a1b2c3d4e5f60708/generic/bleFIXEDalways thisORGANISATIONthe customer's idin OmayaCONNECTOR TOKEN16 hex chars, issued when thecustomer creates the connectorVENDOR FORMATwhich payload shapeto expectPROTOCOLble · wifi · loraThe three shaded parts must agreeThe token was issued to one organisation for one vendor format. A topic that pairs it with any otherorganisation or vendor is dropped silently — the broker accepts the publish, Omaya never reads it.
One topic per connector. Every gateway a customer owns from you publishes to the same topic; the gateway is identified inside the payload, not in the topic.

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 MKScannerProEnter
Hostthe Omaya host you sign in to, e.g. omaya.example.com
Port1883 with SSL/TLS off, or 8883 with SSL/TLS on (one-way, public certificate)
Client IdMKGW-AABBCC2A6F10
Publish topicomaya/acme-corp/a1b2c3d4e5f60708/generic/ble
Subscribe topicomaya/acme-corp/a1b2c3d4e5f60708/generic/cmd/AABBCC2A6F10
Username / Passwordblank
Clean sessionon
QoS0
Keep alive60
  • 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
Hostthe Omaya host
Port1883
SSL/TLSoff
Client IdMKGW-<gateway-MAC>
Publish topicomaya/<organisation>/<token>/generic/ble
Subscribe topicomaya/<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:

FieldChoose
Connector Namee.g. MOKO gateways — HQ
VendorGeneric / Other
ProtocolBLE (Bluetooth Low Energy)
Activeon

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.

Last updated:

Omaya platform documentation