Greetings everyone, I hope you all are doing great.
I’ve recently configured ChirpStack using the Docker installation method. I require that, each time a device is registered via the web interface, it initiates an HTTP request to an external API. This request should include the device’s AppEUI and DevEUI in the body.
I was checking the documentation and I couldn’t see any topic related to that. There isn’t anything like “system events” (there is the logs that I can see in the terminal, but that’s it) that tell when a device or any other entity was created.
It is not exposed, but the JoinEUI (if configured) + any other data that you are interested in can be retrieved by making a gRPC API call using the DevEUI as identifier.
In order to implement what I initially asked in this post, I’m using the chirpstack python API.
In the past the following code worked correctly:
from chirpstack_api import api
def process_messages(self, resp: List[Tuple[str,dict]], action: Callable):
control = True
for _, messages in resp:
for message in messages:
last_id = message[0]
for field, value in message[1].items():
if field == "request":
request_log = api.RequestLog()
request_log.ParseFromString(value.encode())
obj = json.loads(MessageToJson(request_log))
control = action(obj)
return last_id, control
However, Today I was performing some testing and I found myself with this error:
File "/home/ubuntu/redis_handler.py", line 98, in process_messages
request_log = api.RequestLog()
^^^^^^^^^^^^^^
AttributeError: module 'chirpstack_api.api' has no attribute 'RequestLog'
So, my question is:
Was the chirpstack api updated recently, was the RequestLog object removed from the chirpstack class?
The notes from the 4.6.0 release today, there is a mention of the changing location of request log:
It is likely that your Python package was updated. You will want to update your running ChirpStack instance and your own code, or pin the Python package to the version you were using previously.