i-am-grub / MultiGP_Toolkit

MultiGP Plugin for RotorHazard
https://multigp-toolkit.readthedocs.io
Other
4 stars 1 forks source link

Error during bootup and not able to connect #14

Open Aaronsss opened 3 hours ago

Aaronsss commented 3 hours ago

Our timer has been unable to pull data from multigp and is having exceptions during start up any ideas how to fix it?

Running multigp toolkit 2.0.7

The plugin was working and seemed to stop working without any changes to the setup between sessions

2024-10-26 11:56:45.947: main [INFO] Release: 4.1.1 / Server API: 44 / Latest Node API: 35 2024-10-26 11:56:45.949: RHUtils [INFO] Host machine: Raspberry Pi 3 Model B Rev 1.2 2024-10-26 11:56:45.986: RHUtils [INFO] Host OS: Raspbian GNU/Linux 11 (bullseye) 32-bit (Linux 6.1.21-v7+) 2024-10-26 11:56:45.986: RHUtils [INFO] Python version: 3.9.2 2024-10-26 11:56:46.037: RHUtils [INFO] S32_BPill board detected 2024-10-26 11:56:46.171: main [INFO] Host machine is 'laptimer' at 192.168.68.18 2024-10-26 11:56:46.184: main [INFO] Loaded plugin 'rh_class_rank_best_x_rounds' 2024-10-26 11:56:46.213: main [INFO] Loaded plugin 'fpvscores' 2024-10-26 11:56:46.221: main [INFO] Loaded plugin 'rh_points_by_position' 2024-10-26 11:56:46.696: main [INFO] Loaded plugin 'rh_led_handler_character' 2024-10-26 11:56:46.705: main [INFO] Loaded plugin 'rh_data_export_csv' 2024-10-26 11:56:46.712: main [INFO] Loaded plugin 'rh_led_handler_graph' 2024-10-26 11:56:46.721: main [INFO] Loaded plugin 'rh_data_import_json' 2024-10-26 11:56:46.729: main [INFO] Loaded plugin 'cumulative_points_per_heat' 2024-10-26 11:56:46.737: main [INFO] Loaded plugin 'rh_actions_builtin' 2024-10-26 11:56:46.746: main [INFO] Loaded plugin 'rh_heatgenerator_standard' 2024-10-26 11:56:46.755: main [INFO] Loaded plugin 'rh_data_export_json' 2024-10-26 11:56:46.763: main [INFO] Loaded plugin 'rh_connector_trackside' 2024-10-26 11:56:46.770: main [INFO] Loaded plugin 'rh_class_rank_cumulative_points' 2024-10-26 11:56:46.777: main [INFO] Loaded plugin 'rh_heatgenerator_ladder' 2024-10-26 11:56:46.786: main [INFO] Loaded plugin 'pilot_csv_importer' 2024-10-26 11:56:46.793: main [INFO] Loaded plugin 'rh_class_rank_heat_pos' 2024-10-26 11:56:46.802: main [INFO] Loaded plugin 'db-restore' 2024-10-26 11:56:46.867: main [INFO] Loaded plugin 'OBS_Websocks' 2024-10-26 11:56:46.903: main [INFO] Loaded plugin 'stream_overlays' 2024-10-26 11:56:47.040: plugins.MultiGP_Toolkit.systemVerification.py39 [INFO] RotorHazard Hash - removed 2024-10-26 11:56:47.055: plugins.MultiGP_Toolkit.systemVerification.py39 [INFO] MultiGP Toolkit Hash - removed 2024-10-26 11:56:47.058: main [INFO] Loaded plugin 'MultiGP_Toolkit' 2024-10-26 11:56:47.067: main [INFO] Loaded plugin 'rh_led_handler_bitmap' 2024-10-26 11:56:47.079: main [INFO] Loaded plugin 'sensor_monitor' 2024-10-26 11:56:47.089: main [INFO] Loaded plugin 'rh_led_handler_strip' 2024-10-26 11:56:47.090: main [INFO] System info: isRPi=True, isRealGPIO=True (RPi.GPIO), isS32BPill=True 2024-10-26 11:56:47.090: Config [INFO] Using configuration file 'config.json' 2024-10-26 11:56:47.091: main [INFO] Using log file: logs/rh_20241026_115645.log 2024-10-26 11:56:47.478: Plugins [INFO] Loaded module i2c_helper 2024-10-26 11:56:47.558: Plugins [INFO] Loaded module i2c_node 2024-10-26 11:56:47.563: Plugins [INFO] Loaded module serial_node 2024-10-26 11:56:47.763: serial_node [INFO] Serial multi-node found at port '/dev/ttyAMA0', count=6, API_level=35, baudrate=921600, fw_version=1.1.4, fw_type=STM32F1, fw_timestamp: Apr 27 2021 21:17:24 2024-10-26 11:56:47.771: serial_node [INFO] Receiver modules found at slot positions: 1 2 3 4 5 6 2024-10-26 11:56:47.794: main [INFO] Number of nodes found: 6 2024-10-26 11:56:48.435: Plugins [INFO] Loaded module bme280_sensor 2024-10-26 11:56:48.460: Plugins [INFO] Loaded module ina219_sensor 2024-10-26 11:56:48.465: Plugins [INFO] Loaded module linux_sensor 2024-10-26 11:56:48.492: ina219_sensor [INFO] INA219 found at address 0x40 ('Battery') 2024-10-26 11:56:48.496: linux_sensor [INFO] Core temperature available 2024-10-26 11:56:48.801: main [INFO] Set Profile to '1' 2024-10-26 11:56:49.193: RHRace [INFO] Setting current heat to Heat 2 2024-10-26 11:56:49.356: calibration [INFO] Updated calibration with best discovered values 2024-10-26 11:56:49.575: calibration [INFO] Updated calibration with best discovered values 2024-10-26 11:56:54.472: VRxControl [INFO] VRx Control disabled: no registered controllers 2024-10-26 11:56:54.524: main [INFO] Running http server at port 5000 2024-10-26 11:56:54.632: plugins.rh_connector_trackside [INFO] Initializing Trackside connector 2024-10-26 11:56:54.633: plugins.pilot_csv_importer [INFO] Starting Pilot CSV Importer plugin 2024-10-26 11:56:54.646: RHUtils [ERROR] Exception via catchLogExceptionsWrapper Traceback (most recent call last): File "/home/sgdc/RotorHazard/src/server/RHUtils.py", line 283, in wrapper return func(*args, **kwargs) File "/home/sgdc/RotorHazard/src/server/eventmanager.py", line 89, in run_handler return handler(args) File "/home/sgdc/RotorHazard/src/server/plugins/stream_overlays/init.py", line 45, in create_panels self._rhapi.ui.register_panel( TypeError: register_panel() got an unexpected keyword argument 'open' 2024-10-26 11:56:55.283: RHUtils [ERROR] Exception via catchLogExceptionsWrapper Traceback (most recent call last): File "/home/sgdc/RotorHazard/src/server/plugins/MultiGP_Toolkit/multigpAPI.py", line 34, in _request_and_download returned_json = json.loads(response.text) File "/usr/lib/python3.9/json/init.py", line 346, in loads return _default_decoder.decode(s) File "/usr/lib/python3.9/json/decoder.py", line 337, in decode obj, end = self.raw_decode(s, idx=_w(s, 0).end()) File "/usr/lib/python3.9/json/decoder.py", line 355, in raw_decode raise JSONDecodeError("Expecting value", s, err.value) from None json.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 0)

