OSK_C_TUTOR - Undefined Method "fsw_name"
After building the application from the GUI, I then attempt to run the osk_c_tutor app, but I run into the following problem:

This happened for all the lessons, I hoped that by the last lesson it would have fixed itself.
Do I need to add something to cfs/osk_defs/cfsat_cfe_es_startup.scr?
I was able to make some progress by adding the following line to my cfs/osk_defs/cfsat_cfe_es_startup.scr
CFE_APP, /cf/osk_c_tutor.so, OSK_C_DEMO_AppMain, OSK_C_DEMO, 90, 16384, 0x0, 0;
But that would make the cFS crash immediately when booted up.
So I swapped osk_c_tutor to osk_c_demo in cfs/osk_defs/targets.cmake:
SET(TGT1_APPLIST cfs_lib osk_c_fw kit_ci kit_sch kit_to tftp fm md mm osk_c_tutor example)
I also update the startup script accordingly,
CFE_APP, /cf/osk_c_demo.so, OSK_C_DEMO_AppMain, OSK_C_DEMO, 90, 16384, 0x0, 0;
Which would now allow for the cFS to boot up without crashing, but when I pressed the Screen button in the CFSAT OSK_C_LESSON_SCR window and the pressed the NOOP button to send a no-op command I got an error that said:
NoMethodError : undefined method: `send_cmd` for nil:NilClass
Does anyone know what I might be missing?
Carlos,
It's been a while since I've looked at osk_c_tutor. I should have time by the end of the week to dig into it.
- Dave
On Tue, May 2, 2023 at 10:04 PM Carlos A. Wong @.***> wrote:
I was able to make some progress by adding the following line to my cfs/osk_defs/cfsat_cfe_es_startup.scr
CFE_APP, /cf/osk_c_tutor.so, OSK_C_DEMO_AppMain, OSK_C_DEMO, 90, 16384, 0x0, 0;
But that would make the cFS crash immediately when booted up.
So I swapped osk_c_tutor to osk_c_demo in:
SET(TGT1_APPLIST cfs_lib osk_c_fw kit_ci kit_sch kit_to tftp fm md mm osk_c_tutor example)
Which would now allow for the cFS to boot up without crashing, but when I pressed the Screen button in the CFSAT OSK_C_LESSON_SCR window and the pressed the NOOP button to send a no-op command I got an error that said something along the lines of:
send_command is not defined for class nil:NilClass
— Reply to this email directly, view it on GitHub https://github.com/OpenSatKit/OpenSatKit/issues/111#issuecomment-1532370325, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAMGKCCOCLMJT4GDF2OXBWTXEG4MHANCNFSM6AAAAAAXS5JHRE . You are receiving this because you are subscribed to this thread.Message ID: @.***>
Thank you @dmccomas I will keep playing around with it and report back.
Turns out osk_c_tutor.so was crashing because I did not properly copy over some parts of the code.
I diff'd my src directory with the solutions of each lesson, updated each file accordingly and osk_c_tutor.so is no longer crashing immediately.
But I am still running into the issue when I press the Run button from the cFS via the CFSAT OSK_C_LESSON_SCR:
NoMethodError : undefined method: `fsw_name` for nil:NilClass
If I ignore the warning and then pressed the Screen button to open the OSK_D_DEMO DEMO_OPS_SCREEN and press the No Op button. I get the same error as before:
NoMethodError : undefined method: `send_cmd` for nil:NilClass
I verified that the osk_c_tutor app is working fine because I am able to open the Command Sender window and send a NOOP command to the app.
Then, from the Packet Viewer: Formatted Telemetry with Units window, I can see the OSK_C_DEMO HK_TLM_PKT valid command counter increase.
I can also see the cFS console window display the NOOP event message:
EVS Port1 42/1/OSK_C_DEMO 101: No operation command received for OSK_C_DEMO App version 1.6.0
So this seems like there is an issue with how the cosmos GUI is linking with the osk_c_tutor lesson plan.
If I press Ops Example from the OSK_D_DEMO DEMO_OPS_SCREEN window and then press Start the script progresses to line 131:
Osk::flight.send_cmd("OSK_C_DEMO", "NOOP")
Which is when I get the following error in the Script Output section:
2023/05/05 12:23:50.323 (osk_c_demo_ops_example.rb:131): ERROR: RuntimeError : Undefined application OSK_C_DEMO. Verify COSMOS target defined and target defined in ~/OpenSatKit-master/cosmos/config/targets/CFS_KIT/osk/cfs_kit.json
I get the same result if I swap the following two lines in the startup script:
CFE_APP, /cf/osk_c_demo.so, OSK_C_DEMO_AppMain, OSK_C_DEMO, 90, 16384, 0x0, 0;
!CFE_APP, /cf/osk_c_tutor.so, OSK_C_DEMO_AppMain, OSK_C_DEMO, 90, 16384, 0x0, 0;
Is there anything specific I need to add to that json file?
Okay I was able to fix the issue.
We need to add OSK_C_DEMO to the list associated with the app key in cosmos/config/targets/CFSAT/osk/cfsat.json
"apps": [ "FM", "KIT_CI", "KIT_SCH", "KIT_TO", "MD", "MM", "TFTP", "OSK_C_DEMO"]
Although, if you press the Run button from the CFSAT OSK_C_LESSON_SCR window, you will get the following error:
1980-012-14:03:56.12408 ES Startup: Could not load cFE application file:/cf/osk_c_demo.so. EC = 0xFFFFFFF1
EVS Port1 42/1/CFE_ES 26: Failed to start OSK_C_DEMO from /cf/osk_c_demo.so, RC = 0xC4000004
But, we should be okay since osk_c_tutor is currently loaded instead of the main demo app.
Note, I added both osk_c_tutor and osk_c_demo to my cfs/osk_defs/targets.cmake:
SET(TGT1_APPLIST cfs_lib osk_c_fw kit_ci kit_sch kit_to tftp fm md mm osk_c_tutor osk_c_demo example)
And I added the following two lines to my cfs/osk_defs/cfsat_cfe_es_startup.scr start up script:
CFE_APP, /cf/osk_c_tutor.so, OSK_C_DEMO_AppMain, OSK_C_DEMO, 90, 16384, 0x0, 0;
!CFE_APP, /cf/osk_c_demo.so, OSK_C_DEMO_AppMain, OSK_C_DEMO, 90, 16384, 0x0, 0;
After swapping, one for the other I rebuild the project with:
make install
Interestingly enough, if I swap to use osk_c_demo I still see the error. But I am still able to run the OSK_D_DEMO DEMO_OPS_SCREEN.
I was able to run through most of the Ops Example script except for the fact that the FILEMGR app was not loaded for both osk_c_demo and osk_c_tutor.
Thanks for the good detective work! I'm reopening the issue and will fix the "apps": [ "FM", "KIT_CI", "KIT_SCH", "KIT_TO", "MD", "MM", "TFTP", "OSK_C_DEMO"].
There's additional cleanup I need to do since I removed the sandbox target. Prior to the sandbox target removal, OSK_C_DEMO was delivered as part of the sandbox and OSK_C_TUTOR was developed within the context of the CFSAT target. Now only CFSAT exists so this strategy should be reworked within the context of a single CFSAT target.
Would you like for me to open a PR? Or is there something I can help you with?
Hi Carlos,
I reopened the issue hoping I would fix it and I appreciate the offer to help. It looks like I won't be able to maintain OpenSatKit for multiple reasons.
I'm still committed to cFS education and I've created a new tool called cFS Basecamp https://github.com/cfs-tools/cfs-basecamp and It will have coding exercises. I'm creating new videos that will be posted in the following channel: OpenSatKit - YouTube https://www.youtube.com/channel/UC2wfvAIkrrgyC4ITwL3zokg
Warm regards,
- Dave
On Wed, May 10, 2023 at 7:42 AM Carlos A. Wong @.***> wrote:
Would you like for me to open a PR? Or is there something I can help you with?
— Reply to this email directly, view it on GitHub https://github.com/OpenSatKit/OpenSatKit/issues/111#issuecomment-1542052960, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAMGKCABZRXTCDP3XKW73Q3XFN5KFANCNFSM6AAAAAAXS5JHRE . You are receiving this because you modified the open/close state.Message ID: @.***>
Thanks for the response, I will leave the PR open for now. I will try to get a PR out, if not I will close this issue.