Keep serial port open while M4L editor is closed
I've created a M4L patch, that monitors the room temperature from an arduino and sends it off to a Node.js server. I've got it working, but only if the editor for the max patch is opened. When i close the editor to just look at the data in the device window in Live, i don't get anything. I have since confirmed that the port is not used by max if the editor is not open, because i can then open the serial monitor in the Arduino IDE, which is not possible if the port is in use by M4L.
I would like to use this patch in a VJ'ing set and it would be nicer for me not to have the editor window open to keep a better overview.
Does anyone know how to fix this? All help is appreciated.
I've attached my M4L patch. The subpatch SerialPort is where the data gets processed.
you are probably not initialising serial port correctly.
is it really port c ?
I have a dark (maybe wrong) memory that when using the serial port in M4L the editor (Max) when open and Live (when the editor is closed) can get into conflict, because they are separate applications. A serial port can only be accessed by one application at a time. To prevent that you would need to first close the serial port connection before closing the M4L editor (you can automate that that with [closebang]) and re-open it from your device.
Thank you so much Jan! This indeed was the case and fixed it :)
Great!