Connection issues with a Mokosmart LW004-CT to TTN

I stumbled upon a few of these LW004-CT “panic buttons/ trackers” fobs that support LoRa …
But I am running into a few difficulties (no tech documentation came with them and very limited hits googling around docs/manuals ) …
I am able to see the fob sending out a join message to my gateway on the ttn network , the traffic log on the gateway seems to indicate the message is forwarded to an “experimental_ttnv2” and then to a “packet broker” and then to a “cluster” but nothing seems to be going back down to the device … (the gateway console show no downlink message and the fob repeat its join message up 8-10 times and then gives up until i cycle the power on the fob)

Here is a sample join uplink message :

{
  "name": "gs.up.receive",
  "time": "2021-10-29T03:50:53.107207129Z",
  "identifiers": [
    {
      "gateway_ids": {
        "gateway_id": "lora-pierre"
      }
    },
    {
      "gateway_ids": {
        "gateway_id": "lora-pierre",
        "eui": "58A0CBFFFEXXXXXX"
      }
    }
  ],
  "data": {
    "@type": "type.googleapis.com/ttn.lorawan.v3.UplinkMessage",
    "raw_payload": "AEZIZ25pc2lSxAhL//+BBeX1tTaXFBI=",
    "payload": {
      "m_hdr": {},
      "mic": "NpcUEg==",
      "join_request_payload": {
        "join_eui": "526973696EXXXXXX",
        "dev_eui": "E50581FFFFXXXXXX",
        "dev_nonce": "B5F5"
      }
    },
    "settings": {
      "data_rate": {
        "lora": {
          "bandwidth": 125000,
          "spreading_factor": 10
        }
      },
      "coding_rate": "4/5",
      "frequency": "903700000",
      "timestamp": 2101117116,
      "time": "2021-10-29T03:50:53.008403062Z"
    },
    "rx_metadata": [
      {
        "gateway_ids": {
          "gateway_id": "lora-pierre",
          "eui": "58A0CBFFFEXXXXXX"
        },
        "time": "2021-10-29T03:50:53.008403062Z",
        "timestamp": 2101117116,
        "rssi": -47,
        "channel_rssi": -47,
        "snr": 12.75,
        "uplink_token": "ChkKFwoLbG9yYS1waWVycmUSCFigy//+gDl3ELyB8ukHGgsInd/tiwYQp7+KMyDgvNuik7QD"
      }
    ],
    "received_at": "2021-10-29T03:50:53.107126695Z",
    "correlation_ids": [
      "gs:conn:01FK4MEK7PDN6SY32CVJTYC9QE",
      "gs:uplink:01FK52QZDKERCEHPHFKN6YQQ2Q"
    ]
  },
  "correlation_ids": [
    "gs:conn:01FK4MEK7PDN6SY32CVJTYC9QE",
    "gs:uplink:01FK52QZDKERCEHPHFKN6YQQ2Q"
  ],
  "origin": "ip-10-101-14-140.us-west-1.compute.internal",
  "context": {
    "tenant-id": "CgN0dG4="
  },
  "visibility": {
    "rights": [
      "RIGHT_GATEWAY_TRAFFIC_READ",
      "RIGHT_GATEWAY_TRAFFIC_READ"
    ]
  },
  "unique_id": "01FK52QZDK58C3YX8Y94CZEEX3"
}

As far as device setup is concerned in TTN I have used the devuid printed on the box , and tried a couple of permutations on the LoRa version (currently trying 1.0.2 as it seems common in other products from mokosmart) and put all 0’s in the appkey …

Note : Those fobs are also equipped with bluetooth and mokosmart even has an android app “moko lora” that supposedly allows to access / view the fob configuration (IDs / keys etc) but I cant seem to get the fob paired via bluetooth with my phone (it discovers the fob but wont pair with it)…

Any tips welcome …

Repository listing calls that out…IME most common is Rev B though haven’t had this device…also try Rev 1.03, as may have later firmware. Fact message goes through PacketBroker means likely picked up by a V2 gateway - should not be an issue - and will then be routed to your V3 app/device registration. Are you seeing join req in your app/device console live traffic? Can you connect a serial port over the charging USB connection to see device activity/logs or is it charge only fn?

