Coder Social home page Coder Social logo

arduinoosc's Introduction

Top Langs github stats

arduinoosc's People

Contributors

cansik avatar hideakitai avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

arduinoosc's Issues

#include path typo

Hi,
in ArduinoOSC.h the 2 includes at the beginning have typo:

#include "ArduinoOSC/OscServer.h"
#include "ArduinoOSC/OscClient.h"

should be

#include "ArduinoOSC/OSCServer.h"
#include "ArduinoOSC/OSCClient.h"

Best,

support for RPI Pico W

Hi,
I'm testing ArduinoOSC on a Raspberry Pico W (w/ Arduino-Pico from Earl Philhower https://github.com/earlephilhower/arduino-pico) after quickly editing ArduinoOSCWiFi.h and adding the Pico platform to it:

defined(PICO_RP2040)

#if defined(ESP_PLATFORM) || defined(ESP8266) || defined(ARDUINO_AVR_UNO_WIFI_REV2) || defined(ARDUINO_SAMD_MKRWIFI1010) || defined(ARDUINO_SAMD_MKRVIDOR4000) || defined(ARDUINO_SAMD_MKR1000) || defined(ARDUINO_SAMD_NANO_33_IOT) || defined(PICO_RP2040)
#define ARDUINOOSC_ENABLE_WIFI
#endif

[...]


#elif defined(PICO_RP2040)
#include <WiFi.h>
#include <WiFiUdp.h>

It's kind of a dirty hack but I wanted to try your library. And it seems to work just fine. I'm not sure yet if there's anything else that needs to be modified to add full support for this board.

It's worth noting that I'm getting a compiler warning/error though (posted below). But I'm not sure it's totally related to ArduinoOSC yet.

defined(PICO_RP2040) is the only "define" I could find in the Pico SDK, I'm not familiar with these, perhaps there's a Define specific to identify the RPI Pico W (wifi). The cyw43 maybe.

/Users/matthias/Library/Arduino15/packages/rp2040/tools/pqt-gcc/1.4.0-c-0196c06/bin/arm-none-eabi-g++ -I /var/folders/cp/1rj8rlv11qb0v2srv_zph7mr0000gn/T/arduino_build_843132/core -c -Werror=return-type -DCFG_TUSB_MCU=OPT_MCU_RP2040 -DUSB_VID=0x2e8a -DUSB_PID=0xf00a "-DUSB_MANUFACTURER=\"Raspberry Pi\"" "-DUSB_PRODUCT=\"Pico W\"" -DPICO_CYW43_ARCH_THREADSAFE_BACKGROUND=1 -DCYW43_LWIP=0 -DLWIP_IPV6=0 -DLWIP_IPV4=1 -DLWIP_IGMP=1 -DLWIP_CHECKSUM_CTRL_PER_NETIF=1 "-DARDUINO_VARIANT=\"rpipicow\"" -march=armv6-m -mcpu=cortex-m0plus -mthumb -ffunction-sections -fdata-sections -fno-exceptions -DARM_MATH_CM0_FAMILY -DARM_MATH_CM0_PLUS -MMD -iprefix/Users/matthias/Library/Arduino15/packages/rp2040/hardware/rp2040/2.5.2/ @/Users/matthias/Library/Arduino15/packages/rp2040/hardware/rp2040/2.5.2/lib/platform_inc.txt -I/Users/matthias/Library/Arduino15/packages/rp2040/hardware/rp2040/2.5.2/include -fno-rtti -std=gnu++17 -g -pipe -DSERIALUSB_PID=0xf00a -DUSBD_MAX_POWER_MA=250 -DF_CPU=133000000L -DARDUINO=10819 -DARDUINO_RASPBERRY_PI_PICO_W "-DBOARD_NAME=\"RASPBERRY_PI_PICO_W\"" -DARDUINO_ARCH_RP2040 -Os -I/Users/matthias/Library/Arduino15/packages/rp2040/hardware/rp2040/2.5.2/cores/rp2040 -I/Users/matthias/Library/Arduino15/packages/rp2040/hardware/rp2040/2.5.2/variants/rpipicow -I/Users/matthias/Documents/Arduino/libraries/ArduinoOSC -I/Users/matthias/Library/Arduino15/packages/rp2040/hardware/rp2040/2.5.2/libraries/WiFi/src -I/Users/matthias/Library/Arduino15/packages/rp2040/hardware/rp2040/2.5.2/libraries/Updater/src -I/Users/matthias/Library/Arduino15/packages/rp2040/hardware/rp2040/2.5.2/libraries/MD5Builder/src -I/Users/matthias/Library/Arduino15/packages/rp2040/hardware/rp2040/2.5.2/libraries/Wire/src -I/Users/matthias/Library/Arduino15/packages/rp2040/hardware/rp2040/2.5.2/libraries/lwIP_Ethernet/src -I/Users/matthias/Library/Arduino15/packages/rp2040/hardware/rp2040/2.5.2/libraries/lwIP_CYW43/src -I/Users/matthias/Library/Arduino15/packages/rp2040/hardware/rp2040/2.5.2/libraries/SPI/src -I/Users/matthias/Library/Arduino15/packages/rp2040/hardware/rp2040/2.5.2/libraries/LittleFS/src -I/Users/matthias/Library/Arduino15/packages/rp2040/hardware/rp2040/2.5.2/libraries/PicoOTA/src /var/folders/cp/1rj8rlv11qb0v2srv_zph7mr0000gn/T/arduino_build_843132/sketch/hans_2.ino.cpp -o /var/folders/cp/1rj8rlv11qb0v2srv_zph7mr0000gn/T/arduino_build_843132/sketch/hans_2.ino.cpp.o
In file included from /Users/matthias/Library/Arduino15/packages/rp2040/tools/pqt-gcc/1.4.0-c-0196c06/arm-none-eabi/include/c++/10.3.0/vector:72,
                 from /Users/matthias/Library/Arduino15/packages/rp2040/tools/pqt-gcc/1.4.0-c-0196c06/arm-none-eabi/include/c++/10.3.0/queue:61,
                 from /Users/matthias/Library/Arduino15/packages/rp2040/hardware/rp2040/2.5.2/cores/rp2040/SerialUART.h:26,
                 from /Users/matthias/Library/Arduino15/packages/rp2040/hardware/rp2040/2.5.2/cores/rp2040/Arduino.h:111,
                 from /var/folders/cp/1rj8rlv11qb0v2srv_zph7mr0000gn/T/arduino_build_843132/sketch/hans_2.ino.cpp:1:
