rppicomidi / midi2usbhub-web

A Pico W interconnects USB MIDI devices and 2 old school MIDI ports with web browser routing control
MIT License
4 stars 0 forks source link

Almost afraid to ask.... #1

Closed maarthome closed 4 months ago

maarthome commented 1 year ago

I am new in the world of raspberry c programming. And I am a little bit hesitant to dare to ask why compilation is not successfull. It seems to me that a variable is not declared. Which is almost impossible to be the root cause since the code was compiled by you. This is my error message (working on WSL windows 11): Scanning dependencies of target midi2usbhub

[ 10%] Building CXX object CMakeFiles/midi2usbhub.dir/midi2usbhub.cpp.obj In file included from /mnt/d/Linux/microcontrollers/RaspBerry/PICO/midi2usbhub-web/midi2usbhub.cpp:39: /mnt/d/Linux/microcontrollers/RaspBerry/PICO/midi2usbhub-web/ext_lib/fatfs/source/diskio.h:136:44: error: 'tuh_msc_complete_data_t' has not been declared bool msc_fat_complete_cb(uint8_t dev_addr, tuh_msc_complete_data_t const* cb_data); ^~~~~~~ make[2]: [CMakeFiles/midi2usbhub.dir/build.make:91: CMakeFiles/midi2usbhub.dir/midi2usbhub.cpp.obj] Error 1 make[1]: [CMakeFiles/Makefile2:1964: CMakeFiles/midi2usbhub.dir/all] Error 2 make: *** [Makefile:103: all] Error 2 maart@MyAsusLaptop:/mnt/d/Linux/microcontrollers/RaspBerry/PICO/midi2usbhub-web/build$

rppicomidi commented 1 year ago

@maarthome Please never be afraid to ask, at least about my projects. I will always at least try to help, even if the problem is you. In this case, it was me. I was messing with the tinyusb library recently to update the MSC support; I updated this midi2usbhub-web code to match, and so I broke the build for everyone except me. Sorry. I hope you didn't waste too much time on this. It will take me some time to get the changes up to github and update the instructions for installing tinyusb.

rppicomidi commented 1 year ago

@maarthome I have pushed my code and updated the instructions for updating tinyusb in the README. Since you have already created a local branch called pr-midihost then you will need to delete the branch first, so for you the instructions are slightly different

cd ${PICO_SDK_PATH}/lib/tinyusb
git branch -d pr-midihost
git remote add rppicomidi https://github.com/rppicomidi/tinyusb.git
git fetch rppicomidi
git checkout -b pr-midihost rppicomidi/pr-midihost

Please close this issue if this fixes it for you. Otherwise, tell me what is still broken and I will attempt to help further.

maarthome commented 1 year ago

Hi rppicomidi,

Thanks a lot!! It works now! Great peace of engineering... Chapeau! :-) The only issue left is the CLI interface. I get some kind of signal in the serial com terminal. (CLI is via uart0; pin 1 and 2 on the pico as designed... (?)). What are the settings? Should it be on a specific communication setting apart from 9600 b/s... parity of amount of data bits etc

Anyway, the CLI is just rge cherry on the cake. The web interface is in fact already enough :-)

Thanks again and I am cusious what you will create more.

Cheers, Maarten

rppicomidi commented 1 year ago

@maarthome Thank you very much for taking the time to report the build issue and letting me know it is fixed now. Many people will just move on.

CLI UART bit rate is the default rate for the tinyusb, 115200bps. If you dig for a bit through the code you can find the definition in ${PICO_SDK_PATH}/lib/tinyusb/hw/bsp/board.h, but I should really just put it in the README.md file. I hope that helps.

As to what else I have done, you can just look at my main GitHub page or look at this web site. I am bad at keeping my github.io page up to date though.

I am going to close this issue. If you have any other issues or if you have feature requests for this or other projects, please open a new issue.

ajackson99 commented 4 months ago

Hi @rppicomidi

Thanks for this great idea and your efforts!

i have a similar issue as @maarthome

The only issue left is the CLI interface. I get some kind of signal in the serial com terminal. (CLI is via uart0; pin 1 and 2 on the pico as designed... (?)). What are the settings? Should it be on a specific communication setting apart from 9600 b/s... parity of amount of data bits etc

Your other midi2usbhub project runs fine on my pico w. cli via uart - all fine...

But i do not have a display/hid on my Pico W. And i would like to configure the wifi connection stuff via uart-cli. After successfull compilation and build it seems not to be possible to communicate with the the pico.

Anyhow, it seems that this project is not intended to do this via the cli. So not really worth the effort, i think.

So my question is: Where in the sources could i define manually the wifi stuff (like ssid/pass, etc). So that the pico w can directly connect to my AP after flashing, without the need of the display?

rppicomidi commented 4 months ago

@ajackson99

If you do not have the OLED module wired, the code as written will hang up in a tight loop in the the Midi2usbhub class constructor around line 396

    while (success && render_done_mask != target_done_mask) {
        if (success) {
            success = oled_screen.task();
        }
    }

Have you tried to #ifdef 0 out lines 391-401 that involve initializing the oled_screen object? That may help you get a CLI prompt, but it may not totally fix your issue. I do not recall how many CLI commands expect to update the OLED module too. If you encounter other problems or if this suggestion still leaves you stuck, please let me know. If you have what you need, please close the issue.

I also want to say I am sorry for the delay in answering. I am always grateful to those who take the time to post issues. Please continue to post in this issue, but in the future, if you encounter a problem, may I ask you to create a new issue instead of posting to an old, closed issue? I reopened this issue, but I believe your problem is likely to be different from the original post. I am also not sure if you have solved your problem and left the issue closed, or just did not open it again.

ajackson99 commented 4 months ago

@rppicomidi

Thank you! your suggestion makes absolutely sense. Did not came in my mind looking for the OLED updates. Will try it out and report here back, asap. Of course, if i should find more cli commands, calling the OLED stuff, will let you know.

Please continue to post in this issue, but in the future, if you encounter a problem, may I ask you to create a new issue instead of posting to an old, closed issue?

Sorry, i thought it's related to @maarthome CLI mention, but of course - its more a generic Problem with the settings of the serial console params, than mine. I simply did not read careful enough. Will open a new issue next time if i should stuck anywhere. Looking forward to make your great idea running here too :-)

Thanks again you for your support and kindness.

maarthome commented 4 months ago

Great support and programming!! Thank you again!! πŸ‘ πŸ‘ πŸ‘ πŸ‘ πŸ‘ πŸ‘ πŸ‘ πŸ‘ πŸ‘ πŸ‘ πŸ‘ πŸ‘ πŸ‘ πŸ‘ πŸ‘ πŸ‘ πŸ‘ πŸ‘ πŸ‘ πŸ‘ πŸ‘ πŸ‘