Jeff-UK
Thanks for your feedback / questions …
I am not seeing the join req in the app/device console … I am seeing it only in the gateway console … (the gateway is a seeed studio indor gateway that i recently connected to the TTN v3 network)
I have tried to identify if there is a serial port on the usb from the fob but that doesn’t appear the case : when i plug it in to a windows 10 pc there is no new device discovered / no new serial port … so i am guessing this is charging only.

That usually means the DevEUI, AppEUI or AppKey do not match the values you entered for the device. The first two are visible in the join request at gateway level so you can compare them with the values you entered in for the device. If those match you will need to verify the AppKey somehow… (If you typed the key there might be simple mistakes like B/8 of 8/6 substitutions.)

I checked the DevEUI and AppEUI looked correct … but I noticed that the message was making reference to a JoinEUI and not a AppEUI … and after a few more tries I noticed that the device creation form changed if I chose v1.0.4 instead of v1.0.3. …
I was able to make progress with choosing v1.0.4 and setting the DevEUI and JoinEUI from the message seen on the gateway …
I am now receiving messages in the app console …
-receive join-request
-send join-request to cluster (referencing MAC_V1_0_4)
-join-request to cluster fail referencing “Mic Mismatch” error

  "data": {
    "@type": "type.googleapis.com/ttn.lorawan.v3.ErrorDetails",
    "namespace": "pkg/joinserver",
    "name": "mic_mismatch",
    "message_format": "MIC mismatch",
    "correlation_id": "765fc83c980148aeb523026f68565764",
    "code": 3
  },

-finally a drop join-request (referencing the same mic mismatch)

I am trying to understand what a MIC mismatch is referring to … does this has anything to do with matching the LoRaWan version (currently set to MAC V1.0.4) and the Regional Parameters Version (currently set for PHY V1.0.3 REV A) for the device ?

After more searching on the forum : I did see many references to mic mismatch associated with migrating devices from TTNv2 to TTNv3 … I am a fresh user that started directly in TTNv3 for my experimentations … just wanted to add that to my post to help rule things in or out …

That means the AppKey is not correct.

That is a rename between 1.0.3 and 1.0.4. For most devices you will still need to use LoRaWAN < 1.0.4 and just read AppEUI whenever you encounter JoinEUI.

Thanks for tip ! … I tried using the default appkey from a similar device from the same vendor (instead of all 00s ) and that worked …
The server sends a join-accept back to the device and then a data message is sent up from the device. after that there is an exchange suggesting an ADR is rejected and eventually I start seeing many uplink messages about a “nonce too short” error …

I tried a second fob device (same model) with the same config except for using V1.0.3 instead of v1.0.4… with that setup I get the join accept message but no further traffic is received from the device .
I am collecting the messages and will share …

Perhaps a silly question but what does the manufacturer or sales channel you used say about your issues (you asked them, right?)…if a device has no or poor support then I’m sure the community would like to know so they can steer clear! :wink: If you get no response from them perhaps send them a link to this thread so they know to respond to poor PR… just saying:-)

Also, check device packaging and any order related emails to see if you were sent correct keys etc. Vs guessing (or ask for resend).

Not a silly question at all … I bought those on ebay after a casual look at the website for the manufacturer Mokosmart … Unfortunately I have not been able to reach anyone at Mokosmart yet : there are a couple of bugs (random cloudflare issues with their website ) that block me from accessing their email contact info page and a contact form i found seems to be not working either …

I am reaching out to the ebay reseller as well but in fairness it appears to be a liquidator type business and not a technology firm involved in LoRa so I am not expecting much there …

Fair enough - so no obligation on part of manufacturer to support I guess. Good luck contacting them, please do report back here as others will be interested in support levels as I say. Meantime we will collectively scratch heads and see what we can do a community to help - suspect Jac was on right track wrt keys/MIC but you look to have got past that in part. Not unusual for manufacturers to replicate some keys across devices, though not a good practice. Dare you open one up to see if there is internal serial port/programming connector if nothing accessible through the USB port?

