OSCuino library and SlipOSC support for Teensy3

viclabs

Member
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".

Screenshot-Error.png

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
 

Attachments

  • SLIPOSC_T3.zip
    68.8 KB · Views: 290
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:
Great news. Please let me know when it's released? I'll delete the not-so-great ArduOSC and replace it with Oscuino.
 
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.
 
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.
 
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.
 
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__) [COLOR="#FF0000"]|| defined (__MK20DX254__)[/COLOR] || defined(BOARD_maple_mini)

That should include the correct line.
 
Last edited:
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.
 
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.
 
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.
 
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!
 
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
 

Attachments

  • SLIPEncodedUSBHostSerial.h
    2.5 KB · Views: 194
  • SLIPEncodedUSBHostSerial.cpp
    4.1 KB · Views: 140
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.
 
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.
 
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?
 
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.
 
Back
Top