arjenv / Boss-ME5-MIDI-Editor

Javascripted webinterface MIDI control
GNU General Public License v3.0
5 stars 0 forks source link

raspberry pi image #1

Open henkhoftijzer opened 2 months ago

henkhoftijzer commented 2 months ago

Hello Arjen,

Regards, Henkj.

arjenv commented 2 months ago

Hi Henk I need to look into the uSD card. My SD card probably has some secret info like WIFI SSID and password I do not want to publish.

The MIDI interface is defined as an optical interface. That means that there is no electrical connection between two MIDI apparatus (or any other). I bought mine probably some 10 years ago from ebay or Ali. The one I got did not have the optical component (optocoupler), however, there was clearly space reserved for such a device so I added it myself. There are a lot of complaints about these cheap interfaces on the net. Mine is working good.

I am in the midst of converting this program to an ESP8266. I think that will make things easier. You would need an ESP8266, and a MIDI shield (Arduino). Due to too many projects at the moment, however, this will take some time.

Regards Arjen

henkhoftijzer commented 1 month ago

Hello Arjen

WIth some delay... thanks for your reply.

I have setup a raspberry pi two, got the webserver and website up and running and can access it from my ipad. The pogram is running and reacting to inputs, but is unable to detect my ME-5. The program also displays a no hardware port message.

Regards Henk

arjenv commented 1 month ago

Hi Henk Not sure whether you can rename me-5-usb.html to index.html, some other link might be hardcoded to that. First try and get it up and running, then you could try and rename that file. The midicable does not have to be set up in the code.

As for troubleshooting have a look at amidi. my code uses it too in the PHP files.

In the command line try amidi -l

It returns the hardware if found and the port used

Not sure but you could try and run the PHP file in the php directory from the command line:

php detect_ME5.php or php php/detect_ME5.php

let me know the output(s). You may have to setup some user rights.

Regards Arjen

henkhoftijzer commented 1 month ago

Hello Arjen,

Thanks for your reply. To go over your suggestions one by one:

Regards Henk (I think we both are from the Netherlands) nohardwareport phpdetecterror amidi

arjenv commented 1 month ago

Hi Henk. Yep we're both from the Netherlands, but I'd like to keep this response international so others could possibly benefit from the answers.

What I see from your last post is this:

We'll have to go into some deeper debugging:

Just to make sure PHP is up and running type

php -v

(-v = version)

should output something like:

PHP 7.0.27-0+deb9u1 (cli) (built: Jan 5 2018 13:51:52) ( NTS ) Copyright (c) 1997-2017 The PHP Group Zend Engine v3.0.0, Copyright (c) 1998-2017 Zend Technologies with Zend OPcache v7.0.27-0+deb9u1, Copyright (c) 1999-2017, by Zend Technologies

Then try the following:

amidi -p hw:2,0,0 -S "F0 41 00 1F 11 10 00 7F 7F 00 F7" -d

It should output a lot of HEX values often started with F0. This command might 'hang' in the end so press CTRL and C same time. In my case it then responds with '2240 bytes read'. For your information: these are all the values stored in the ME5 of your settings. If that works you do have contact with the ME5 and it does respond as expected.

Now go into /var/www/html/php

Copy detect_ME5.php to some other filename, e.g. henk.php (should end in .php) (cp detect_ME5.php henk.php)

Edit that file. I like vi but most people will use nano.

Wherever it says

// echo ... (something)

remove the '//' (=comment)

EXCEPT for the last few lines in the pogram:

// $hexvalues = explode(" ", $response);

// echo print_r($hexvalues); // echo json_encode($hexvalues);

Just leave these as is.

Then try again:

php henk.php

And send me the output. I may find out what is wrong. Probably some user rights.

Still with me? :-)

henkhoftijzer commented 1 month ago

Hello Arjen,

Yes, I'm still with you.

So clearly no contact with the ME-5 and no use in going any further than that.

Regards, Henk

phpcheck amidi

arjenv commented 1 month ago

mmh Starting to suspect your Midi interface.

arjenv commented 1 month ago

What kind of midi I/F you got? You might have the two DIN plugs in the back of the ME5 the other way around? try to switch these. Midi is pretty ambiguous about that, Midi out should be connected to Midi in and vice versa.

