Hello,
I’m using ChirpStack OS v4.1.1 (full image with latest SWU) with an RPi1 model B (quite old, but in excellent shape) and a RAK2287 Hat. When using no CODEC (uplink decoder), everything works just fine, and trying to send unconfirmed data uplink, I get device LoRaWAN frames and Events updating immediately.
Then if I turn Javascipt CODEC on, either writing my own code, or even just leaving the basic template that opens in the code editor, something strange happens. The dashboard seems to “hang” (not responding) for about a minute every time an uplink is transmitted, and then I finally got the uplink frame showing up in the LoRaWAN frames tab, but nothing in the Events tab, and the payload is not decoded.
After some investigations, I observed that the ChirpStack service actually stops for a few seconds, and then restarts everytime a uplink is received…
Jul 16 21:51:55 raspberrypi user.info chirpstack-concentratord-sx1302[726]: Frame received, uplink_id: 1366906989, count_us: 4094594633, freq: 867700000, bw: 125000, mod: LoRa, dr: SF7
Jul 16 21:51:55 raspberrypi user.info chirpstack-mqtt-forwarder[485]: Received uplink frame, uplink_id: 1366906989
Jul 16 21:51:55 raspberrypi user.info chirpstack-mqtt-forwarder[485]: Sending uplink event, uplink_id: 1366906989, topic: eu868/gateway/0016c001ff1e7a14/event/up
Jul 16 21:51:59 raspberrypi user.err monit[452]: 'chirpstack' process is not running
Jul 16 21:51:59 raspberrypi user.info monit[452]: 'chirpstack' trying to restart
Jul 16 21:51:59 raspberrypi user.info monit[452]: 'chirpstack' start: '/etc/init.d/chirpstack start'
Jul 16 21:52:09 raspberrypi user.info monit[452]: 'chirpstack' process is running with pid 2082
Jul 16 21:52:21 raspberrypi user.err chirpstack-concentratord-sx1302[726]: Get concentrator temperature error, error: lgw_get_temperature failed
Jul 16 21:52:21 raspberrypi user.info chirpstack-concentratord-sx1302[726]: Publishing stats event, rx_received: 1, rx_received_ok: 1, tx_received: 0, tx_emitted: 0
Jul 16 21:52:21 raspberrypi user.info chirpstack-mqtt-forwarder[485]: Received gateway stats
Jul 16 21:52:21 raspberrypi user.info chirpstack-mqtt-forwarder[485]: Sending gateway stats event, topic: eu868/gateway/0016c001ff1e7a14/event/stats
If I keep checking monit status (like crazy), I get this for a couple of seconds (everytime an uplink is received):
Process 'chirpstack'
status Does not exist
monitoring status Monitored
monitoring mode active
on reboot start
data collected Sun, 16 Jul 2023 21:59:41
Then right after
Process 'chirpstack'
status Initializing
monitoring status Initializing
monitoring mode active
on reboot start
data collected Sun, 16 Jul 2023 21:59:41
And finally
Process 'chirpstack'
status OK
monitoring status Monitored
monitoring mode active
on reboot start
pid 2228
parent pid 1
...
I really doubt that the cause is the CODEC javascipt code. I’ve tried many ways to write my simple decoder according to the v4 rules, and even the basic template produces this behavior:
function decodeUplink(input) {
return {
data: {
temp: 22.5
}
};
}
BTW, I can decode my payloads with NodeRED very well if I deactivate the CODEC.
Any ideas ? Since the dashboard hangs, I can get no clue from the event log…
Thanks !