added migration

This commit is contained in:
Nico Melone
2023-06-03 11:42:26 -05:00
parent 53f74586e0
commit 58415dfdd7
12 changed files with 2915 additions and 2 deletions

View File

@@ -27,7 +27,7 @@ class start(threading.Thread):
print self.deviceName
mac2 = mac.replace(":", "")
self.mac = mac2.upper()
self.version = "17" #hp device management
self.version = "16" #mistification #added Nodes in v5
self.finished = threading.Event()
threading.Thread.start(self)
@@ -56,7 +56,7 @@ class start(threading.Thread):
try:
topic = 'meshify/db/%s/%s/%s/%s/%s' % (company, "_", nodeTypeName, uniqueID, channel)
topic = 'meshify/db/%s/%s/%s/%s/%s' % (company, "_", nodeTypeName, uniqueID.lower(), channel)
print topic
if channel == "files":
#for the file structure I had to take off the " " around the value
@@ -71,6 +71,27 @@ class start(threading.Thread):
def run(self):
#on startup send the version number
self.sendtodb("version", str(self.version), 0)
if os.path.isfile('/root/python_firmware/drivers/device_base.py'):
print "found new device_base file"
os.system("/bin/mv -f /root/python_firmware/drivers/device_base.py /root/python_firmware/device_base.py")
os.system("/bin/rm -f /root/python_firmware/drivers/device_base.py")
os.system("/bin/rm -f /root/python_firmware/drivers/device_base.pyc")
if os.path.isfile('/root/python_firmware/drivers/meshifyData.py'):
print "found new meshifyData file"
os.system("/bin/mv -f /root/python_firmware/drivers/meshifyData.py /root/python_firmware/meshifyData/meshifyData.py")
os.system("/bin/rm -f /root/python_firmware/drivers/meshifyData.py")
os.system("/bin/rm -f /root/python_firmware/drivers/meshifyData.pyc")
if os.path.isfile('/root/python_firmware/drivers/main.py'):
print "found new main.py file"
os.system("/bin/mv -f /root/python_firmware/drivers/main.py /root/python_firmware/main.py")
os.system("/bin/rm -f /root/python_firmware/drivers/main.py")
os.system("/bin/rm -f /root/python_firmware/drivers/main.pyc")
time.sleep(0.5)
os.system('/root/reboot')
while True:
try:
self.mainMeshify_hb('hb', 'On')