Duggle Posted April 25, 2013 Report Share Posted April 25, 2013 This post is motivated by the desire for simple, fast way of updating certain files in the MIOS Studio File Browser. While it's general use is fairly intuitive, when iterative upload of 3 files NGC, NGL, NGR is required for an intensive NG application development, it begins to seem very tedious. This is a request for a simple command line interface executable from batch files (or cross platform equivalent) to upload files either via MIOS Studio (which would be very nice) or not. Something like MSUpload.exe myfile.ngc default.ngc MSUpload.exe myfile.ngl default.ngl MSUpload.exe myfile.ngr default.ngr There may not be many voices calling for this, but if as it happens, there is the wherewithal to make implementing this, or a similar idea easy, I though I'd put it "out there". Quote Link to comment Share on other sites More sharing options...
TK. Posted April 26, 2013 Report Share Posted April 26, 2013 Well, a command line interface for MIOS Studio was on my TODO list since years, today I implemented it: Command Line Parameters: --help this page --version shows version number --batch don't open GUI --in=<port> optional search string for MIDI IN port --out=<port> optional search string for MIDI OUT port --device_id=<id> sets the device id, should be done before upload if necessary --query queries the selected core --upload_hex=<file> upload specified .hex file to core. Multiple --upload_hex allowed! --upload_file=<file> upload specified file to SD Card. Multiple --upload_file allowed! --send_syx=<file> send specified .syx file to core. Multiple --send_syx allowed! --terminal=<command> send a MIOS terminal command. Multiple --terminal allowed! --wait=<seconds> Waits for the given seconds. Usage Examples: MIOS_Studio --in=MIOS32 --out=MIOS32 starts MIOS Studio with MIDI IN/OUT port matching with 'MIOS32' MIOS_Studio --upload_hex=project.hex starts MIOS Studio and uploads the project.hex file immediately MIOS_Studio --batch --upload_hex=project.hex starts MIOS Studio without GUI and uploads the project.hex file MIOS_Studio --batch --upload_file=default.ngc --upload_file default.ngl starts MIOS Studio without GUI and uploads two files to SD Card (MIOS32 only) MIOS_Studio --batch --terminal="help" --wait=1 starts MIOS Studio, executes the "help" command in MIOS Terminal and waits 1 second for response NOTE: most parameters can be combined to a sequence of operations. E.g. upload a .hex file, upload files to SD Card, execute a terminal command and wait some seconds before exit. It doesn't match with your proposals... hope that you don't mind. E.g. specifiying the target file (+path) requires much more programming and testing effort at my side. If you want to use different file names, you would have to rename the files on your harddisk before upload. The command line extensions are perfectly working under MacOS and Linux, e.g.: macmini2:midibox_ng_v1 TK$ ../../../tools/mios_studio/Builds/MacOSX/build/Release/MIOS_Studio.app/Contents/MacOS/MIOS_Studio --batch --upload_hex=project.hex --upload_file=cfg/templates/lre8x2x4.ngc Waiting for first query. Operating System: MIOS32 Board: MBHP_CORE_LPC17 Core Family: LPC17xx Chip ID: 0x26113f37 Serial: #70E02121AE022535DBA7CCC47000005F Flash Memory Size: 524288 bytes RAM Size: 65536 bytes MIDIbox NG V1.025 © 2013 T.Klose Uploading project.hex... Reading project.hex Trying to contact the core... Upload in progress... project.hex contains 240996 bytes (942 blocks). 0 of 942 blocks (0%) 64 of 942 blocks (6%) 67 of 942 blocks (7%) 76 of 942 blocks (8%) 85 of 942 blocks (9%) 95 of 942 blocks (10%) 104 of 942 blocks (11%) 116 of 942 blocks (12%) 124 of 942 blocks (13%) 132 of 942 blocks (14%) 143 of 942 blocks (15%) 153 of 942 blocks (16%) 161 of 942 blocks (17%) 170 of 942 blocks (18%) 181 of 942 blocks (19%) 190 of 942 blocks (20%) 199 of 942 blocks (21%) 208 of 942 blocks (22%) 217 of 942 blocks (23%) 228 of 942 blocks (24%) 237 of 942 blocks (25%) 245 of 942 blocks (26%) 255 of 942 blocks (27%) 264 of 942 blocks (28%) 275 of 942 blocks (29%) 283 of 942 blocks (30%) 293 of 942 blocks (31%) 302 of 942 blocks (32%) 311 of 942 blocks (33%) 321 of 942 blocks (34%) 330 of 942 blocks (35%) 341 of 942 blocks (36%) 349 of 942 blocks (37%) 358 of 942 blocks (38%) 368 of 942 blocks (39%) 378 of 942 blocks (40%) 387 of 942 blocks (41%) 398 of 942 blocks (42%) 406 of 942 blocks (43%) 415 of 942 blocks (44%) 424 of 942 blocks (45%) 435 of 942 blocks (46%) 443 of 942 blocks (47%) 455 of 942 blocks (48%) 462 of 942 blocks (49%) 471 of 942 blocks (50%) 482 of 942 blocks (51%) 491 of 942 blocks (52%) 500 of 942 blocks (53%) 510 of 942 blocks (54%) 520 of 942 blocks (55%) 529 of 942 blocks (56%) 538 of 942 blocks (57%) 548 of 942 blocks (58%) 556 of 942 blocks (59%) 566 of 942 blocks (60%) 575 of 942 blocks (61%) 585 of 942 blocks (62%) 595 of 942 blocks (63%) 603 of 942 blocks (64%) 614 of 942 blocks (65%) 622 of 942 blocks (66%) 634 of 942 blocks (67%) 642 of 942 blocks (68%) 650 of 942 blocks (69%) 660 of 942 blocks (70%) 671 of 942 blocks (71%) 680 of 942 blocks (72%) 688 of 942 blocks (73%) 698 of 942 blocks (74%) 708 of 942 blocks (75%) 716 of 942 blocks (76%) 728 of 942 blocks (77%) 735 of 942 blocks (78%) 746 of 942 blocks (79%) 756 of 942 blocks (80%) 765 of 942 blocks (81%) 774 of 942 blocks (82%) 783 of 942 blocks (83%) 794 of 942 blocks (84%) 802 of 942 blocks (85%) 811 of 942 blocks (86%) 821 of 942 blocks (87%) 829 of 942 blocks (88%) 839 of 942 blocks (89%) 849 of 942 blocks (90%) 859 of 942 blocks (91%) 867 of 942 blocks (92%) 878 of 942 blocks (93%) 887 of 942 blocks (94%) 896 of 942 blocks (95%) 905 of 942 blocks (96%) 914 of 942 blocks (97%) 925 of 942 blocks (98%) 934 of 942 blocks (99%) 942 of 942 blocks (100%) Upload of 224768 bytes completed after 6.07s (36.16 kb/s) Waiting for reboot... [631821.499] [MBNG_LCD] no response from CLCD #2.1 [631821.499] [MBNG_LCD] no response from CLCD #3.1 [631821.500] [MBNG_LCD] no response from CLCD #4.1 [631821.500] [MBNG_LCD] no response from CLCD #5.1 [631821.513] Init DHCP [631821.613] [network_device_init] PHY initialized [631822.522] SD Card connected: [631822.541] [MBNG_FILE_C:16] ERROR: missing '=' after EVENT_LED ... # [631822.715] Init DHCP [631822.718] [MBNG_FILE_C] Event Pool Number of Items: 71 [631822.718] [MBNG_FILE_C] Event Pool Allocation: 3905 of 24576 bytes (15%) [631822.732] [MBNG_FILE_L] DEFAULT.NGL hasn't been changed; reading labels from existing DEFAULT.BIN file. [631822.739] [MBNG_FILE_L] 4 labels found in /DEFAULT.BIN file [631822.749] [MBNG_FILE_S] snapshot #0 not stored in /DEFAULT.NGS yet [631822.777] Values retrieved Operating System: MIOS32 Board: MBHP_CORE_LPC17 Core Family: LPC17xx Chip ID: 0x26113f37 Serial: #70E02121AE022535DBA7CCC47000005F Flash Memory Size: 524288 bytes RAM Size: 65536 bytes MIDIbox NG V1.025 © 2013 T.Klose Uploading cfg/templates/lre8x2x4.ngc... Uploading /lre8x2x4.ngc (21665 bytes) Uploading /lre8x2x4.ngc: 1024 bytes transmitted (4%, 4.4 kb/s) [631825.592] [FILE] Uploading /lre8x2x4.ngc with 21665 bytes Uploading /lre8x2x4.ngc: 2048 bytes transmitted (9%, 4.4 kb/s) Uploading /lre8x2x4.ngc: 3072 bytes transmitted (14%, 3.7 kb/s) Uploading /lre8x2x4.ngc: 4096 bytes transmitted (18%, 3.4 kb/s) Uploading /lre8x2x4.ngc: 5120 bytes transmitted (23%, 3.9 kb/s) Uploading /lre8x2x4.ngc: 6144 bytes transmitted (28%, 4.3 kb/s) Uploading /lre8x2x4.ngc: 7168 bytes transmitted (33%, 4.7 kb/s) Uploading /lre8x2x4.ngc: 8192 bytes transmitted (37%, 5.1 kb/s) Uploading /lre8x2x4.ngc: 9216 bytes transmitted (42%, 5.4 kb/s) Uploading /lre8x2x4.ngc: 10240 bytes transmitted (47%, 5.6 kb/s) Uploading /lre8x2x4.ngc: 11264 bytes transmitted (51%, 5.9 kb/s) [631827.284] [FILE] Upload of 21665 bytes in progress (47%) Uploading /lre8x2x4.ngc: 12288 bytes transmitted (56%, 6.1 kb/s) Uploading /lre8x2x4.ngc: 13312 bytes transmitted (61%, 6.2 kb/s) Uploading /lre8x2x4.ngc: 14336 bytes transmitted (66%, 6.4 kb/s) Uploading /lre8x2x4.ngc: 15360 bytes transmitted (70%, 6.6 kb/s) Uploading /lre8x2x4.ngc: 16384 bytes transmitted (75%, 6.7 kb/s) Uploading /lre8x2x4.ngc: 17408 bytes transmitted (80%, 6.9 kb/s) Uploading /lre8x2x4.ngc: 18432 bytes transmitted (85%, 7.0 kb/s) Uploading /lre8x2x4.ngc: 19456 bytes transmitted (89%, 7.1 kb/s) Uploading /lre8x2x4.ngc: 20480 bytes transmitted (94%, 7.2 kb/s) Uploading /lre8x2x4.ngc: 21504 bytes transmitted (99%, 7.3 kb/s) [631828.316] [FILE] Upload of 21665 bytes in progress (94%) Uploading /lre8x2x4.ngc: 21664 bytes transmitted (99%, 7.1 kb/s) Upload of /lre8x2x4.ngc (21665 bytes) completed in 3.3s (6.5 kb/s) [631828.703] [FILE] Upload of 21665 bytes finished. [631828.703] AUTOLOAD 'lre8x2x4' [631828.703] [MBNG_FILE_C] Event Pool Number of Items: 65 [631828.703] [MBNG_FILE_C] Event Pool Allocation: 3707 of 24576 bytes (15%) But the bad news: under Windows nothing is print out in the command shell! I don't want to release this extension in such an incomplete state, because the (Windows) user experience will be bad if they don't get any notification... It seems to be a known issue, but the workarounds are ugly: http://www.rawmaterialsoftware.com/viewtopic.php?f=2&t=9868 Windows hasn't been designed for the command line - continue to click on the tiles ;-) Best Regards, Thorsten. Quote Link to comment Share on other sites More sharing options...
Duggle Posted April 26, 2013 Author Report Share Posted April 26, 2013 TK, it looks brilliant, does this mean I have to buy a mac? (Now that is an ugly workaround! :D ) Is there an easy way of using the MIOS Studio console window for feedback? It's seems you've covered things very thoroughly. I could suggest some additional (future) functionality: the ability to specify screen position/size of MIOS Studio windows enable/disable virtual keyboard Window title caption etc. This allows to set up "instances" for different jobs, of which there are quite a few, now. Anyhow this is a very welcome development, let me know if there is any way I can help. Quote Link to comment Share on other sites More sharing options...
TK. Posted April 27, 2013 Report Share Posted April 27, 2013 There is unfortunately no robust way to use the console from where MIOS Studio has been started. I've tested the workaround to output text in a new console, this seems to work stable. In order to avoid, that the text messages get lost when the batch jobs have been executed, the console has to be closed with the enter key. It would be nice if you could test this at your side: -> http://www.ucapps.de/mios_studio/MIOS_Studio_2_4_5.zip Available options (inclusive the proposed ones): Command Line Parameters: --help this page --version shows version number --batch don't open GUI --in=<port> optional search string for MIDI IN port --out=<port> optional search string for MIDI OUT port --device_id=<id> sets the device id, should be done before upload if necessary --query queries the selected core --upload_hex=<file> upload specified .hex file to core. Multiple --upload_hex allowed! --upload_file=<file> upload specified file to SD Card. Multiple --upload_file allowed! --send_syx=<file> send specified .syx file to core. Multiple --send_syx allowed! --terminal=<command> send a MIOS terminal command. Multiple --terminal allowed! --wait=<seconds> Waits for the given seconds. --gui_x=<x>: specifies the initial window X position --gui_y=<y>: specifies the initial window Y position --gui_width=<width>: specifies the initial window width --gui_height=<height>: specifies the initial window height --gui_title=<name>: changes the name of the application in the title bar --gui_hide_monitors: disables the MIDI IN/OUT monitor when GUI is started --gui_hide_upload: disables the upload panel when GUI is started --gui_hide_terminal: disables the terminal panel when GUI is started --gui_hide_keyboard: disables the virtual keyboard panel when GUI is started Usage Examples: MIOS_Studio --in=MIOS32 --out=MIOS32 starts MIOS Studio with MIDI IN/OUT port matching with 'MIOS32' MIOS_Studio --upload_hex=project.hex starts MIOS Studio and uploads the project.hex file immediately MIOS_Studio --batch --upload_hex=project.hex starts MIOS Studio without GUI and uploads the project.hex file MIOS_Studio --batch --upload_file=default.ngc --upload_file=default.ngl starts MIOS Studio without GUI and uploads two files to SD Card (MIOS32 only) MIOS_Studio --batch --terminal="help" --wait=1 starts MIOS Studio, executes the "help" command in MIOS Terminal and waits 1 second for response NOTE: most parameters can be combined to a sequence of operations. E.g. upload a .hex file, upload files to SD Card, execute a terminal command and wait some seconds before exit. Best Regards, Thorsten. Quote Link to comment Share on other sites More sharing options...
Duggle Posted April 28, 2013 Author Report Share Posted April 28, 2013 I'm testing everything as thoroughly as I can (win7x64), so I'll report everything I notice: --version does not display if --help is a parameter (gui only) specifying midi in/out port works even on partial name match (but issues a warning), remember to enclose names with spaces in them with quotes ("My Midiport") --device_id did not recognise (I only tried 0, and "0") if --batch appears on command line after --in= and --out= then the console window is empty. --upload_hex== works fine. (I only used current directory as path) --upload_file= (multiple) works great! muliple --terminal= with multiple --wait== all works perfectly. All --gui_ parameters work as expected. I have a strange desktop. It consists of 2x22" flat lcds the left one is landscape, the right one is portrait. Like an "L" rotated left. The --gui_y=0 line is aligned with the top edge of the left monitor, so that the top third of the right monitor is unreachable (would require --gui_y=-400 to locate the gui there). I mention this as an interesting aside, if it bothers me, I'll change my monitor setup! All the --gui_hide_ functions work as expected. This is all just so incredibly welcome! It will really help my workflow in the NG applications development now and into the future. Also using multiple instances for various devices without having to constantly adjust the port and gui settings will be very good. Quote Link to comment Share on other sites More sharing options...
TK. Posted April 28, 2013 Report Share Posted April 28, 2013 Thanks for testing! :) I just have released the updated 2.4.5 binary --version does not display if --help is a parameter (gui only) unfortunately I can't prevent this, because the number of lines in the info window is limited, so that some lines are truncated E.g. "MIOS_Studio --version --help" will print the version at the top, but one additional line of the help page is missing... --device_id did not recognise (I only tried 0, and "0") now set before Query if --batch appears on command line after --in= and --out= then the console window is empty. the Windows console workaround is now applied when --batch is at any position in the command line, so that the ports should be displayed now. Best Regards, Thorsten. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.