I would try taking out the part where you only publish if the speed, pressure or temp changes. Since you don’t show how those variables are updated, we can’t really tell if that part of the code is some how failing when USB is not connected.
If your code uses USB serial, I would check those sections well!
You should also publish as PRIVATE not to spam the public event stream.
Also assuming PUBLISH_RATE is greater or equal 1000.
Whether or not USB is connected should not have any impact as long your (hidden) code does no somehow block without it or the battery is too low (which shouldn’t be the case due to the fact that variables are still requestable).
Thanks heaps to you both for your assistance, it is greatly appreciated.
The source of the issue was actually hardware, as I had unintentionally powered an external component off the USB 5V out. As such it was powering down when unplugged. A rookie error.
I’ve changed published to PRIVATE as ScurffR has suggested and will remember that in future.