lathoub / Arduino-AppleMIDI-Library

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

Teensy 4.1 example not sending messages (Only receiving) #107

Closed dani-carbonell closed 3 years ago

dani-carbonell commented 3 years ago

Context

- lathoub/AppleMIDI @ ^3.1.0
- Teensy 4.1 and ESP32
- MacOS 10.13.6 and Windows 10

Problem

The example "ESP32_NoteOnOffEverySec.ino" works as expected for me. The ESP32 sends and receives MIDI normally through WIFI.

If I try the "Teensy41_NoteOnOffEverySec.ino" I am not receiving any MIDI in my computers. When I send MIDI to the board there is no problem and I see the debug callbacks for the incoming MIDI notes.

I have tried the following setups:

Also tried to modify the .ino example:

None of the above made a difference.

I installed Wireshark and tried to see if there was any incoming packets at all but I am not familiar with this software yet and I couldn't figure out anything.

Can somebody reproduce this error? Thanks

lathoub commented 3 years ago

Indeed, i see the same error on my Teensy 4.1 - but same source code works on MKR1000 with Ethernet shield.

dani-carbonell commented 3 years ago

Does work with the MKR1000?

Could that library be the source of the problem? To my understanding that is the only difference of the Teensy 4.1 sketch. Let me know if should open this issue in "vjmuzik/NativeEthernet" repo.

lathoub commented 3 years ago

I fixed the issue (in Master) by moving beginPacket closer to the first write; but i have to admit i have no clue why it works, do you see why?

Please test @dani-carbonell

https://github.com/lathoub/Arduino-AppleMIDI-Library/blob/892c03ea9956aac4f623bf36abe594646373d627/src/AppleMIDI.hpp#L638-L648

dani-carbonell commented 3 years ago

Your commit 892c03e solved the issue for me as well. I have noticed the commit ae9daba is also related. Thanks for the fast fix!