/Users/matthias/Library/Arduino15/packages/rp2040/tools/pqt-gcc/1.4.0-c-0196c06/arm-none-eabi/include/c++/10.3.0/bits/vector.tcc: In member function 'void std::vector<_Tp, _Alloc>::_M_realloc_insert(std::vector<_Tp, _Alloc>::iterator, _Args&& ...) [with _Args = {arduino::osc::message::Message}; _Tp = arduino::osc::message::Message; _Alloc = std::allocator<arduino::osc::message::Message>]':
/Users/matthias/Library/Arduino15/packages/rp2040/tools/pqt-gcc/1.4.0-c-0196c06/arm-none-eabi/include/c++/10.3.0/bits/vector.tcc:426:7: note: parameter passing for argument of type 'std::vector<arduino::osc::message::Message>::iterator' changed in GCC 7.1
  426 |       vector<_Tp, _Alloc>::
      |       ^~~~~~~~~~~~~~~~~~~
/Users/matthias/Library/Arduino15/packages/rp2040/tools/pqt-gcc/1.4.0-c-0196c06/arm-none-eabi/include/c++/10.3.0/bits/vector.tcc: In member function 'bool arduino::osc::message::Decoder::parse(const char*, const char*, const arduino::osc::TimeTag&)':
/Users/matthias/Library/Arduino15/packages/rp2040/tools/pqt-gcc/1.4.0-c-0196c06/arm-none-eabi/include/c++/10.3.0/bits/vector.tcc:121:21: note: parameter passing for argument of type '__gnu_cxx::__normal_iterator<arduino::osc::message::Message*, std::vector<arduino::osc::message::Message> >' changed in GCC 7.1
  121 |    _M_realloc_insert(end(), std::forward<_Args>(__args)...);
      |    ~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

I'm happy to test in depth with the Pico W and to add more details if you'd like to add official support for it.

Best,

Edit: I've removed a question from my first post about OSC pattern matching notation. Both the { } and [ ]methods are confirmed working using your library. I was just misusing the curly braces notation, it's fixed now.

Example with OSC over Serial using MsgPacketizer

Hi
I need to send osc messages from a Teensy to a ESP µP (with Wifi) over Serial. Since you dropped support for OscSerial and I also do not see SLIP support and seeing that you recommend MsgPacketizer can you please create a very simple example sketch on how a OSC message that would normally go out over Ethernet will be sent to Serial (encoded to support all data types) and maybe the counterpart to read from Serial, parse it as a OSCMessage and send it over Wifi. How can your Manager class be wrapped to Serial/SLIP/MsgPacketizer so that we can use the same high-level API to send and receive without going into byte-romantics?
Alternatively you can show the approach here in this Issue thread. This would make the library even better than it already is. Many thanks and congrats to this wonderful piece of work!

ESP8266 WiFiUDP.h renamed

I'm using this library for a project with ESP8266.
Seems that the WiFiUDP library has been renamed to WiFiUdp, so the library does not compile. Changing WiFiUDP.h to WiFiUdp.h in the ArduinoOSC.h file seems to solve the problem.
I'm using PlatformIO.

OscWifi not compiling for Arduino Nano 33 ioT/mkr 1010

Hello @hideakitai,

What a wonderful library, however I can't seem to get it to work with the Arduino Nano 33 ioT or the mkr 1010 wifi. I was wondering if it is something I'm missing or if the library hasn't integrated these two. Anyway, I'll leave the error ahead.

Thank you!

