feat: add Obico for Klipper to KIAUH #227
Reference in New Issue
Block a user
Delete Branch "moonraker_obico"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Hi @th33xitus, I think this PR is ready for review now. Sorry for the delay.
Here are a few areas that I will need your feedback on:
moonraker-obico[-xxx].service, which caused some problem with existing code. Since moonraker-obico has gone live for a while, I don't want to break the compatibility with the users already using it, I had to make changes here and here. The 2nd one is quite ugly. Let me know if you have a better idea.moonraker-obicocan be in an installed but *not linked" status. I made the change here and here. Again this is a bit of inverted dependency because nowmain_menu.shandinstall_menu.shdepend on functions inobico.sh. Will love to hear your feedback here too.Screenshots for single-instance installation:
Screenshots for multi-instance installation:
Hi @kennethjiang, on first glance it looks like its going into the right direction. I saw one or two oddities, but as you stated that this is a rough draft, i'll wait until you give the go for me to start the formal review.
For example:
.*wildcard in the regex here: https://github.com/th33xitus/kiauh/pull/227/files#diff-08e65de842c3dbbcc98be9e5467e5447241080fbb0bcb661f162d58df16e6a60R20This variable seems to be unused?
@@ -0,0 +92,4 @@### Step 1: Ask for the number of moonraker-obico instances to installif (( moonraker_count == 1 )); thenok_msg "Moonraker installation found!\n"new_moonraker_obico_count=1I'm unsure about the usage of this variable. It seems to be not used anywhere? Is it used somewhere else as it is not declared as a local variable?
@@ -0,0 +92,4 @@### Step 1: Ask for the number of moonraker-obico instances to installif (( moonraker_count == 1 )); thenok_msg "Moonraker installation found!\n"new_moonraker_obico_count=1Good catch. It's a bug! Do you want me to push this change?
Another good catch. I guess I planed to use it but ended up using
"${KLIPPER_LOGS}"directly. Feel free to remove it.@th33xitus I changed this PR based on our discussion and tested all the cases I can think of.
I found 1 bug: on the install_menu screen, if the user selects 1) [klipper], 2) [moonraker], and 9) [Obico for Klipper] without going back to the main screen, function
get_multi_instance_nameswill return an empty string.I did some debugging and found that
.kiauh.iniis not updated until the user goes back to the main screen. However, I struggled to figure out where I did wrong. Will appreciate it if you can provide some guidance here.Please also go over the code again, particularly commits
7837a78c4b,7837a78c4b, and8d284179d8I did some debugging and found that .kiauh.ini is not updated until the user goes back to the main screen. However, I struggled to figure out where I did wrong. Will appreciate it if you can provide some guidance here.
You didn't do any wrong. You actually pointed me to a maybe not so smart solution.
https://github.com/th33xitus/kiauh/blob/master/scripts/ui/main_menu.sh#L85
The
init_inifunction is called whenever the main menu is loaded.https://github.com/th33xitus/kiauh/blob/master/scripts/utilities.sh#L125
And in there the multi instance names are then written to the ini
https://github.com/th33xitus/kiauh/blob/master/scripts/utilities.sh#L189
Maybe it is smarter to factor
fetch_webui_portsandfetch_multi_instance_namesout of theinit_inifunction and place them both into theinstall_menufunction right afterinstall_ui. Both those fetch functions aquire data that is usually only used in installation functions, at least i can't think of any other usecases within the script right now.@kennethjiang so i just pushed a commit addressing the bug you mentioned.
I have a view comments to make on other pieces of the code, i quite don't understand yet.
Can this variable be local? Or is it required to be global? I see it only being used inside the
moonraker_obico_needs_linkingfunctionThis variable seems to be unused now?
See comment above :)
See comment above :)
@@ -0,0 +198,4 @@### Step 7: Link to the Obico server if necessarylocal not_linked_instances=()if (( moonraker_count == 1 )); thenif moonraker_obico_needs_linking "$(moonraker_obico_config 0)"; thenThe
moonraker_obico_configfunction defined in line 24 does not take in any arguments. So the0you pass there (and a few lines below the${i}) won't get used inside the function. Im not quite sure what the intention was, if the arguments are obsolete or if themoonraker_obico_configfunction is incomplete?@@ -0,0 +249,4 @@if (( moonraker_count == 1 )); thenstatus_msg "Link moonraker-obico to the Obico Server...""${MOONRAKER_OBICO_DIR}/scripts/link.sh" -q -c "$(moonraker_obico_config 0)"See comment above :)
@@ -0,0 +198,4 @@### Step 7: Link to the Obico server if necessarylocal not_linked_instances=()if (( moonraker_count == 1 )); thenif moonraker_obico_needs_linking "$(moonraker_obico_config 0)"; thenThis is a really good catch! The function
moonraker_obico_configis supposed to use${1}, not${i}. Not sure how my testing passed... Fixing it now.@@ -0,0 +198,4 @@### Step 7: Link to the Obico server if necessarylocal not_linked_instances=()if (( moonraker_count == 1 )); thenif moonraker_obico_needs_linking "$(moonraker_obico_config 0)"; thenShould be fixed in 276c123.
moonraker_obico_configshould take an argument, which is the index of a specific instance inmulti_instance_names