-
Notifications
You must be signed in to change notification settings - Fork 9
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Implemented config files #64
base: main
Are you sure you want to change the base?
Conversation
Looks like a good start to me! I think that these init variables from """
Big init routine as the whole board is brought up. Starting with config variables.
"""
self.debug = True # Define verbose output here. True or False
self.legacy = False # Define if the board is used with legacy or not
self.heating = False # Currently not used
self.orpheus = True # Define if the board is used with Orpheus or not
self.is_licensed = True
"""
Define the normal power modes
"""
self.NORMAL_TEMP = 20
self.NORMAL_BATT_TEMP = 1 # Set to 0 BEFORE FLIGHT!!!!!
self.NORMAL_MICRO_TEMP = 20
self.NORMAL_CHARGE_CURRENT = 0.5
self.NORMAL_BATTERY_VOLTAGE = 6.9 # 6.9
self.CRITICAL_BATTERY_VOLTAGE = 6.6 # 6.6
self.vlowbatt = 6.0
self.battery_voltage = 3.3 # default value for testing REPLACE WITH REAL VALUE
self.current_draw = 255 # default value for testing REPLACE WITH REAL VALUE
self.REBOOT_TIME = 3600 # 1 hour
self.turbo_clock = False You may also want to take a look at how CircuitPython has tried to natively introduce the use of a |
Ended up finishing the toml file for configuration. But when I connect to the board and the countdown starts, I get a "module named 'tomllib' not found" error. I did some digging and found that tomllib, which is a library I need to parse data from the config file, was introduced in Python 3.11, which I know the actual board is about 6 versions behind. My question is, would I be able to use a third party library called 'toml' I would simply need to run the command pip install toml I think, and parse exactly how I was attempting with the 'tomllib'. But I'm not too sure if that's a valid solution to this. Otherwise, I believe my only option is to keep using json. |
Hey @Alandlt15 I think this one of those things that is a mismatch between mainstream Python and CircuitPython. It would appear from the CircuitPython docs that they only natively support accessing a import os
print(os.getenv("test_variable")) I'm not sure if this allows us to actually write values to the |
commandsConfig.py: holds dictionary of commands
config.json: holds other configuration data (eg. cubesat name, radio callsign, jokes, etc)