`C:\Program Files (x86)\Arduino\arduino-builder -dump-prefs -logger=machine -hardware C:\Program Files (x86)\Arduino\hardware -hardware C:\Users\lacou\AppData\Local\Arduino15\packages -tools C:\Program Files (x86)\Arduino\tools-builder -tools C:\Program Files (x86)\Arduino\hardware\tools\avr -tools C:\Users\lacou\AppData\Local\Arduino15\packages -built-in-libraries C:\Program Files (x86)\Arduino\libraries -libraries C:\Users\lacou\Documents\Arduino\libraries -fqbn=arduino:samd:nano_33_iot -vid-pid=0X2341_0X8057 -ide-version=10810 -build-path C:\Users\lacou\AppData\Local\Temp\arduino_build_613478 -warnings=none -build-cache C:\Users\lacou\AppData\Local\Temp\arduino_cache_511777 -prefs=build.warn_data_percentage=75 -prefs=runtime.tools.arm-none-eabi-gcc.path=C:\Users\lacou\AppData\Local\Arduino15\packages\arduino\tools\arm-none-eabi-gcc\7-2017q4 -prefs=runtime.tools.arm-none-eabi-gcc-7-2017q4.path=C:\Users\lacou\AppData\Local\Arduino15\packages\arduino\tools\arm-none-eabi-gcc\7-2017q4 -prefs=runtime.tools.openocd.path=C:\Users\lacou\AppData\Local\Arduino15\packages\arduino\tools\openocd\0.10.0-arduino7 -prefs=runtime.tools.openocd-0.10.0-arduino7.path=C:\Users\lacou\AppData\Local\Arduino15\packages\arduino\tools\openocd\0.10.0-arduino7 -prefs=runtime.tools.arduinoOTA.path=C:\Users\lacou\AppData\Local\Arduino15\packages\arduino\tools\arduinoOTA\1.2.1 -prefs=runtime.tools.arduinoOTA-1.2.1.path=C:\Users\lacou\AppData\Local\Arduino15\packages\arduino\tools\arduinoOTA\1.2.1 -prefs=runtime.tools.CMSIS-Atmel.path=C:\Users\lacou\AppData\Local\Arduino15\packages\arduino\tools\CMSIS-Atmel\1.2.0 -prefs=runtime.tools.CMSIS-Atmel-1.2.0.path=C:\Users\lacou\AppData\Local\Arduino15\packages\arduino\tools\CMSIS-Atmel\1.2.0 -prefs=runtime.tools.CMSIS.path=C:\Users\lacou\AppData\Local\Arduino15\packages\arduino\tools\CMSIS\4.5.0 -prefs=runtime.tools.CMSIS-4.5.0.path=C:\Users\lacou\AppData\Local\Arduino15\packages\arduino\tools\CMSIS\4.5.0 -prefs=runtime.tools.bossac.path=C:\Users\lacou\AppData\Local\Arduino15\packages\arduino\tools\bossac\1.7.0-arduino3 -prefs=runtime.tools.bossac-1.7.0-arduino3.path=C:\Users\lacou\AppData\Local\Arduino15\packages\arduino\tools\bossac\1.7.0-arduino3 -verbose C:\Users\lacou\Documents\Arduino\libraries\ArduinoOSC\examples\arduino\OscWiFi\OscWiFi.ino
C:\Program Files (x86)\Arduino\arduino-builder -compile -logger=machine -hardware C:\Program Files (x86)\Arduino\hardware -hardware C:\Users\lacou\AppData\Local\Arduino15\packages -tools C:\Program Files (x86)\Arduino\tools-builder -tools C:\Program Files (x86)\Arduino\hardware\tools\avr -tools C:\Users\lacou\AppData\Local\Arduino15\packages -built-in-libraries C:\Program Files (x86)\Arduino\libraries -libraries C:\Users\lacou\Documents\Arduino\libraries -fqbn=arduino:samd:nano_33_iot -vid-pid=0X2341_0X8057 -ide-version=10810 -build-path C:\Users\lacou\AppData\Local\Temp\arduino_build_613478 -warnings=none -build-cache C:\Users\lacou\AppData\Local\Temp\arduino_cache_511777 -prefs=build.warn_data_percentage=75 -prefs=runtime.tools.arm-none-eabi-gcc.path=C:\Users\lacou\AppData\Local\Arduino15\packages\arduino\tools\arm-none-eabi-gcc\7-2017q4 -prefs=runtime.tools.arm-none-eabi-gcc-7-2017q4.path=C:\Users\lacou\AppData\Local\Arduino15\packages\arduino\tools\arm-none-eabi-gcc\7-2017q4 -prefs=runtime.tools.openocd.path=C:\Users\lacou\AppData\Local\Arduino15\packages\arduino\tools\openocd\0.10.0-arduino7 -prefs=runtime.tools.openocd-0.10.0-arduino7.path=C:\Users\lacou\AppData\Local\Arduino15\packages\arduino\tools\openocd\0.10.0-arduino7 -prefs=runtime.tools.arduinoOTA.path=C:\Users\lacou\AppData\Local\Arduino15\packages\arduino\tools\arduinoOTA\1.2.1 -prefs=runtime.tools.arduinoOTA-1.2.1.path=C:\Users\lacou\AppData\Local\Arduino15\packages\arduino\tools\arduinoOTA\1.2.1 -prefs=runtime.tools.CMSIS-Atmel.path=C:\Users\lacou\AppData\Local\Arduino15\packages\arduino\tools\CMSIS-Atmel\1.2.0 -prefs=runtime.tools.CMSIS-Atmel-1.2.0.path=C:\Users\lacou\AppData\Local\Arduino15\packages\arduino\tools\CMSIS-Atmel\1.2.0 -prefs=runtime.tools.CMSIS.path=C:\Users\lacou\AppData\Local\Arduino15\packages\arduino\tools\CMSIS\4.5.0 -prefs=runtime.tools.CMSIS-4.5.0.path=C:\Users\lacou\AppData\Local\Arduino15\packages\arduino\tools\CMSIS\4.5.0 -prefs=runtime.tools.bossac.path=C:\Users\lacou\AppData\Local\Arduino15\packages\arduino\tools\bossac\1.7.0-arduino3 -prefs=runtime.tools.bossac-1.7.0-arduino3.path=C:\Users\lacou\AppData\Local\Arduino15\packages\arduino\tools\bossac\1.7.0-arduino3 -verbose C:\Users\lacou\Documents\Arduino\libraries\ArduinoOSC\examples\arduino\OscWiFi\OscWiFi.ino
Using board 'nano_33_iot' from platform in folder: C:\Users\lacou\AppData\Local\Arduino15\packages\arduino\hardware\samd\1.8.4
Using core 'arduino' from platform in folder: C:\Users\lacou\AppData\Local\Arduino15\packages\arduino\hardware\samd\1.8.4
Detecting libraries used...
"C:\Users\lacou\AppData\Local\Arduino15\packages\arduino\tools\arm-none-eabi-gcc\7-2017q4/bin/arm-none-eabi-g++" -mcpu=cortex-m0plus -mthumb -c -g -Os -w -std=gnu++11 -ffunction-sections -fdata-sections -fno-threadsafe-statics -nostdlib --param max-inline-insns-single=500 -fno-rtti -fno-exceptions -w -x c++ -E -CC -DF_CPU=48000000L -DARDUINO=10810 -DARDUINO_SAMD_NANO_33_IOT -DARDUINO_ARCH_SAMD -DCRYSTALLESS -D__SAMD21G18A__ -DUSB_VID=0x2341 -DUSB_PID=0x8057 -DUSBCON "-DUSB_MANUFACTURER="Arduino LLC"" "-DUSB_PRODUCT="Arduino NANO 33 IoT"" "-IC:\Users\lacou\AppData\Local\Arduino15\packages\arduino\tools\CMSIS\4.5.0/CMSIS/Include/" "-IC:\Users\lacou\AppData\Local\Arduino15\packages\arduino\tools\CMSIS-Atmel\1.2.0/CMSIS/Device/ATMEL/" "-IC:\Users\lacou\AppData\Local\Arduino15\packages\arduino\hardware\samd\1.8.4\cores\arduino" "-IC:\Users\lacou\AppData\Local\Arduino15\packages\arduino\hardware\samd\1.8.4\variants\nano_33_iot" "C:\Users\lacou\AppData\Local\Temp\arduino_build_613478\sketch\OscWiFi.ino.cpp" -o nul
Alternatives for ArduinoOSC.h: [[email protected]]
ResolveLibrary(ArduinoOSC.h)
-> candidates: [[email protected]]
"C:\Users\lacou\AppData\Local\Arduino15\packages\arduino\tools\arm-none-eabi-gcc\7-2017q4/bin/arm-none-eabi-g++" -mcpu=cortex-m0plus -mthumb -c -g -Os -w -std=gnu++11 -ffunction-sections -fdata-sections -fno-threadsafe-statics -nostdlib --param max-inline-insns-single=500 -fno-rtti -fno-exceptions -w -x c++ -E -CC -DF_CPU=48000000L -DARDUINO=10810 -DARDUINO_SAMD_NANO_33_IOT -DARDUINO_ARCH_SAMD -DCRYSTALLESS -D__SAMD21G18A__ -DUSB_VID=0x2341 -DUSB_PID=0x8057 -DUSBCON "-DUSB_MANUFACTURER="Arduino LLC"" "-DUSB_PRODUCT="Arduino NANO 33 IoT"" "-IC:\Users\lacou\AppData\Local\Arduino15\packages\arduino\tools\CMSIS\4.5.0/CMSIS/Include/" "-IC:\Users\lacou\AppData\Local\Arduino15\packages\arduino\tools\CMSIS-Atmel\1.2.0/CMSIS/Device/ATMEL/" "-IC:\Users\lacou\AppData\Local\Arduino15\packages\arduino\hardware\samd\1.8.4\cores\arduino" "-IC:\Users\lacou\AppData\Local\Arduino15\packages\arduino\hardware\samd\1.8.4\variants\nano_33_iot" "-IC:\Users\lacou\Documents\Arduino\libraries\ArduinoOSC" "C:\Users\lacou\AppData\Local\Temp\arduino_build_613478\sketch\OscWiFi.ino.cpp" -o nul
Error while detecting libraries included by C:\Users\lacou\AppData\Local\Temp\arduino_build_613478\sketch\OscWiFi.ino.cpp
Generating function prototypes...
"C:\Users\lacou\AppData\Local\Arduino15\packages\arduino\tools\arm-none-eabi-gcc\7-2017q4/bin/arm-none-eabi-g++" -mcpu=cortex-m0plus -mthumb -c -g -Os -w -std=gnu++11 -ffunction-sections -fdata-sections -fno-threadsafe-statics -nostdlib --param max-inline-insns-single=500 -fno-rtti -fno-exceptions -w -x c++ -E -CC -DF_CPU=48000000L -DARDUINO=10810 -DARDUINO_SAMD_NANO_33_IOT -DARDUINO_ARCH_SAMD -DCRYSTALLESS -D__SAMD21G18A__ -DUSB_VID=0x2341 -DUSB_PID=0x8057 -DUSBCON "-DUSB_MANUFACTURER="Arduino LLC"" "-DUSB_PRODUCT="Arduino NANO 33 IoT"" "-IC:\Users\lacou\AppData\Local\Arduino15\packages\arduino\tools\CMSIS\4.5.0/CMSIS/Include/" "-IC:\Users\lacou\AppData\Local\Arduino15\packages\arduino\tools\CMSIS-Atmel\1.2.0/CMSIS/Device/ATMEL/" "-IC:\Users\lacou\AppData\Local\Arduino15\packages\arduino\hardware\samd\1.8.4\cores\arduino" "-IC:\Users\lacou\AppData\Local\Arduino15\packages\arduino\hardware\samd\1.8.4\variants\nano_33_iot" "-IC:\Users\lacou\Documents\Arduino\libraries\ArduinoOSC" "C:\Users\lacou\AppData\Local\Temp\arduino_build_613478\sketch\OscWiFi.ino.cpp" -o "C:\Users\lacou\AppData\Local\Temp\arduino_build_613478\preproc\ctags_target_for_gcc_minus_e.cpp"
In file included from c:\users\lacou\appdata\local\arduino15\packages\arduino\tools\arm-none-eabi-gcc\7-2017q4\arm-none-eabi\include\c++\7.2.1\bits\char_traits.h:39:0,

             from c:\users\lacou\appdata\local\arduino15\packages\arduino\tools\arm-none-eabi-gcc\7-2017q4\arm-none-eabi\include\c++\7.2.1\string:40,

             from C:\Users\lacou\Documents\Arduino\libraries\ArduinoOSC/ArduinoOSC/lib/oscpkt.hh:101,

             from C:\Users\lacou\Documents\Arduino\libraries\ArduinoOSC/ArduinoOSC/OSCServer.h:16,

             from C:\Users\lacou\Documents\Arduino\libraries\ArduinoOSC/ArduinoOSC.h:4,

             from C:\Users\lacou\Documents\Arduino\libraries\ArduinoOSC\examples\arduino\OscWiFi\OscWiFi.ino:1:

c:\users\lacou\appdata\local\arduino15\packages\arduino\tools\arm-none-eabi-gcc\7-2017q4\arm-none-eabi\include\c++\7.2.1\bits\stl_algobase.h:243:56: error: macro "min" passed 3 arguments, but takes just 2

 min(const _Tp& __a, const _Tp& __b, _Compare __comp)

                                                    ^

c:\users\lacou\appdata\local\arduino15\packages\arduino\tools\arm-none-eabi-gcc\7-2017q4\arm-none-eabi\include\c++\7.2.1\bits\stl_algobase.h:265:56: error: macro "max" passed 3 arguments, but takes just 2

 max(const _Tp& __a, const _Tp& __b, _Compare __comp)

                                                    ^

Multiple libraries were found for "ArduinoOSC.h"
Used: C:\Users\lacou\Documents\Arduino\libraries\ArduinoOSC
Using library ArduinoOSC at version 0.2.2 in folder: C:\Users\lacou\Documents\Arduino\libraries\ArduinoOSC
exit status 1
Error compiling for board Arduino NANO 33 IoT.`

