Forum Rule: Always post complete source code & details to reproduce any issue!
Results 1 to 5 of 5

Thread: Teensy 4.1, NativeEthernet, and AppleMIDI Tx

  1. #1
    Junior Member
    Join Date
    Aug 2020
    Location
    New Jersey, USA
    Posts
    3

    Teensy 4.1, NativeEthernet, and AppleMIDI Tx

    Hi,

    I just received my Teensy 4.1 board with my Ethernet adapter, and I'd like to use AppleMIDI with it.

    I'm starting with AppleMIDI 2.1.0 examples/EthernetShield_NoteOnOffEverySec example code in Teensyduino 1.53.

    I changed
    Code:
    #define <Ethernet.h>
    to
    Code:
    #define <NativeEthernet.h>
    I set up a proper MAC address.

    I can connect to the Teensy 4.1 with my Mac's Audio MIDI Setup/MIDI Network Setup app.

    But the Note On/Note Off commands aren't making it to my Mac. If I look in Wireshark, all that is ever sent from the Teensy board are Synchronization messages.

    I traced that the messages are making it all the way down through Nativesocket.cpp. I can see both the correctly-sent Synchronization messages and the not-sent Note On/Note Off messages at this point. But from there it dives into the FNET library with fnet_socket_sendto(). Instrumenting the FNET library has proven difficult, since it has its own way of generating debugging messages, and it doesn't seem to be connected to Serial.

    Has anyone had any success with this combination (Teensy 4.1, NativeEthernet, and AppleMIDI)?

    Does anyone with FNET debug experience know how to generate debug messages from it? Maybe I have to use a hardware serial port instead of Serial?


    Thanks,

    Ag Primatic

    P.S. It looks like I can reliably receive AppleMIDI just fine. I made the same modifications to the EthernetShield_ReceivedRawMidiData, and I can see Note On and Note Off messages on the serial console.

  2. #2
    Senior Member vjmuzik's Avatar
    Join Date
    Apr 2017
    Posts
    640
    This does work, try updating the FNET and NativeEthernet libraries first.
    Click image for larger version. 

Name:	Screen Shot 2020-08-28 at 6.42.54 PM.jpg 
Views:	12 
Size:	134.0 KB 
ID:	21524

  3. #3
    Junior Member
    Join Date
    Aug 2020
    Location
    New Jersey, USA
    Posts
    3
    For my tests, I was using NativeEtherenet 1.0.1 and FNET 0.1.3 that were part of Teensyduino 1.53.

    I upgraded NativeEthernet to 1.0.3 from https://github.com/vjmuzik/NativeEthernet and got this compile error:
    Code:
    ~/Documents/Arduino/libraries/NativeEthernet/src/NativeEthernetClient.cpp:45:5: error: 'host_name' was not declared in this scope
         host_name = host;
         ^
    The version of FNET at https://github.com/vjmuzik/FNET is the same as what is packaged with Teensyduino 1.53

    Can you tell me what versions of NativeEthernet and FNET you're using?



    Thanks,

    Ag

  4. #4
    Senior Member vjmuzik's Avatar
    Join Date
    Apr 2017
    Posts
    640
    That was a compile error I just fixed, FNET has been updated a little bit just without a version change.

  5. #5
    Junior Member
    Join Date
    Aug 2020
    Location
    New Jersey, USA
    Posts
    3
    I upgraded NativeEthernet and FNET, and that fixed it.

    Thanks!


    Ag

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •