lathoub / Arduino-AppleMIDI-Library

Send and receive MIDI messages over Ethernet (rtpMIDI or AppleMIDI)
Other
306 stars 66 forks source link

loses connection after 1 or 2 minutes (with a mac) #131

Closed folkertvanheusden closed 2 years ago

folkertvanheusden commented 3 years ago

Context

Describe your project and what you expect to happen:

As a test of a W5500 setup I took the example-code for the ESP32/W5500 combination. I enabled all logging and added a tiny bit of code to show the millis() for each logged line.

Describe your problem (what does not work):

I "boot" the wemos and let a Mac (macos x 10.7) connect to it via the midi-panel. Everything is connected directly via the same gigabit ethernet switch.

Now after a while (around 1 or 2 minutes) the communication stops with a timeout (the mac complains about that). After that, communication cannot be restarted (unless I reset the esp).

Steps to reproduce

I'll include my modified version and a logfile showing what is happening.

problem.zip

lathoub commented 3 years ago

I don't have an ESP32 and W5500 at hand, but a wESP32 is running happily for 30 minutes now (similar code).

You indicate Linux above, but talk about Mac (MacOS 10.7) - are you using Linux to talk to the ESP32?

folkertvanheusden commented 3 years ago

The Linux-system is for developing the code for the esp32 while the Mac is used to test against.

lathoub commented 3 years ago

What does Wireshark look like? (filter on rtpmidi || applemidi)

folkertvanheusden commented 3 years ago

Here it is! mac.pcap.zip

lathoub commented 3 years ago

Thanks @folkertvanheusden

Its looks like 151 (Mac) send Syncronization to 152 (Arduino), but does not get a response (message nr 1243), ultimately leading to the Mac Ending the session. Also, ReceiverFeedback is not written from the Arduino to you Mac.

Can you add some debugging statements in ReceivedSynchronization (n AppleMIDI.hpp) to check if the writeSynchronization is written.

Also add some debugging in manageReceiverFeedbackand manageSynchronization (to check is the code is called and what is written back)

lathoub commented 3 years ago

I modified the NoteOnOffEverySec example to send a note on/off every 50ms and receive MIDI notes from MIDI-OX at a high rate as well. Attached the Wireshark dump. AFAIK all is fine: Synchronisation is balanced an d ReceiverFeedback is also happening. Here is the dump: wsdump.zip (sort the Info column to see the groups of messages)

Are you running from fresh source code from the repo? (I know, silliy question, but it caught me multiple times in the past). Also: don't use Ethernet3, that is known to stall, use the vanilla Ethernet lib that ship with the IDE.

folkertvanheusden commented 3 years ago

Hi, I have not been near the Mac today unfortunately. Hopefully soon.

lathoub commented 3 years ago

@folkertvanheusden, any update on this issue?

folkertvanheusden commented 3 years ago

Hi,

No update yet, I've been busy with other things.

lathoub commented 2 years ago

@folkertvanheusden, i'm about to make this as stale, you can always reopen