Event-driven approach to receiving OSC data rather than polling?

This is more of a feature request. Would it be possible to implement a more event-driven approach to receiving OSC data rather than polling parse()? I'm implementing freertos tasks which trigger FastLED, so avoiding creation of a periodic polling task would waste less cpu time.

Here's a similar discussion:
espressif/arduino-esp32#1995

p.s. no pressure on this one, just a feature request. I'll let you know how it goes with polling.

Is it possible to have a non-fixed IP ?

Thanks fro making this library. It works great.

Is there an option to get an IP assigned via DHCP? Or do I always need to hard code one?

Thanks for any advice.

ArduinoOSC requires Ethernet library even when only WiFi is used

Stumbled upon this when I tried your library for the first time. Not sure if you consider this a bug, but since Ethernet is not stated as a required dependency, I do :)

steps to reproduce in Arduino IDE:

  • make sure you have Ethernet lib NOT installed
  • load arduino/OscWiFi example project
  • select any board that supports Ethernet (e.g. ESP32)
  • try to compile

Expected result:
It should compile without errors.

Actual result:

In file included from /home/kartoffel/Arduino/libraries/ArduinoOSC/examples/arduino/OscWiFi/OscWiFi.ino:2:0:
/home/kartoffel/Arduino/libraries/ArduinoOSC/ArduinoOSC.h:54:22: fatal error: Ethernet.h: No such file or directory
compilation terminated.

Bug for AVR boards in which memory layout is not correct

I am currently working with the Arduino Uno WiFI Revision 2 and experience weird bugs and behaviours. It really has problems to parse the incoming data which seems to be the ceil4 related problem.

I guess it has to do with the following todo line:

