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

Thread: OSCuino library and SlipOSC support for Teensy3

  1. #1
    Junior Member
    Join Date
    Oct 2012
    Posts
    16

    OSCuino library and SlipOSC support for Teensy3

    I am keen to port this library so it compiles on the Teensy3.

    https://github.com/snowshow/oscuino

    I get "fatal error: usb_api.h: No such file or directory".

    Click image for larger version. 

Name:	Screenshot-Error.png 
Views:	375 
Size:	48.6 KB 
ID:	30

    I have tried to replace usb_api.h with usb_serial.h but it will take more than that.
    The library tests for (CORE_TEENSY) but needs to test for T3 and point to the correct headers.

    For anyone interested in using OSCuino click here

    It works a treat on the Teensy 2++. (using HardwareSerial.h)

    "The SLIPSerial object has the same methods as the Serial object with an additional endTransmission method which sends the “End Of Transmission” character (octal 300) which is the message delimiter for the SLIP encoding."

    I am hoping it is an easy fix as Serial already works great on the T3.

    I have attached a copy of the library and code below
    Attached Files Attached Files

  2. #2
    Senior Member
    Join Date
    Mar 2013
    Posts
    126
    I just sent an alpha version of oscuino for Teensy 3.0 to CNMAT's release process.
    Oscuino has to be tested on a rather large number of platform/device combinations so if you need a copy earlier
    please e-mail me: adrian@cnmat.berkeley.edu.

    Added PD example and teensy 3.0 touch example.
    Still intensely testing and polishing...
    Last edited by adrianfreed; 04-10-2013 at 05:17 PM.

  3. #3
    Senior Member PaulStoffregen's Avatar
    Join Date
    Nov 2012
    Posts
    20,576
    Great news. Please let me know when it's released? I'll delete the not-so-great ArduOSC and replace it with Oscuino.

  4. #4
    Senior Member
    Join Date
    Mar 2013
    Posts
    126
    Thanks Paul,
    The timeline I am looking at is next week for the current version and then a better version we are working on in parallel that uses malloc and realloc instead of static buffers.
    This latter one will be the one to look at to replace the basic libraries floating around.

  5. #5
    Senior Member
    Join Date
    Mar 2013
    Posts
    126
    We are still a few days away. The api has stabilized, we are using dynamic memory allocation now. The holdup is the multiplatform support and testing.
    For example I spent the whole morning sorting out the various USB serial libraries. I hope there is a goal to harmonize these in a later release of Arduino. There are at least
    three header files for USB serial that I have to conditionally select for, Teensy 3, teensy 2, Leonardo. I haven't looked at the Due at all...

    I also found to my surprise that the Leonardo header file lacks some basics, i.e.
    #define analogInputToDigitalPin(p) (p+18)
    static const int LED_BUILTIN=13;
    I am not sure these are the correct values yet.

  6. #6
    What's the status of this? I'm trying out an example OSC sketch on a Teensy 3.1 and getting the same error:


    In file included from /home/james/data/vendor/arduino-1.0.5/libraries/OSC/SLIPEncodedUSBSerial.cpp:1:0:
    /home/james/data/vendor/arduino-1.0.5/libraries/OSC/SLIPEncodedUSBSerial.h:22:21: fatal error: usb_api.h: No such file or directory
    compilation terminated.

  7. #7
    Senior Member
    Join Date
    Jan 2013
    Posts
    966
    I believe that there is a fix in SLIPEncodedUSBSerial.h needed to include the chip for the Teensy 3.1.
    It currently contains this section:

    Code:
    ifdef OSC_HASUSBSERIAL
    //import the serial USB object
    #if defined (__MK20DX128__) || defined(BOARD_maple_mini)
    #include <usb_serial.h>
    #elif defined(CORE_TEENSY)
    #include <usb_api.h>
    #elif defined(__SAM3X8E__)
    #include <USB/USBAPI.h>
    #elif defined(__PIC32MX__)
    #include "HardwareSerial.h"
    #elif defined(__AVR_ATmega32U4__)
    // leonardo
    #include "Platform.h"
    #include "USBAPI.h"
    #include <avr/wdt.h>    
    #else
    #error Unknown USB port
    #endif
    This causes to #include <usb_api.h> instead of #include <usb_serial.h>

    Change the third line to:

    Code:
    #if defined (__MK20DX128__) || defined (__MK20DX254__) || defined(BOARD_maple_mini)
    That should include the correct line.
    Last edited by Headroom; 05-28-2014 at 12:56 AM.

  8. #8
    Thanks for the reply. I tried the line change but now get this:

    Code:
    In file included from /home/james/data/vendor/arduino-1.0.5/libraries/OSC/SLIPEncodedSPISerial.cpp:1:0:
    /home/james/data/vendor/arduino-1.0.5/libraries/OSC/SLIPEncodedSPISerial.h:13:23: fatal error: StreamSPI.h: No such file or directory
    compilation terminated.

  9. #9
    Senior Member
    Join Date
    Jan 2013
    Posts
    966
    The streamSPI code is for Arduino Yun with a special driver.
    SLIPEncodedUSBSerial works fine though. I believe however that you cannot use debugging through the USBSerial at the same time by Serial.print("something");

    Also works nicely with Ethernet/UDP using a WIZ820io but about 3 times slower.

    Could you post code ?

    Please use the code brackets - Hash tag in the "Go Advanced" editing options.

  10. #10
    Senior Member
    Join Date
    Jan 2013
    Posts
    966
    This was just posted on GIThub:

    For anyone else who has this problem: You need to remove the files SLIPEncodedSPISerial.h and SLIPEncodedSPISerial.cpp. There was a previous issue (#12) related to this that was closed but those files are still in the repo.

  11. #11
    I posted that. And that's no longer required if you update the repo since the offending files are now removed.

    The code that wasn't compiling was one of the OSC exmples, UDPSendMessage.ino

    Thanks!

  12. #12
    Junior Member
    Join Date
    Oct 2012
    Posts
    16

    SLIPEncodedUSBHostSerial SLIPSerial using usbhost_36.h USBSerial

    I am using an esp32 to send SLIPSerial to my Teensy3.6

    It works great for HardwareSerial but I would like to use it via USB Host of the 3.6.

    I needed a version of SLIPSerial that works with the "USBSerial" data type from usbhost_36.h
    Support was added for my CP210x driver by Kurt and Paul

    I wrote another version called SLIPEncodedUSBHostSerial

    Just add these files to the OSC library folder

    Now we can add WiFi and OSC to a Teensy 3.6 via USBSerial
    Attached Files Attached Files

  13. #13
    Senior Member
    Join Date
    Mar 2013
    Posts
    126
    Quote Originally Posted by viclabs View Post
    I am using an esp32 to send SLIPSerial to my Teensy3.6

    It works great for HardwareSerial but I would like to use it via USB Host of the 3.6.

    I needed a version of SLIPSerial that works with the "USBSerial" data type from usbhost_36.h
    Support was added for my CP210x driver by Kurt and Paul

    I wrote another version called SLIPEncodedUSBHostSerial

    Just add these files to the OSC library folder

    Now we can add WiFi and OSC to a Teensy 3.6 via USBSerial
    Thanks very much.
    I will take a look with an eye to folding this functionality into the next release of the library.

  14. #14
    Senior Member
    Join Date
    Mar 2013
    Posts
    126
    As some of you have noticed I put some love into the OSC library last week, catching up with platforms, arduino IDE etc.
    It now works with Zero based ARM, PIC32 and I believe it now has improved support for Teensy. Releases are picked up by the
    Arduino library manager.

  15. #15
    Senior Member
    Join Date
    Mar 2013
    Posts
    126
    I folded your changes into the the regular SLIPEncodedUSBSerial. The idea is that you just include Paul's host library header file before the OSC one and it makes the appropriate changes. Unfortunately I can't test it this week asI have to put all the appropriate hardware together. viclabs, can you share a simple sketch that demonstrates your use case?

  16. #16
    Junior Member
    Join Date
    Oct 2012
    Posts
    16
    I will do a simple example this week

    My 3.6 is debugging to Kurts dma multi spi tft custom library
    The esp32 has a standard i2c oled builtin.

    I will do a version to the serial monitor for both that are trimmed down.
    I will also test it on the nodemcu esp8266. should work with all other teensy's too

    Thanks for including the modification.

Tags for this Thread

Posting Permissions

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