arjenv commented 1 month ago

This is my rig:

20241023_215756

arjenv commented 1 month ago

The black box upper left (Old Philips power supply box) is my raspberry. The black blob just left of the Seiko tuner is my Midi interface unit.

henkhoftijzer commented 1 month ago

Hey Arjen,

Maybe it's my midi interface that's not compatible. I didn't know what you meant with "an optical interface" (and couldn't find anything about that on the internet) and got one localy secondhand. I have something visual similair to what you have, but probably a different brand and model with a different chip. I'll send you picture's tomorrow.

The plugs are inserted in the correct port... they have been switched back and forth during the last testing to make shure I didn't make a logical error. And after cleaning the in- and output with contact spray (again, after buying it a couple of months ago) the same testing was done again.

Do you know the brand, model and/or chip of yours?

arjenv commented 1 month ago

20241024_054836

arjenv commented 1 month ago

There are no markings further on my Midi interface.

arjenv commented 1 month ago

Maybe your Midi IF can send but not receive.

try the following command to change patch to the 3rd :

amidi -p hw:2,0,0 -S "C0 02" -d

(zero's between the quotes C0 02 == C-zero zero-two)

The 02 is the patchnumber so if that works try another number (in hex) like "0F". Your patchnumber should change.

henkhoftijzer commented 1 month ago

Hello Arjen,

That isn't doing anything either. I think the best thing to do is to find another midi-usb cable. For your (and others) information I have added two pictures of my midi-cable (front and back)... for now "questionable" but maybe soon to be confirmed as "not working"

midicable1 midicable2

henkhoftijzer commented 1 month ago

... and offcourse thanks for your help so far.

regards, Henk

henkhoftijzer commented 3 weeks ago

Hello Arjen,

New developments:

I saw you're midicable and I recognised the markings from some webshops, including Aliexpress.

I got another usb-midicable (see picture) with the same negative results, but...

midimate amidicommand amidibuttonpress

arjenv commented 3 weeks ago

Ok, one step at a time apparently.. Let me check my setup. Quoting Arnold: I'll be back (you imagine the Austrian accent yourself) :-)

arjenv commented 3 weeks ago

Could you check the following:

Go into the /var/www/html directory cd /var/www/html

Then list all files: ls -all

(these are all letters as in Luke Susan (minus) Albert Luke Luke) It should return something like this:

drwxrwxrwx 9 www-data www-data 4096 Mar 14 2023 . drwxrwxrwx 3 root root 4096 Mar 4 2018 .. drwxr-xr-x 3 www-data www-data 4096 Mar 4 2018 browser -rw-r--r-- 1 www-data www-data 1016 Mar 4 2018 CC.php drwxr-xr-x 3 www-data www-data 4096 Mar 4 2018 css -rw-r--r-- 1 www-data www-data 3641 Mar 4 2018 directory.html -rw-r--r-- 1 www-data www-data 227 Mar 4 2018 dirscandir.php drwxr-xr-x 2 www-data www-data 4096 Mar 4 2018 dump -rw-r--r-- 1 www-data www-data 880 Mar 4 2018 getsetmidi.php -rw-r--r-- 1 www-data www-data 455 Mar 4 2018 getsetmidi.php~ -rw-r--r-- 1 www-data www-data 1351 Mar 4 2018 gettemp.php -rw-r--r-- 1 www-data www-data 10701 Mar 4 2018 index.apache -rw-r--r-- 1 pi pi 18288 Mar 14 2023 index.html -rw-r--r-- 1 www-data www-data 72 Mar 4 2018 index.php drwxr-xr-x 2 www-data www-data 4096 Oct 6 2019 js -rw-r--r-- 1 www-data www-data 16770 Mar 4 2018 me25.html -rw-r--r-- 1 www-data www-data 4333 Mar 4 2018 me25readpatch_viacat.php -rw-r--r-- 1 www-data www-data 7511 Mar 4 2018 me-5-CC.html -rw-r--r-- 1 www-data www-data 18125 Apr 28 2018 me-5.html -rw-r--r-- 1 www-data www-data 6708 Mar 4 2018 me-5.html~ -rw-r--r-- 1 www-data www-data 5160 Mar 4 2018 me5.php -rw-r--r-- 1 www-data www-data 561 Mar 4 2018 me5up.php -rw-r--r-- 1 www-data www-data 18288 Nov 7 2018 me-5-USB.html -rw-r--r-- 1 www-data www-data 10701 Mar 4 2018 orgapacheindex.html drwxr-xr-x 2 www-data www-data 4096 May 29 2021 php -rw-r--r-- 1 www-data www-data 20 Mar 4 2018 phpindex.php -rw-r--r-- 1 www-data www-data 358 Mar 4 2018 piet.html -rw-r--r-- 1 www-data www-data 2685 Mar 4 2018 probeerdit.php -rw-r--r-- 1 www-data www-data 3549 Mar 4 2018 standalonegetallME25.php -rwxrwxrwx 1 pi pi 1077 Mar 4 2018 standalonegetallME5.php -rw-rw-r-- 1 pi pi 3239 Nov 3 2018 standalonegetallME5_USB.php drwxr-xr-x 4 www-data www-data 4096 Mar 4 2020 syx drwxrwxr-x 4 pi pi 4096 Oct 2 2019 .Trash-1000 -rw-r--r-- 1 www-data www-data 30 Mar 4 2018 whoami.php

Never mind the extra files I have in this directory, I tried several solutions one or the other way. The most important thing is that the owner is www-data.

Then edit a short PHP file: nano whoami.php

And enter the following lines:

<?php
echo exec('whoami');
?>

Save it. Do an ls -all and check the owner of this file whoami.php. If it is not www-data:www-data then you have to change the owner:

sudo chown www-data:www-data whoami.php

check again with ls -all

Now take another pc/phone/tablet and open the webpage on your raspberry, you'll need its IP address. I Hope the raspberry is somehow connected to your home network?

In my case the IP is 192.168.1.93

In the webbrowser URL field I type 192.158.1.93/whoami.php

It should return www-data

To think of it now, I saw one of the 1st pictures you posted that you are running the website from the raspberry itself. I have not tested that, might give problems so first try and connect from outside the raspberry.

henkhoftijzer commented 3 weeks ago

Hello Arjen,

I'm doing it step by step:

ls -all doesn't give me a complete file list, but just a fragment (see lsall_2.jpg). Except for the syx directory all other owners are root, not www-data.

It went into the php directory and ran ls-all again (see lsall_1.jpg), with the same result... root owner instead of www-data.

So I need to change the owner of the entire /var/www/html directory to www-data as a first step.

I have tried te webpage on earlier testing occasions on my ipad, so not only directly from the raspberry pi.

regards, Henk

lsall_2

lsall_1

henkhoftijzer commented 3 weeks ago

... and after changing the owner to www-data of (almost) all files and subfolders to www-data, it looks like this:

ls-all-R_01 ls-all-R_02

regards, Henk

arjenv commented 3 weeks ago

Well... Did that work?

I think you have to change the owner/group of the syx directory

sudo chown -R www-data:www-data /var/www/html/syx

check your groups as well: (guess your username is henk so where it says pi type henk)

groups pi
pi : pi adm dialout cdrom sudo audio video plugdev games users input netdev spi i2c gpio

and

groups www-data
www-data : www-data dialout audio
henkhoftijzer commented 3 weeks ago

It was late when I changed the owner and today was busy, so I haven't tested it yet. I will change the syx directory on the next occasion. And I was also thinking about my default user not being www-data... so as your mentioned that has to be checked and (probably) corrected too...

regards, Henk

arjenv commented 2 weeks ago

The default user does not have to be www-data. That is the user when you login to the webpage. My username is 'pi' on the raspberry and that works fine.

henkhoftijzer commented 5 days ago

Hello Arjen,

I had a bit of time and found some new energy and gave it anohter trie. I've changed the syx folder owner to www-data and I've added www-data to the audio subgroup (was missing). Again no succes when running the site localy or on my ipad, and switching between both usb-midi cables . The message "no hardware found" is now replaced by "trying to connect".

I leave it as it is for now, because it takes too much time and causes too much frustration right now. I have to dive too deep into unknown territory for me, where I just want to be able to control my ME-5 and create the patches I need.

regards Henk

arjenv commented 5 days ago

Thanks for trying. I was hoping you would get it operable. Alas.