// TODO: fix bug for AVR boards in which memory layout is not correct.

Is it possible to create a workaround for this (even we have some performance issues)?

Core Panic

Whenever I send osc to my ESP32 using Arduino OSC it crashes. I get the following error.

lambda : 192.168.0.169 61084 1 /lambda 3 Guru Meditation Error: Core 1 panic'ed (LoadProhibited). Exception was unhandled.
Core 1 register dump:
PC : 0x4014298c PS : 0x00060830 A0 : 0x800d1eda A1 : 0x3ffb1ee0
A2 : 0x00000003 A3 : 0x00000001 A4 : 0x3ffbbaa8 A5 : 0x00000001
A6 : 0x3ffba72b A7 : 0x3ffafedb A8 : 0x00000004 A9 : 0x00000000
A10 : 0x00000000 A11 : 0x3f4000ba A12 : 0x0000000a A13 : 0x3ffafedb
A14 : 0x00ff0000 A15 : 0xff000000 SAR : 0x00000010 EXCCAUSE: 0x0000001c
EXCVADDR: 0x00000003 LBEG : 0x4014298c LEND : 0x4014299a LCOUNT : 0x00000003

Backtrace: 0x4014298c:0x3ffb1ee0 0x400d1ed7:0x3ffb1f10 0x400d3381:0x3ffb1f40 0x400d33b6:0x3ffb1f90 0x400d4b11:0x3ffb1fb0 0x4008e6f1:0x3ffb1fd0

errors compiling the OscEtherUno sketch

I'm using the latest Arduino IDE (1.8.15) with the latest ArduinoOSC library.

I'm getting the following errors when I'm trying to compile the OscEtherUno sketch (see below):

What am I doing wrong?

Best regards! Edwin

In file included from /Users/USER/Documents/Arduino/libraries/ArduinoOSC/ArduinoOSC.h:59:0,
from /Users/USER/Documents/Arduino/libraries/ArduinoOSC/examples/arduino/OscEtherUno/OscEtherUno.ino:17:
/Users/USER/Documents/Arduino/libraries/ArduinoOSC/ArduinoOSC/OscUdpMap.h: In instantiation of 'arduino::osc::UdpRef arduino::osc::UdpMapManager::getUdp(uint16_t) [with S = EthernetUDP; arduino::osc::UdpRef = arx::stdx::shared_ptr; uint16_t = unsigned int]':
/Users/USER/Documents/Arduino/libraries/ArduinoOSC/ArduinoOSC/OSCServer.h:208:22: required from 'bool arduino::osc::server::Server::parse() [with S = EthernetUDP]'
/Users/USER/Documents/Arduino/libraries/ArduinoOSC/examples/arduino/OscEtherUno/OscEtherUno.ino:78:22: required from here
/Users/USER/Documents/Arduino/libraries/ArduinoOSC/ArduinoOSC/OscUdpMap.h:53:21: error: call of overloaded 'erase(const uint16_t&)' is ambiguous
udp_map.erase(PORT_DISCARD);
^~~~~~~
In file included from /Users/USER/Documents/Arduino/libraries/ArduinoOSC/ArduinoOSC.h:6:0,
from /Users/USER/Documents/Arduino/libraries/ArduinoOSC/examples/arduino/OscEtherUno/OscEtherUno.ino:17:
/Users/USER/Documents/Arduino/libraries/ArduinoOSC/ArduinoOSC/util/ArxContainer/ArxContainer.h:679:14: note: candidate: arx::map<Key, T, N>::iterator arx::map<Key, T, N>::erase(const Key&) [with Key = unsigned int; T = arx::stdx::shared_ptr; unsigned int N = 2; arx::map<Key, T, N>::iterator = arx::RingBuffer<arx::pair<unsigned int, arx::stdx::shared_ptr >, 2>::Iterator]
iterator erase(const Key& key) {
^~~~~
/Users/USER/Documents/Arduino/libraries/ArduinoOSC/ArduinoOSC/util/ArxContainer/ArxContainer.h:684:14: note: candidate: arx::map<Key, T, N>::iterator arx::map<Key, T, N>::erase(size_t) [with Key = unsigned int; T = arx::stdx::shared_ptr; unsigned int N = 2; arx::map<Key, T, N>::iterator = arx::RingBuffer<arx::pair<unsigned int, arx::stdx::shared_ptr >, 2>::Iterator; size_t = unsigned int]
iterator erase(const size_t index) {
^~~~~
exit status 1
Error compiling for board Arduino Uno.

esp32 + ethernet, example not working

Hi, not really an issue but it might be helpful for others.
I'm using an Olimex-ESP32-Gateway (esp32 + ethernet board) and the ethernet examples didn't work. The esp32 crashed right after sending osc because in the examples the class is initialized as OscSerial osc;.

This code works for me and you can live un-/replug ethernet on sender and receiver.

#include <ETH.h>
#include <ArduinoOSC.h>

bool eth_connected = false;
IPAddress local_IP(192, 168, 0, 50);
IPAddress gateway(192, 168, 0, 1);
IPAddress subnet(255, 255, 255, 0);
IPAddress primaryDNS(192, 168, 0, 1);
IPAddress secondaryDNS(8, 8, 8, 8);

// ArduinoOSC (library examples don't work)
OscWiFi osc;
const char* host = "192.168.0.60";
const int recv_port = 8000;
const int send_port = 8010;

// Ethernet callbacks
void WiFiEvent(WiFiEvent_t event)
{
  switch (event) {
    case SYSTEM_EVENT_ETH_START:
      Serial.println("ETH Started");
      //set eth hostname here
      ETH.setHostname("esp32-ethernet");
      break;
    case SYSTEM_EVENT_ETH_CONNECTED:
      Serial.println("ETH Connected");
      break;
    case SYSTEM_EVENT_ETH_GOT_IP:
      Serial.print("ETH MAC: ");
      Serial.print(ETH.macAddress());
      Serial.print(", IPv4: ");
      Serial.print(ETH.localIP());
      if (ETH.fullDuplex()) {
        Serial.print(", FULL_DUPLEX");
      }
      Serial.print(", ");
      Serial.print(ETH.linkSpeed());
      Serial.println("Mbps");
      eth_connected = true;
      osc.begin(recv_port);
      break;
    case SYSTEM_EVENT_ETH_DISCONNECTED:
      Serial.println("ETH Disconnected");
      eth_connected = false;
      break;
    case SYSTEM_EVENT_ETH_STOP:
      Serial.println("ETH Stopped");
      eth_connected = false;
      break;
    default:
      break;
  }
}

void setup() {
  Serial.begin(115200);
  WiFi.onEvent(WiFiEvent);
}

void loop() {
  // ethernet connected
  if (eth_connected) {  
        // sending code
        // ....
  }

  else {
    // Connect ethernet
    Serial.println("attempting ethernet connection ...");
    ETH.begin();
    ETH.config(local_IP, gateway, subnet, primaryDNS, secondaryDNS);
    delay(2000);
  }
}

In OscWiFiAP example, no ip obtained.

Hi,
I tried this example from .pio PlatformIO on ESP32.

The example sets up an AP just fine, and I can connect with the defaults password.
However, it just sits these trying to get an IP and eventually times out .. I tested with a Motorola Android Phone.

Any idea's to fix this appreciated. Cheers.

Possible deadlock in subscribe or send

While flooding the Arduino UNO WiFi Rev2 with a lot of osc messages, it sometimes happens that the main loop just freezes. It's not an Arduino crash but really a blocking and my wild guess is the OscWiFi.update().

I am also sending back data, so it could also be a problem with both connected:

OscWiFi.subscribe(IN_PORT, "/tes/read, [](const OscMessage & m) {
  OscWiFi.send(m.remoteIP(), OUT_PORT, "/test/answer", m.arg<int>(0), 42);
});

Have you already experienced something similar? Of course this could also be a problem on network stack.

run ArduinoOSCEther with OLIMEX ESP32 POE

Hi, I try to use OLIMEX ESP32 POE with ArduinoOSCEther.
With this device ETH_LAN8720 example works through ETH.h provide by library Espressif ESP32 but it doesn't work with Ehternet.h used with ArduinoOSCEther.

There's a way to run ArduinoOSC through Ethernet with kind of this board ?

best ;)

