Disable frame-counter validation / skipFCntCheck Bug

Hello, I found a bug when trying to disable frame count validation when creating or updating a device via the API.

I used the routes / chirpstack version
PUT → /api/devices/{device.devEui}
POST → /api/devices
Chirpstack version 4.0.0

I’m setting skipFCntCheck to True, but when creating or updating the device and doing a GET afterwards, it returns False.

Python:

            'device': {
                'applicationId': application_id.replace('-', ''),
                'description': parsed_device_eui.replace('-', ''),
                'devEui': parsed_device_eui,
                'deviceProfileId': device_profile,
                'name': parsed_device_eui,
                'referenceAltitude': 0,
                'skipFCntCheck': True,
            }

The only way I can update is using chirpstack web, manually disabling it. However, I have 1500 devices that need to disable frame count validation and I would like to use the API to create a script for this.

  • Is there any version of chirpstack where this bug has already been fixed?

Thank you.

I don’t use this functionality (and recommend against it for security reasons), but I believe I read that devices need to rejoin after enabling it. Have you tried rejoining any of the devices and see if they pick as True?

Thanks for the feedback. Yes, the device did the rejoin, but it still didn’t work.

The bug exists when we make the creation/update request via REST API. I was using the python request library, and doing the POST/PUT

But I managed to solve the problem, when I used the chirpstack-api library via grpc it worked, I was able to create and update the device with skipFrameCount=True.

This was the Python code used that solved the problem:

    from chirpstack_api import api
    auth_token = [('authorization', f'Bearer {chirp_stack_api_key}')]
    channel = grpc.insecure_channel(chirp_stack_server)
    client = api.DeviceServiceStub(channel)

      request = api.UpdateDeviceRequest()
      request.device.dev_eui = device_eui
      request.device.name = device_eui
      request.device.description = device_eui
      request.device.application_id = application_id
      request.device.device_profile_id = profile_id
      request.device.skip_fcnt_check = True
      client.Update(request, metadata=auth_token)