Have you had any further joy getting the device & phone paired? Looking at their FAQ (limited as it is) I see

"I alredy entered the LoRaWAN parameter in TTN , but could not access the network on TTN.

In some LoRa Servers , They will automatically generate some parameters(AppEui,AppKey and so on), you need change the parameter value in the device via Mokosmart’s App. So you should check the values of each parameter carefully."

So looks like getting to new keys may need the BLE option solving 1st… then you can generate in console/elsewhere and programme in new ones by looks of things…but… :wink:

According to the manufacturer website the devices use: “LoRaWAN V1.0.2“. You’ll need to set TTN accordingly and fill out the AppEUI field with the JoinEUI.

I opened one up (for future reference the right way to do this is to remove the 4 barely visible plastic plugs on the back that conceal screws that hold everything together)
The primary components are:

  • Nordic nRF52832 SoC
  • Lora 1262

The datasheet for the SoC doesnt call out USB explicitly but it does have an UART function so more investigation needed …

Apart from that there are 4 pads on the PCB for VCC/DIO/CLK/GND that I suspect are for the typical JTAG connection to burn firmware … (will have to look at the Nordic docs to see if this would be useable for anything in a post production programming situation )

In opening the case (before I saw the screws :frowning: ) I broke the Lora antenna connection (printed on a film that is glued to the shell of the fob) … I am not an RF expert so my crude approach to a new antenna would be a 1/4 wave long copper wire … hopefully that will work.

Yes i am puzzled by the app / BLE not working … the fob has BLE on as it is “visible” by the phone … but when the Mokolora app does a scan / refresh it doesnt pair with the fob … .
I have tried a couple of combination (holding pwr button, holding alert button while powering up ) thinking the BLE access might be limited to a “factory reset” or “config” mode that the fob needs to be in first … but no luck …

Is the device based on their MKL62BA Module or a descrete chip down build? If former then there is an ipx/ufl connector on the corner to add a descrete ant :wink:

I thought I had a picture of the -PB & -CT pcb to help identify contacts but cant find now…

Also I think they have a couple of different apps available to support different devices/use cases, so may be worth trying others to see if you get a connection, then look for any advanced/hidden options to get to config settings…

The LW004-CT is based on individual components/chips on a custom shaped pcb , no modules like MKL62BA …
I’ll keep looking for apps …

Quick update … I was able to trade emails with Mokosmart who provided me with some documentation (factory default settings / keys etc … ) for the fobs i have along with the right app to manage them.
Overall it appears that the LW004-CT (for Contact Tracker) variant of the LW004 is focused on leveraging BLE RSSI levels from nearby BLE capable fobs/devices to report on proximity encounters via LoRa with a capability to trigger an alarm on the fob if RSSI levels indicate “too close” proximity …
The LW004-CT has no GPS capability : the PCB has a few open footprints that suggests additional components for GPS receiver and antenna in other variants (perhaps like the LW004-PB )
Unfortunately it also appears that the panic button (that is present on the fob) isn’t triggering any transmission over LoRa which is disappointing as this was the primary function i was hoping to leverage . (I am trying to get a definitive confirmation from Mokosmart about that ) …

I am going to continue experimenting with the fobs I have but I am probably going to look for other fobs with a panic button function (and GPS too ) … that is probably the shorter path compared to studying programming / app dev for the Nordic Soc and figuring out if i could repurpose/reprogram the fobs i have :slight_smile:

1 Like

You may also want to search the forum for the prior extensive discussions on the use of LoRaWAN, TTN and GPS as a tracking device and particularly for emergency use.

Hello all.
I bought a LW004-CT on ebay, I dont know if it was paired or already registered on TTN, helium i dont know. The thing is that I cannot pair it using bluetooth and mokolora and/or mklora app. I would appreciate very much your help. Exist a way I can register as an IoT somewhere???

@pbr6891 I just got a LW004-CT… were you able to connect to it using Moko’s MKLoRa iOS or Android app? I’m not able to connect to it using iOS 15 or 16. I also do not see any devices pop up within the 1st minute of startup under General > Bluetooth. Any tips would be appreciated!