Esp32 not receiving OSC messages via demo python script

Hello,

I've been trying to get your library to work for some time now, with no success. I'm running the default Arduino ino found in the examples alongside the python script also found in the examples.

I've verified that both devices are on the same network & band, and I've confirmed that the python script is sending the messages to the expected IP / port. The ESP32 device connects just fine, but does not receive any of the sent messages. I have not modified any of the ports, ips, or masks of the example code.

Any ideas as to why the messages may not be coming through? Thank you.

Implement Wildcards for addresses

Per the OSC 1.0 spec *, ?, and strings such as [a-c] are used to match multiple OSC addresses. Are there any plans to support this section of the OSC spec? I am currently working on a project where it would be useful to do the following,

osc.addCallback("/ch/*/fader", &callback)

Currently I have to add a separate callback for each of the 16 channels on my mixer.

Core Panic issue

Having an issue sending OSC commands. Sending the following OSC UDP command:

/need/reply

works great. But sending this doesn't:

/lambda/msg hello

or

/lambda/bind/args 1

etc.

Here is the error it generates:

92.168.1.217 53001 1 /lambda/msg 2018946490 Guru Meditation Error: Core 1 panic'ed (LoadProhibited). Exception was unhandled.

Core 1 register dump:
PC : 0x400d2cb8 PS : 0x00060330 A0 : 0x800d2d8c A1 : 0x3ffb2720
A2 : 0x3ffcdeec A3 : 0x00000001 A4 : 0x0000000a A5 : 0x0000ff00
A6 : 0x00ff0000 A7 : 0xff000000 A8 : 0x800d2cb8 A9 : 0x3ffb2700
A10 : 0x00000000 A11 : 0x00000001 A12 : 0x0000000a A13 : 0x00000000
A14 : 0x00000000 A15 : 0xff000000 SAR : 0x0000000d EXCCAUSE: 0x0000001c
EXCVADDR: 0x00000002 LBEG : 0x40089741 LEND : 0x40089751 LCOUNT : 0xffffffff

Backtrace:0x400d2cb5:0x3ffb27200x400d2d89:0x3ffb2740 0x400d2631:0x3ffb2780 0x400d51ae:0x3ffb27a0 0x400d5214:0x3ffb2800 0x400d768d:0x3ffb2820

Here are some details:

Board: HUZZAH32 (Adafruit link)
ArduinoOSC ver: 0.3.29
Script: OscWiFi (The included library example, with only the SSID and Password)
OSC-Sending: QLab and even TouchOSC

Thanks for taking a look.

RP2040 not sending wifi when in station mode

Hi,

Thank you for this very nice library.

I wanted to connect to an OSC server (desktop computer with Python OSC server) through Wifi with a Raspberry Pi Pico (being the client).

I copied some parts of your example https://github.com/hideakitai/ArduinoOSC/blob/main/examples/arduino/OscWiFi/OscWiFi.ino but kept getting "wifi is not connected" messages in the log.

I modified lines 71, 90, and 102 of ArduinoOSCCommon.h as follows

