mathiasbredholt / libmapper-arduino Goto Github PK
View Code? Open in Web Editor NEWAn Arduino library for using libmapper
License: GNU Lesser General Public License v3.0
An Arduino library for using libmapper
License: GNU Lesser General Public License v3.0
When adding more than 7 signals using mapper_device_add_output_signal, none of the signals appear in webmapper. I tried different kinds of dummy signals but nothing seems to work.
Hi @mathiasbredholt . I notice that this repo is licensed under GPL 3.0 or later, which is notably more restrictive than the LGPL 2.1 or later used by liblo and libmapper. I don't have any issue with this (I'm all for a good strong copyleft license), but wanted to verify that this was your intention, since I also saw that e.g. the T-Stick firmware is marked as MIT licensed while using this library, which would appear to be, well, not allowed. Hence: is this library inadvertently more strongly licensed than intended, or is the T-Stick firmware inadvertently violating the libmapper-arduino terms of use?
The Arduino esp32 framework currently starts the task that's responsible for running void loop()
with a stack size of 8192 bytes. In the tests I've done, this is not enough for most libmapper applications, causing a stack overflow.
The stack size can be changed in hardware/esp32/1.0.4/cores/esp32/main.cpp
.
16384 bytes works for me.
Library fails to compile using Arduino 1.8.12 (works fine with 1.8.10 though)
OBS: I'm using libmapper v0.1.3, even though the output claims 0.1.0 ...
Using the Example_ESP32.
Error:
Arduino: 1.8.12 (Mac OS X), Board: "LOLIN D32 PRO, Enabled, Default, 80MHz, 115200, None"
sketch/Example_ESP32.ino.cpp.o:(.literal._Z20input_signal_handlerPvyPKviP10lo_timetag+0x4): undefined reference to `mapper_signal_length'
sketch/Example_ESP32.ino.cpp.o:(.literal._Z5setupv+0x34): undefined reference to `mapper_device_new'
sketch/Example_ESP32.ino.cpp.o:(.literal._Z5setupv+0x38): undefined reference to `mapper_device_add_output_signal'
sketch/Example_ESP32.ino.cpp.o:(.literal._Z5setupv+0x3c): undefined reference to `mapper_device_add_input_signal'
sketch/Example_ESP32.ino.cpp.o:(.literal._Z4loopv+0x8): undefined reference to `mapper_device_poll'
Multiple libraries were found for "WiFi.h"
sketch/Example_ESP32.ino.cpp.o:(.literal._Z4loopv+0xc): undefined reference to `mapper_signal_update_float'
Used: /Users/edu/Library/Arduino15/packages/esp32/hardware/esp32/1.0.4/libraries/WiFi
Not used: /Applications/Arduino.app/Contents/Java/libraries/WiFi
sketch/Example_ESP32.ino.cpp.o: In function `input_signal_handler(void*, unsigned long long, void const*, int, lo_timetag*)':
/Users/edu/Documents/Arduino/libraries/libmapper/examples/Example_ESP32/Example_ESP32.ino:43: undefined reference to `mapper_signal_length'
sketch/Example_ESP32.ino.cpp.o: In function `setup()':
/Users/edu/Documents/Arduino/libraries/libmapper/examples/Example_ESP32/Example_ESP32.ino:27: undefined reference to `mapper_device_new'
/Users/edu/Documents/Arduino/libraries/libmapper/examples/Example_ESP32/Example_ESP32.ino:30: undefined reference to `mapper_device_add_output_signal'
/Users/edu/Documents/Arduino/libraries/libmapper/examples/Example_ESP32/Example_ESP32.ino:31: undefined reference to `mapper_device_add_input_signal'
sketch/Example_ESP32.ino.cpp.o: In function `loop()':
/Users/edu/Documents/Arduino/libraries/libmapper/examples/Example_ESP32/Example_ESP32.ino:35: undefined reference to `mapper_device_poll'
/Users/edu/Documents/Arduino/libraries/libmapper/examples/Example_ESP32/Example_ESP32.ino:37: undefined reference to `mapper_signal_update_float'
collect2: error: ld returned 1 exit status
exit status 1
Error compiling for board LOLIN D32 PRO.
If I instantiate more than 4 signals on the ESP32, webmapper recognizes them (mum_sigs_out=5) but does not show them (signals=0 in, 0 out). I'm using the ESP32 example and adding more signals:
#include <WiFi.h>
#include <mapper.h>
// For disabling power saving
#include "esp_wifi.h"
const char* ssid = "bet";
const char* password = "bernardoedutati";
mpr_dev dev = 0;
mpr_sig inputSignal = 0;
mpr_sig inputSignal2 = 0;
mpr_sig inputSignal3 = 0;
mpr_sig inputSignal4 = 0;
mpr_sig inputSignal5 = 0;
mpr_sig outputSignal = 0;
float seqNumber = 0;
float receivedValue = 0;
// Forward declaration added to work on PlatformIO
void inputSignalHandler(mpr_sig sig, mpr_sig_evt evt, mpr_id inst, int length,
mpr_type type, const void* value, mpr_time time);
void setup() {
Serial.begin(115200);
WiFi.begin(ssid, password);
// Disable WiFi power save (huge latency improvements)
esp_wifi_set_ps(WIFI_PS_NONE);
while (WiFi.status() != WL_CONNECTED) {
delay(500);
}
float signalMin = 0.0f;
float signalMax = 5.0f;
dev = mpr_dev_new("ESP32", 0);
outputSignal = mpr_sig_new(dev, MPR_DIR_OUT, "valueToSend", 1, MPR_FLT, "V",
&signalMin, &signalMax, 0, 0, 0);
inputSignal = mpr_sig_new(dev, MPR_DIR_OUT, "valueReceived", 1, MPR_FLT, "V",
&signalMin, &signalMax, 0, inputSignalHandler,
MPR_SIG_UPDATE);
inputSignal2 = mpr_sig_new(dev, MPR_DIR_OUT, "valueReceived2", 1, MPR_FLT, "V",
&signalMin, &signalMax, 0, inputSignalHandler,
MPR_SIG_UPDATE);
inputSignal3 = mpr_sig_new(dev, MPR_DIR_OUT, "valueReceived3", 1, MPR_FLT, "V",
&signalMin, &signalMax, 0, inputSignalHandler,
MPR_SIG_UPDATE);
inputSignal4 = mpr_sig_new(dev, MPR_DIR_OUT, "valueReceived4", 1, MPR_FLT, "V",
&signalMin, &signalMax, 0, inputSignalHandler,
MPR_SIG_UPDATE);
// inputSignal5 = mpr_sig_new(dev, MPR_DIR_OUT, "valueReceived5", 1, MPR_FLT, "V",
// &signalMin, &signalMax, 0, inputSignalHandler,
// MPR_SIG_UPDATE);
}
void loop() {
// Update libmapper device
mpr_dev_poll(dev, 50);
// Increment number and send
seqNumber += 0.01f;
mpr_sig_set_value(outputSignal, 0, 1, MPR_FLT, &seqNumber);
// Print received value
Serial.print("received: ");
Serial.println(receivedValue);
// Wait 100 ms
delay(100);
}
void inputSignalHandler(mpr_sig sig, mpr_sig_evt evt, mpr_id inst, int length,
mpr_type type, const void* value, mpr_time time) {
receivedValue = *((float*)value);
}
It doesn't show any error and compiles fine. Also, webmapper was able to see other devices full of signals (created in a separate computer using Python).
The screenshot of webmapper status can be found below:
There's no signal shown if you change the view.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.