The update went fine but when starting the node server from the NexusUI project folder as indicated in readme.txt i get this error.

module.js:440    throw err; 
^Error: Cannot find module 'debug'    
at Function.Module._resolveFilename (module.js:438:15)    
at Function.Module._load (module.js:386:25)    
at Module.require (module.js:466:17)   
at require (internal/module.js:20:19)    
at Object. 
(/root/Bela/projects/NexusUI/node_modules/finalhandler/index.js:14:13)    
at Module._compile (module.js:541:32)    
at Object.Module._extensions..js (module.js:550:10)    
at Module.load (module.js:456:32)    
at tryModuleLoad (module.js:415:12)    
at Function.Module._load (module.js:407:3)

    adowty

    by installing this, I was able to get the node server started:
    npm install debug --save-dev

    Hey, sorry about that it was a weird bug involving .gitignore paths in the repo. Should be fixed now, if you re-update to the latest dev-nexusUI branch.

    7 days later

    (for anyone else who takes this path)
    If index.js reads like this from lines 27 to 42, then sliders as well as all the rest of the nexus ui widgets will be received in libpd using the vanilla netreceive, oscparse and route objects:

    socket.on('nx', data => {

      sendOSC({
    		address	: '/nexus-ui',
    		args	: [
    			{
    				type	: 'string',
    				value	: data.oscName
    			},
    			{
    				type	: '*',
    				value	: data.value
    			}
    		]
    	});
    });

    });

    ...then in index,html nx.sendsTo("node"); covers all objects, no need for:
    slider1.on('*', data => socket.emit('slider', {id:1, value: data.value}) );

    Thank you Giulio and Liam.
    Over and Out!!!

    25 days later

    Hi all

    Big props on the bela, I've been having a lot of fun hacking away with it, learning my way around it still. I'm having a tough time connecting libPD to nexusUI on the node server. I'm a fairly novice C++ programmer, still trying to get my head around the OSCPKT Message handling.

    Here's a clone of the proj file (excuse messiness): https://github.com/gingyg/NexusUITest

    Originally I made a Nexus UI matrix object to add to the example from above (https://github.com/BelaPlatform/Bela/tree/dev-nexusUI/examples/05-Communication/NexusUI). It's in the backup folder of the repository. I can only get bela to read that a message is being sent to /nexus-ui/, but not the contents of the message. I also tried modifying the osc message parsing code to the example from this: https://github.com/BelaPlatform/Bela/blob/master/examples/05-Communication/OSC/render.cpp

    Afterwards I tried building a huge matrix of NexusUI buttons in case it was something weird about the matrix class. Still didn't work

    The node console confirms that there is value data coming in (numbers are read). Also I suspect I am not handling the bundling of data correctly?

    Also let me know how to hyperlink text here so that I don't have to pull full links... can't seem to find a button (sorry)

    Thanks!
    -b

      Hi, as far as links are concerned you can use markdown syntax: [your text here](http://your-link.com/here).
      You can inline code snippets using single backticks: `your code here ` and insert code blocks enclosing your blocks in triple backticks (on their own line):
      ```
      your block of
      many lines
      of code
      H e R e
      ```

      For the rest, I think @LiamDonovan is a better candidate to answer your questions!

      gingygingyging I think the problem is probably with the type field of your OSC messages.

      On line 31 of your index.js you are sending an OSC message with two arguments, the first is a string and the second a wildcard, however on line 48 of your render.cpp you are trying to parse an OSC message with an integer argument followed by a float argument. If the number of arguments in the OSC message you are sending or their types differ from what you try to parse in your c++ code, the line

      msg.match("/nexus-ui/").popInt32(intArg).popFloat(floatArg).isOkNoMoreArgs()

      will return false and you won't be able to parse the message. You either need to modify render.cpp to expect the correct arguments or (somewhat easier in my opinion) modify your index.js to send an integer and a float, as in the original nexusUI example.

      @LiamDonovan sorry, just realized you were looking at the backup index.js, but the active one was already sending integer and float

      When I run, it shoots this error up and made the node server unresponsive after (had to pkill and reset to try again).

      nx 71 changed to value undefined
      
      /root/Bela/projects/NexusUITest/node_modules/osc-min/lib/osc-utilities.js:265          
      
      throw new Error("expected number");          
      ^
      Error: expected number    
      at Object.oscTypeCodes.f.toArg (/root/Bela/projects/NexusUITest/node_modules/osc-min/lib/osc-utilities.js:265:17)

      Then a big lists all along the chain where the error persists. You are definitely right about it not sending the correct type of data, I will keep trying to figure out osc-min thanks

      @adowty did you get this working with osc-min and libpd? do you have examples of your code?

        gingygingyging could you post the full output of the error, including particularly the output of the line console.log('nx', data.id, 'changed to value', data.value);.

        What is suspect is happening is that data.value is being sent across from the browser as undefined which is causing errors within osc-min. I would also check inside index.html that the data.value field there in the nexus button callback is defined.

        nx 39 changed to value undefined is the full line for the console log.

        from index.html:

        nx.onload = function() {
        ...//many other buttons w same function, different id number and canvas/nexusUI id
        button27.on('*',function(data){socket.emit('nx', {id:39, value: data.value})});
        ...//other buttons
        };

        Is it that they're all sending to nx in {socket.emit('nx'?

        For the record, the buttons appear properly in 192.168.7.2:3000

          gingygingyging Ok yes it looks like the problem is with the data.value in index.html. Try replacing that line above with the following:

          button27.on('*',function(data){ console.log(data) });

          Hopefully there will be another field in the data object not called value, which actually holds the value of the button, and which you will need to send in the value field of the web socket message.