1- #!/usr/bin/env python3
21'''
32Recursion.Space
43Email: jmerrell@recursion.space
1312import requests
1413from pubsub import pub
1514
15+ import pod_config
1616from modules import op_config , op_gpio , op_ssh , rec_log , rec_mqtt , rec_xbee , rec_api , rec_lan
1717from modules .rec_log import exception_log , zip_send
1818
19+
20+ settings = pod_config .load_config ()
21+
1922# --------------------------- Visualization Threads --------------------------- #
2023threading .Thread (target = op_gpio .led_stat_thread ).start ()
2124threading .Thread (target = op_gpio .led_io_thread ).start ()
3538# Not sure if the next section is required.
3639sys .path .append (os .path .abspath (os .path .join (os .path .dirname (__file__ ), os .path .pardir )))
3740
38- Version = op_config . get ( ' version', None )
41+ Version = settings [ 'openpod' ][ ' version']
3942
4043# Inserts path to reference then starts importing modules.
4144sys .path .insert (0 , f"./{ Version } " )
@@ -66,7 +69,7 @@ def incoming_xbee_data():
6669
6770# ------------------------------- TEMP SOLUTION ------------------------------ #
6871try :
69- URL = f'https://{ op_config . get ( "url" ) } /pod/obtaintoken/{ op_config . get ( "serial" ) } /'
72+ URL = f'https://{ settings [ "url" ] } /pod/obtaintoken/{ settings [ "uuid" ] } /'
7073 response = requests .get (URL , timeout = 10 )
7174
7275 if response .status_code == 201 :
@@ -76,7 +79,7 @@ def incoming_xbee_data():
7679 print (err )
7780# ------------------------------- TEMP SOLUTION ------------------------------ #
7881
79- if op_config . get ( 'debug' , False ) :
82+ if settings [ 'debug' ] :
8083 rec_log .publog ("debug" , "*** DEBUG Enabled ***" )
8184
8285rec_log .publog ("info" , f"Version: { Version } " )
0 commit comments