if ((WiFi.status() == WL_CONNECTED) || (WiFi.getMode() == WIFI_STA)) {

instead of

if ((WiFi.status() == WL_CONNECTED) || (WiFi.getMode() != WIFI_STA)) {

and now it works.

I'm not really sure why mode should not be WIFI_STA at all times, especially when line 56 of the example sets it to WIFI_STA ?

Thank you for your help,
All the best

Add support for multicast?

I'd like to use this for an installation where the networking can change. It'd be nice to publish to a multicast address so the IPs are the same regardless of network setup. Thanks for publishing this, it works like a charm otherwise!

Receive an Udp Osc message as reply to a previus Osc message

Hi,
I would like to interact with my digital mixer using Osc messages.
I'm able to send message, but I cannot read any reply form the server.

My scenario is the following: I send an OSC message to mixer (192.168.1.33 port 10024) and Mixer reply to my Arduino IP (192.168.1.199) but the mixer use the Remote UDP Port that Arduino use for send the message.

WhatsApp Image 2021-03-18 at 14 57 05

I sniff some udp packet and seems that OscEther.send use a local port (random probably, port 9 in my test) that is not releated to OscEtherServer [server.begin(serverPort)].
Can you give me some advices?

#include <ArduinoOSC.h>


byte myMac[] = { 0xDE, 0xAD, 0xBE, 0xEF, 0xFE, 0xED };
byte myIp[]  = { 192, 168, 1, 199 };

int serverPort  = 8888; //this is not right in my scenario


const char* mixerIp = "192.168.1.33";
const int mixerPort = 10024;


// required to use manual packet parsing
OscEtherServer server;

void setup()
{
    Serial.begin(115200);
    Ethernet.begin(myMac, myIp);
    server.begin(serverPort); // <--- I should listen reply on the same port that I use to send UDP request...
}


void loop()
{
    // manual sending instead of publishers
    static uint32_t prev_func_ms = millis();
    if (millis() > prev_func_ms + 2500)
    {
        prev_func_ms = millis();
        OscEther.send(mixerIp, mixerPort, "/info");
    }

 
    // manual parsing instead of subscribers
    if (server.parse())
    { 
      // I did not receive nothing on "serverPort" because is not releated with Oscether.send() Udp Local Port...
        Serial.println("server.parse()");
        const OscMessage* msg = server.message();
    }
}

Unable to parse or post any OSC message on WiFi

I'm using an Arduino MKR Wifi 1010 module, and the example with the WiFi.h library. I'm able to connect to the network, set an ip address, and make publish messages (although they are only 2 messages per second, not the 30hz mentioned). However when I send OSC back to the Arduino IP, on any of the reports, it doesn't print out any data to the serial monitor.

I'm wondering how to parse and post custom messages to 3rd party applications like TouchDesigner.

term not clear . need proper documentation please

So I'm trying to just send OSC message from Nodemcu to my computer.Here's my setup

MY SETUP:

  • Let's say My router's AP is: ap--
  • Let's say My router's AP pwd: pwd--
  • My computer is connected to my router and has gotten an IP: 192.168.8.114(say)
  • Osculator(for reading OSC messages) is listening on port 8000

Now my node-mcu side code is as below: (The problem steps are commented in the code)

#include <ArduinoOSC.h>

WiFiUDP udp;
ArduinoOSCWiFi osc;
const char* ssid = "ap--";
const char* pwd = "pwd--";
const IPAddress ip(192, 168, 8, 204);  // my preferred static IP
const IPAddress gateway(192, 168, 8, 1); // don't know what this is, is this router's address?
const IPAddress subnet(255, 255, 255, 0); // How do I know what to set up? 
const char* host = "192.168.8.114"; // My computer's IP I assume
const int recv_port = 9000; // these are pretty obvious
const int send_port = 8000; 

void setup()
{
  Serial.begin(115200);
  WiFi.disconnect(true);

  // Connect to WiFi network
  delay(5000);
  Serial.println();
  Serial.print("Connecting to ");
  Serial.println(ssid);

  WiFi.begin(ssid, pwd);
  WiFi.config(ip, gateway, subnet);

  while (WiFi.status() != WL_CONNECTED)
  {
    delay(50);
    Serial.print(".");
  }

  delay(1000);
  Serial.println("");
  Serial.println("WiFi connected");
  Serial.println("IP address: ");
  Serial.println(WiFi.localIP()); // When I open serial monitor I get here my fixed IP

  delay(1000);
  Serial.println("");
  Serial.println("Setting up OSC");
  osc.begin(udp, recv_port);  

  delay(3000);
  Serial.println("Sending OSC");
 // AFTER THIS NOTHING HAPPENS AND OSCULATOR DOESN'T READ ANY VALUE AND IN SERIAL 
 // MONITOR ALSO I DONOT SEE ANY DEBUG MESSAGES THAT IN PUT IN YOUR CALLBACK 
  osc.addCallback("/ard/aaa", &callback);
  osc.addCallback("/ard", &callback);
}

void loop()
{
  osc.parse();
}

void callback(OSCMessage& m)
{
  //create new osc message
  OSCMessage msg;
  //set destination ip address & port no
  msg.beginMessage(host, send_port);
  //set argument
  msg.setOSCAddress(m.getOSCAddress());
  msg.addArgInt32(m.getArgAsInt32(0));
  msg.addArgFloat(m.getArgAsFloat(1));
  msg.addArgString(m.getArgAsString(2));
  //send osc message
  osc.send(msg);
  Serial.println("Sent OSC message");
}

I only wish your examples were a bit simpler and more explanatory for some novices.

How do I go from here to just read a value in my computer in osculator sent from node MCU and also
where is the value reading functions within parsing function?

No ESP8266 support?

Using a nodeMCU v2.

If I try to compile the example files, I get the error
#error UNSUPPORTED PLATFORM

After adding
#define ESP_PLATFORM 1

it's still not working:
Poti_AP_OSC:27: error: 'osc' does not name a type osc.begin(udp, recv_port);

Compilation error when including ArduinoOSC.h in several headers

I have a class that can handle OscMessage so I need to include ArduinoOSC.h in the header of this class. This leads to compilation error (multiple definition of Packetizer::crc8 and ArduinoOSC::match).
To solve this problem, I created two files (ArduinoOSC.cpp next to ArduinoOSC.h and Packetizer.cpp next to Packetizer.h), included their respective headers and moved the code from the problematic functions in the corresponding cpp.
It now compiles and works well even though I don't fully understand why.
Here are the concerned files.
ArduinoOSC_modif.zip

Thanks for this great and useful work by the way.

ESP32 AP mode

Hi,

Static mode work perfectly but I don't have any success to use ArduinoOSC with AP mode wifi.
there's a way to use ArduinoSOC with AP mode with a ESP32 ?

Bets & thx for your great library ;)

Chris

gccのバージョンエラー

お世話になっております。
いつも便利にArduinoOSC使用させていただいております。

Arduino UNO R4 MinimaでOSC通信をしようと思い、書き込んだ所、gccのエラーが出てしまいました。
こちら解決方法ありますでしょうか。
(ディレクトリのユーザー名---で省略させていただいております )

In file included from c:\users\---\appdata\local\arduino15\packages\arduino\tools\arm-none-eabi-gcc\7-2017q4\arm-none-eabi\include\c++\7.2.1\vector:69:0, from c:\users\---\appdata\local\arduino15\packages\arduino\tools\arm-none-eabi-gcc\7-2017q4\arm-none-eabi\include\c++\7.2.1\functional:61, from g:\�}�C�h���C�u\case_google\Arduino\libraries\ArxTypeTraits/ArxTypeTraits/functional.h:8, from g:\�}�C�h���C�u\case_google\Arduino\libraries\ArxTypeTraits/ArxTypeTraits/type_traits.h:594, from g:\�}�C�h���C�u\case_google\Arduino\libraries\ArxTypeTraits/ArxTypeTraits.h:36, from g:\�}�C�h���C�u\case_google\Arduino\libraries\ArduinoOSC/ArduinoOSC/ArduinoOSCCommon.h:5, from g:\�}�C�h���C�u\case_google\Arduino\libraries\ArduinoOSC/ArduinoOSCEther.h:15, from g:\�}�C�h���C�u\case_google\Arduino\libraries\ArduinoOSC/ArduinoOSC.h:5, from G:\マイドライブ\case_google\Arduino\Toyota_Button_TEST\Toyota_Button_TEST.ino:1: c:\users\---\appdata\local\arduino15\packages\arduino\tools\arm-none-eabi-gcc\7-2017q4\arm-none-eabi\include\c++\7.2.1\bits\vector.tcc: In member function 'void std::vector<_Tp, _Alloc>::_M_realloc_insert(std::vector<_Tp, _Alloc>::iterator, _Args&& ...) [with _Args = {arduino::osc::message::Message}; _Tp = arduino::osc::message::Message; _Alloc = std::allocator<arduino::osc::message::Message>]': c:\users\---\appdata\local\arduino15\packages\arduino\tools\arm-none-eabi-gcc\7-2017q4\arm-none-eabi\include\c++\7.2.1\bits\vector.tcc:394:7: note: parameter passing for argument of type 'std::vector<arduino::osc::message::Message>::iterator {aka __gnu_cxx::__normal_iterator<arduino::osc::message::Message*, std::vector<arduino::osc::message::Message> >}' changed in GCC 7.1 vector<_Tp, _Alloc>:: ^~~~~~~~~~~~~~~~~~~ c:\users\---\appdata\local\arduino15\packages\arduino\tools\arm-none-eabi-gcc\7-2017q4\arm-none-eabi\include\c++\7.2.1\bits\vector.tcc: In member function 'bool arduino::osc::message::Decoder::parse(const char*, const char*, const arduino::osc::TimeTag&)': c:\users\---\appdata\local\arduino15\packages\arduino\tools\arm-none-eabi-gcc\7-2017q4\arm-none-eabi\include\c++\7.2.1\bits\vector.tcc:105:21: note: parameter passing for argument of type '__gnu_cxx::__normal_iterator<arduino::osc::message::Message*, std::vector<arduino::osc::message::Message> >' changed in GCC 7.1 _M_realloc_insert(end(), std::forward<_Args>(__args)...);

