I am developing a project on nRF9161.
I am interested in calculating data usage for different protocols (for example MQTT with TLS) when communicating with a server over cellular network/socket. Is there a way to do so?
I have found "net stats" sample code:
https://docs.nordicsemi.com/bundle/ncs-latest/page/zephyr/samples/net/stats/README.html
But after integrating it into my code it does not seem to function properly (I have only moved init function call to my main). It always prints zeros for all data, even though I am certain that communication is working, additionally function calls, such as send(), are returning the amount of application data it has sent.
Global network statistics IPv6 recv 0 sent 0 drop 0 forwarded 0 IPv6 ND recv 0 sent 0 drop 0 IPv6 MLD recv 0 sent 0 drop 0 IPv4 recv 0 sent 0 drop 0 forwarded 0 IP vhlerr 0 hblener 0 lblener 0 IP fragerr 0 chkerr 0 protoer 0 ICMP recv 0 sent 0 drop 0 ICMP typeer 0 chkerr 0 UDP recv 0 sent 0 drop 0 UDP chkerr 0 TCP bytes recv 0 sent 0 TCP seg recv 0 sent 0 drop 0 TCP seg resent 0 chkerr 0 ackerr 0 TCP seg rsterr 0 rst 0 re-xmit 0 TCP conn drop 0 connrst 0 Bytes received 0 Bytes sent 0 Processing err 0 Statistics for interface 0x200113e8 [1] IPv6 recv 0 sent 0 drop 0 forwarded 0 IPv6 ND recv 0 sent 0 drop 0 IPv6 MLD recv 0 sent 0 drop 0 IPv4 recv 0 sent 0 drop 0 forwarded 0 IP vhlerr 0 hblener 0 lblener 0 IP fragerr 0 chkerr 0 protoer 0 ICMP recv 0 sent 0 drop 0 ICMP typeer 0 chkerr 0 UDP recv 0 sent 0 drop 0 UDP chkerr 0 TCP bytes recv 0 sent 0 TCP seg recv 0 sent 0 drop 0 TCP seg resent 0 chkerr 0 ackerr 0 TCP seg rsterr 0 rst 0 re-xmit 0 TCP conn drop 0 connrst 0 Bytes received 0 Bytes sent 0 Processing err 0
Has anyone been successful in monitor modem/socket data usage with an nRF91 series device?