During handling of the above exception, another exception occurred:

Traceback (most recent call last): File "/home/sgdc/RotorHazard/src/server/RHUtils.py", line 283, in wrapper return func(args, kwargs) File "/home/sgdc/RotorHazard/src/server/eventmanager.py", line 89, in run_handler return handler(args) File "/home/sgdc/RotorHazard/src/server/plugins/MultiGP_Toolkit/RHmanager.py", line 75, in startup self.verify_creds() File "/home/sgdc/RotorHazard/src/server/plugins/MultiGP_Toolkit/RHmanager.py", line 144, in verify_creds self._chapter_name = self.multigp.pull_chapter() File "/home/sgdc/RotorHazard/src/server/plugins/MultiGP_Toolkit/multigpAPI.py", line 53, in pull_chapter returned_json = self._request_and_download(url, json_request) File "/home/sgdc/RotorHazard/src/server/plugins/MultiGP_Toolkit/multigpAPI.py", line 38, in _request_and_download return returned_json UnboundLocalError: local variable 'returned_json' referenced before assignment 2024-10-26 11:57:06.262: plugins.OBS_Websocks [INFO] OBS Server is not active *** 2024-10-26 12:00:06.002: BaseHardwareInterface [INFO] Interface: Starting background thread 2024-10-26 12:00:28.096: RHRace [INFO] Current laps cleared 2024-10-26 12:00:28.443: RHData [INFO] Database heats reset 2024-10-26 12:00:28.492: RHData [INFO] Database race classes reset 2024-10-26 12:00:28.610: RHData [INFO] Database saved races reset 2024-10-26 12:00:28.613: RHRace [INFO] Setting current heat to Heat 0 2024-10-26 12:00:28.638: Results [INFO] Waiting for previous invocation of 'calc_leaderboard()' to finish 2024-10-26 12:00:28.705: Results [INFO] Waiting for previous invocation of 'calc_leaderboard()' to finish 2024-10-26 12:00:29.696: Results [INFO] Previous invocation of 'calc_leaderboard()' finished; continuing 2024-10-26 12:00:29.730: PageCache [INFO] T256: Built results data in: 0.374893s 2024-10-26 12:00:29.804: Results [INFO] Previous invocation of 'calc_leaderboard()' finished; continuing 2024-10-26 12:02:45.785: main [INFO] Sensor snapshot: 2024-10-26 12:02:45.786: main [INFO] Battery: {'current': {'value': 460.04878048780483, 'units': 'mA'}, 'power': {'value': 5879.0243902439015, 'units': 'mW'}, 'voltage': {'value': 12.54, 'units': 'V'}} 2024-10-26 12:02:45.787: main [INFO] Core: {'temperature': {'value': 37.552, 'units': '°C'}} 2024-10-26 12:05:20.241: main [INFO] Sensor snapshot: 2024-10-26 12:05:20.242: main [INFO] Battery: {'current': {'value': 450.8536585365853, 'units': 'mA'}, 'power': {'value': 5821.463414634145, 'units': 'mW'}, 'voltage': {'value': 12.552, 'units': 'V'}} 2024-10-26 12:05:20.243: main [INFO] Core: {'temperature': {'value': 41.856, 'units': '°C'}}

Aaronsss commented 2 hours ago

hmm I think someone regenerated out api key. Updating it seems to have resolve the issue but might be good to have a more useful warning to the user