You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
# new_config(status_logger, arg=0) #TODO remove this
# User button will enter configurations page from this point on# # If initialise time failed to acquire exact time, halt initialisation# if no_time:# raise Exception("Could not acquire UTC timestamp")# # Check if updating was triggered over LoRa# if config.get_config("update"):# software_update(status_logger)exceptExceptionase:
status_logger.exception(str(e))
# reboot_counter = 0# try:# while user_button.get_reboot():# blink_led((0x555500, 0.5, True)) # blink yellow LED# time.sleep(0.5)# reboot_counter += 1# if reboot_counter >= 180:# status_logger.info("rebooting...")# reset()# new_config(status_logger, arg=0) #TODO remove this# except Exception:# reset()pycom.rgbled(0x552000) # flash orange until its loaded# If sd, time, logger and configurations were set, continue with initialisationtry:
status_logger.info("Filesystem.......")
# Configurations are entered parallel to main execution upon button press for 2.5 secsuser_button.set_config_blocking(False)
#status_logger.debug(DEFAULT_LOG_NAME + " :LOG_LEVEL_KEY" + config.get_config(LOG_LEVEL_KEY))# Set debug level - has to be set after logger was initialised and device was configured#status_logger = logger_factory.set_level(DEFAULT_LOG_NAME, config.get_config(LOG_LEVEL_KEY) ) # Cannot change mid way?#print("HERE")status_logger.info("Filesystem init start")
#print("HERE2")# Initialise file systeminit.initialise_file_system()
# Remove residual files from the previous run (removes all files in the current and processing dir)init.remove_residual_files()
status_logger.info("Filesystem init completed")
# Get a dictionary of sensors and their statussensors=get_sensors(config, status_logger)
# Join the LoRa network#lora = False#if (True in sensors.values() or gps_on) and config.get_config("LORA") == "ON": #TODO: lorawan disabled here# lora = LoRaWAN(status_logger)## Ring buffermessage_limit_count=5# buffer size?cell_size_bytes=100#all buffer slots are a fixed size ! so waste space, but dont make this smaller that a max message!msgBuffer=RingBuffer(RING_BUFFER_DIR, RING_BUFFER_FILE, message_limit_count, cell_size_bytes, config, status_logger) # s.processing_path, s.lora_file_name, 31 * self.message_limit, 100)## Pybytestry:
# Start PM sensor thread pyBytesThreadId=_thread.start_new_thread(PybytesTransmit.pybytes_thread, (msgBuffer, config, status_logger))
status_logger.info("THREAD - Pybytes initialised")
exceptExceptionase:
status_logger.info("Failed to initialise Pybytes thread ")
#raise e# Initialise temperature and humidity sensor thread with id: TEMPstatus_logger.info("Starting Temp logger...")
ifsensors[s.TEMP]:
TEMP_logger=SensorLogger(sensor_name=s.TEMP, terminal_out=True)
ifconfig.get_config(s.TEMP) =="SHT35":
temp_sensor=TempSHT35(config, TEMP_logger, status_logger)
status_logger.info("Temperature and humidity sensor initialised")
# Initialise PM power circuitry
d3894c79dbd60e5ba09143a0be85b87420802f21
The text was updated successfully, but these errors were encountered:
remove this
except Exception:
reset()
Set debug level - has to be set after logger was initialised and device was configured
print("HERE")
Initialise file system
PyonAir-pycom/code/main.py
Line 201 in 9fcaa24
d3894c79dbd60e5ba09143a0be85b87420802f21
The text was updated successfully, but these errors were encountered: