save devicetree through a tempfile, don't do it periodically
fix #194
fix #195
fix #196