Buffer gets overwritten while decoding

Is it possible that a buffer can get overwritten while still parsed?

Sending following messages (quite fast behind each other).
The number indicates the length in bytes:

/iad/led/color iii 36
/iad/imu/rpy i 24

On the arduino, when falling into this error-check (regarding too few arguments), I print out the current buffer (storage.end() - storage.begin()), first the byte value and then the corresponding charachter:

Size: 36
47|/ 105|i 97|a 100|d 47|/ 105|i 109|m 117|u 47|/ 114|r 112|p 121|y 0|� 0|� 0|� 0|� 44|, 105|i 0|� 0|� 0|� 0|� 1|� 101|e 0|� 0|� 0|� 49|1 0|� 0|� 0|� 0|� 0|� 0|� 0|� -1|⸮

Well, that looks like the 36 byte buffer of the /iad/led/color packet, but filled with the values of the /iad/imu/rpy packet.

I am super confused now...either I am not reading the right data for debug or there is some concurrent work going on. Sending the same package behind each other of course makes no difference, because we are overwriting the same buffer.

After one of these messages, the stream.parsePacket() returns always 65524.

Here an example sketch, which let me recreate this problem:

#include <SPI.h>
#include <WiFiNINA.h>
#include <WiFiUdp.h>
#include <utility/wifi_drv.h>

#include <ArduinoOSC.h>

#include "secrets.h"

#define OscWiFi ArduinoOSC::Manager<WiFiUDP>::getInstance()

#define IN_PORT 8000

int keyIndex = 0;
int status = WL_IDLE_STATUS;

void setup() {
  Serial.begin(9600);

  // connect wifi
  while (status != WL_CONNECTED) {
    Serial.print("Connecting to SSID: ");
    Serial.println(ssid);
    status = WiFi.begin(ssid, keyIndex, pass);
  }

  // setup inputs
  OscWiFi.subscribe(IN_PORT, "/test/rgb", [&](int& r, int& g, int& b) {
    // do nothing
  });

  OscWiFi.subscribe(IN_PORT, "/test/w", [&](int& w) {
    // do nothing
  });


  Serial.println("everything setup to test!");
}

void loop() {
  OscWiFi.update();
}

Just send (with any OSC client) /test/rgb and /test/w alternately in a high framerate.

multiple clients

Hi.
I want to subscribe on multiple local ports. That's working but how can I send osc out specifying which client instance to be used, so that the srcPort is set of either the client id or on a per-message-level. If the design is meant to be a singleClient architecture, can I set the srcport before sending by calling .localPort(port) before each message?

Sometimes `subscribe` is unstable in ESP32

こんにちは。最高に使いやすいライブラリの公開、ありがとうございます。

タイトルにもあります通り、Subscribeの応答速度がpublishの有無とインターバルによって変化してしまうような挙動をしております。こちらは使用上仕方のないことなのでしょうか?

具体的には、ESP32にて以下のようなコードを実行しているのですが、ESP32がOSCメッセージを受信した際に即時に応答せず、パケットが1秒程度溜まってから排出されるような挙動をしてしまっています。なおOSCメッセージはMaxから100msecごと/foo Xの形で送っており、Xは100msecごとに0.01ずつインクリメントされるようになっています。
コード

void setup() {
  delay(1000);
  WiFi.begin(ssid, pwd);
  WiFi.config(ip, gateway, subnet);

  while(WiFi.status() != WL_CONNECTED) { Serial.print("."); delay(500); }
  Serial.begin(115200);

  OscWiFi.subscribe(port_a, "/foo",
        [&](const float& f)  {
            Serial.print("/foo ");
            Serial.println(f);
        }
    );

  OscWiFi.publish("224.0.0.1", port_b, "/active", 1.0) -> setIntervalMsec(1000.0f);
}

void loop() {
    OscWiFi.update(); 
}


スクリーンショット 2020-06-13 10 15 19

OscWiFi.publishの行をコメントアウトしてみたところ、以下のようになり、連続的な受信がままならない状況になりました。

スクリーンショット 2020-06-13 10 23 11

publishとsubscribeに何らかの因果を感じたので、今度はpublishをアンコメントし、intervalを1 msecにしてみたところ、subscribeの応答速度が大変早まりました。

可能であればintervalを1000msのまま、subscribeはなるべく高速に使用したいのですが、そのようなことは可能なのでしょうか?お忙しいところお手数をおかけしますがご教授いただけると幸いです。
よろしくおねがいします。

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.