ccall48
December 21, 2023, 8:16am
1
Hey guys,
i was using the redis stream from “api:stream:request” to do some simple updates to helium devices when a request hit the redis stream decoding via the following rpc key api.request_log_pb2.RequestLog()
.
however it seems in the latest 4.6 update request_log_pb2
has been depreciated and I cannot seem to find any other stream this is available in from my hunt over the last few hours to fix this so far.
if anyone knows can you let me know if it has been moved please let me know. i will keep looking the DeviceSession does not seem feasible as i need to pass in data to use it which you do not have.
ccall48
December 21, 2023, 10:01am
2
Ok i think i’ve managed to find the new location after a look around on the chirpstack site phew… so for future me
and a minimum working python example in case anyone else gets stuck.
import asyncio
import redis.asyncio as redis
from google.protobuf.json_format import MessageToJson
from chirpstack_api import stream
pool = redis.ConnectionPool(host='chirpstack-redis', port=6379, db=0)
rdb = redis.Redis(connection_pool=pool, decode_responses=True)
async def stream_api_requests():
stream_key = "api:stream:request"
last_id = '0'
while True:
try:
resp = await rdb.xread({stream_key: last_id}, count=1, block=0)
for message in resp[0][1]:
last_id = message[0]
print('========== v RAW REQUEST MESSAGE v ==========')
print(message[1])
print('========== ^ RAW REQUEST MESSAGE ^ ==========')
if b'request' in message[1]:
msg = message[1][b'request']
# print(msg)
print('========== v REQUEST MESSAGE v ==========')
pl = stream.api_request_pb2.ApiRequestLog()
pl.ParseFromString(msg)
print(MessageToJson(pl))
print('========== ^ REQUEST MESSAGE ^ ==========')
except Exception as err:
print('Error:', err)
asyncio.run(stream_api_requests())
bconway
December 21, 2023, 2:11pm
3
Yes, see the v4.6 release notes with the refactoring into the streams
package:
v4.6.0
Important note before you upgrade:
If you are migrating from ChirpStack v3 to ChirpStack v4 and are still using the ChirpStack Gateway Bridge v3.14.x, then you must add v4_migrate=true to your configuration as described by the v3 to v4 migration documentation .
Features
End-to-end encryption
This feature makes it possible to implement end-to-end encryption between the end-device and end-application. On OTAA join, the join-server will provide Chirpstack with the encrypted AppSKey, which …
system
Closed
March 20, 2024, 2:12pm
4
This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.