_web_folder_path = "/var/www/html/" _telemetrylog_filename = _folder_path+"telemetry_"+str(_gwid)+".log" _imagelog_filename = _folder_path+"image_"+str(_gwid)+".log" # END #//////////////////////////////////////////////////////////// #------------------------------------------------------------ #open clouds.json file to get enabled clouds #------------------------------------------------------------ from clouds_parser import retrieve_enabled_clouds #get a copy of the list of enabled clouds _enabled_clouds=retrieve_enabled_clouds() print "post_processing_gw.py got cloud list: " print _enabled_clouds #------------------------------------------------------------ #open clouds.json file to get clouds for encrypted data #------------------------------------------------------------ _cloud_for_encrypted_data=retrieve_enabled_clouds("encrypted_clouds") print "post_processing_gw.py got encrypted cloud list: " print _cloud_for_encrypted_data _cloud_for_lorawan_encrypted_data=retrieve_enabled_clouds("lorawan_encrypted_clouds") print "post_processing_gw.py got LoRaWAN encrypted cloud list: " print _cloud_for_lorawan_encrypted_data
array += line #change it into a python array json_array = json.loads(array) #set the gateway_address for having different log filenames _gwid = json_array["gateway_conf"]["gateway_ID"] #------------------------------------------------------------ #open clouds.json file to get enabled clouds #------------------------------------------------------------ from clouds_parser import retrieve_enabled_clouds #get a copy of the list of enabled clouds _enabled_clouds=retrieve_enabled_clouds() print "post_processing_gw.py got cloud list: " print _enabled_clouds #------------------------------------------------------------ #initialize gateway DHT22 sensor #------------------------------------------------------------ try: _gw_dht22 = json_array["gateway_conf"]["dht22"] except KeyError: _gw_dht22 = 0 _date_save_dht22 = None try:
array += line #change it into a python array json_array = json.loads(array) #set the gateway_address for having different log filenames _gwid = json_array["gateway_conf"]["gateway_ID"] #------------------------------------------------------------ #open clouds.json file to get enabled clouds #------------------------------------------------------------ from clouds_parser import retrieve_enabled_clouds #get a copy of the list of enabled clouds _enabled_clouds=retrieve_enabled_clouds() print "post_processing_gw.py got cloud list: " print _enabled_clouds #//////////////////////////////////////////////////////////// # CHANGE HERE THE VARIOUS PATHS FOR YOUR LOG FILES #//////////////////////////////////////////////////////////// _folder_path = "/home/pi/Dropbox/LoRa-test/" _gwlog_filename = _folder_path+"gateway_"+str(_gwid)+".log" _telemetrylog_filename = _folder_path+"telemetry_"+str(_gwid)+".log" _imagelog_filename = _folder_path+"image_"+str(_gwid)+".log" # END #////////////////////////////////////////////////////////////
array += line #change it into a python array json_array = json.loads(array) #set the gateway_address for having different log filenames _gwid = json_array["gateway_conf"]["gateway_ID"] #------------------------------------------------------------ #open clouds.json file to get enabled clouds #------------------------------------------------------------ from clouds_parser import retrieve_enabled_clouds #get a copy of the list of enabled clouds _enabled_clouds=retrieve_enabled_clouds() print "post_processing_gw.py got cloud list: " print _enabled_clouds #------------------------------------------------------------ #open clouds.json file to get clouds for encrypted data #------------------------------------------------------------ _cloud_for_encrypted_data=retrieve_enabled_clouds("encrypted_clouds") print "post_processing_gw.py got encrypted cloud list: " print _cloud_for_encrypted_data _cloud_for_lorawan_encrypted_data=retrieve_enabled_clouds("lorawan_encrypted_clouds") print "post_processing_gw.py got LoRaWAN encrypted cloud list: " print _cloud_for_lorawan_encrypted_data