PDA

View Full Version : OSCuino library and SlipOSC support for Teensy3



viclabs
11-10-2012, 04:24 AM
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".

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 (http://cnmat.berkeley.edu/book/export/html/11389)

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

adrianfreed
04-01-2013, 09:17 PM
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...

PaulStoffregen
04-01-2013, 09:56 PM
Great news. Please let me know when it's released? I'll delete the not-so-great ArduOSC and replace it with Oscuino.

adrianfreed
04-01-2013, 10:02 PM
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.

adrianfreed
04-22-2013, 08:09 PM
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.

Neurogami
05-27-2014, 11:53 PM
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.

Headroom
05-28-2014, 01:49 AM
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:


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:


#if defined (__MK20DX128__) || defined (__MK20DX254__) || defined(BOARD_maple_mini)

That should include the correct line.

Neurogami
05-28-2014, 02:22 AM
Thanks for the reply. I tried the line change but now get this:


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.

Headroom
05-28-2014, 02:31 AM
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.

Headroom
05-28-2014, 02:38 AM
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.

Neurogami
05-28-2014, 04:07 PM
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!

viclabs
03-14-2018, 05:10 AM
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

adrianfreed
03-14-2018, 11:56 PM
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.

adrianfreed
03-14-2018, 11:57 PM
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.

adrianfreed
03-15-2018, 12:21 AM
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?

viclabs
03-16-2018, 05:43 AM
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.