DeviceServiceStub.Enqueue is not implemented

The following code is given as a python example under the API.

I have already cloned the repo to my machine. Performed. make

python build


python install

This Unimplemented error still persists.

 `print("open grpc channel . . .")
            # Connect without using TLS.
            channel = grpc.insecure_channel(server)
    except Exception:
            raise ConnectionError('FAILED  grpc channel')
            print('  grpc channel okay.')
    print("open device service client. . .")
            # Device-queue API client.
client = api.DeviceServiceStub(channel)
        except Exception:
            raise ConnectionError('FAILED  dev serv client')
            print('  dev serv client okay.')       

    # Define the API key meta-data.
    auth_token = [("authorization", "Bearer %s" % api_token)]

    # Construct request.
    req = api.EnqueueDeviceQueueItemRequest()
    req.queue_item.confirmed = False = bytes([0x01, 0x09, 0x05, 0x0A ])
    req.queue_item.dev_eui = dev_eui
    req.queue_item.f_port = 2   # CS  wanted 10 here ?
    resp = client.Enqueue(req, 

    # Print the downlink id

Running the code results in this error,

open grpc channel . . . grpc channel okay. open device service client. . . dev serv client okay. ['Activate', 'Create', 'CreateKeys', 'Deactivate', 'Delete', 'DeleteKeys', 'Enqueue', 'FlushDevNonces', 'FlushQueue', 'Get', 'GetActivation', 'GetKeys', 'GetLinkMetrics', 'GetMetrics', 'GetQueue', 'GetRandomDevAddr', 'List', 'Update', 'UpdateKeys', '__class__', '__delattr__', '__dict__', '__dir__', '__doc__', '__eq__', '__format__', '__ge__', '__getattribute__', '__gt__', '__hash__', '__init__', '__init_subclass__', '__le__', '__lt__', '__module__', '__ne__', '__new__', '__reduce__', '__reduce_ex__', '__repr__', '__setattr__', '__sizeof__', '__str__', '__subclasshook__', '__weakref__'] Traceback (most recent call last): File "", line 83, in <module> resp = client.Enqueue(req, metadata=auth_token) File "/home/linus/anaconda3/lib/python3.8/site-packages/grpc/", line 946, in __call__ return _end_unary_response_blocking(state, call, False, None) File "/home/linus/anaconda3/lib/python3.8/site-packages/grpc/", line 849, in _end_unary_response_blocking raise _InactiveRpcError(state) grpc._channel._InactiveRpcError: <_InactiveRpcError of RPC that terminated with: status = StatusCode.UNIMPLEMENTED details = "unknown method Enqueue for service api.DeviceService" debug_error_string = "{"created":"@1668050965.854003706","description":"Error received from peer ipv4:","file":"src/core/lib/surface/","file_line":1064,"grpc_message":"unknown method Enqueue for service api.DeviceService","grpc_status":12}"

I found several Enqueue methods located here,

`##  github   chirpstack-api/python/src/chirpstack_api/as_pb/external/api/

class DeviceQueueServiceServicer(object):
"""DeviceQueueService is the service managing the downlink data queue.


def Enqueue(self, request, context):
    """Enqueue adds the given item to the device-queue.


    context.set_details('Method not 
    raise NotImplementedError('Method not 

I got the exact same problem :frowning: Any updates from your side?

Which chirpstack-api version are you using against which version of ChirpStack?

# conda list chirp
# packages in environment at /home/linus/anaconda3:
# Name                    Version                   Build  Channel
chirpstack-api            4.0.2                    pypi_0    pypi

# chirpstack-network-server version

# chirpstack-application-server version

You have a version mismatch. The v4 API is compatible with ChirpStack v4 :slight_smile:

1 Like