Device.onconnect

The onconnect seems to be working fine for me, however only on full device restart (have you tried truning it on and off again) , not sure how reliable the event is when just updating code on device.

If you’re updating code, the device doesn’t disconnect, so you won’t get an onconnect when it starts running.

If you want to run something on new code load, then you should do an agent.send() near the top of your imp code to trigger it.