Hi there, I've looked over the various posts discussing OSC and have some questions as I am still confused on how to implement.

Context: I am using a Mindwave Mobile headset, routing its data through an Android app called "MindwaveOSC" (which lets you specify the IP and port to send messages to) and receiving its data via OSC into a Max patch. I figure if I can get the data onto my computer using OSC - I should be able to get it into the Bela environment using OSC (vs MIDI out from Max or MIDI out from Android).

Looking over the Bela OSC example I believe I need to use the node.js assistant script running simultaneously. I tried running the script from my computer's console with the Bela plugged in via USB and was unsuccessful.

How do I incorporate the osc.js script onto Bela so I can run the sample code? I think once I have that figured out I can tinker with the code to read messages in sent from the Android device. I have tried updating the Bela with the latest Bela-master.zip to see if I can get the "resources" folder to appear when I type "ls" into the console but with no luck.

Further, will I need a computer to activate the osc.js helper file before Bela can receive OSC messages? Is there a stand-alone solution, where I can embed the Bela into an enclosure and send messages directly to it using the Android app.

    mjio

    You don't need to use the node.js OSC script in order to receive messages in Bela - the script is actually a way of sending test messages to Bela so that you can check your OSC code is working.

    If you configure your Android app to send OSC to Bela's IP address (usually 192.168.7.2) on the same port that Bela is configured to listen on (7562 in the example) you should not need anything else. Bela uses oscpkt to parse the messages.

    • mjio replied to this.

      LiamDonovan Ok thanks for clarifying about the node.js script. In order for the Bela to be able to listen to the messages sent by the Android app, don't they need to be on the same network? I can't envision a way of getting them on the same network. I have tried network sharing from my [apple] computer's network preferences but a school IT profile prevents me from doing such.

      If your computer prevents you from sharing the connection, you would normally use a Wi-fi dongle (or an ethernet cable) on Bela and connect that to a router.

      Home networks should be mostly plug and play (assuming you have the right USB dongle, see here for more info. School networks are most likely going to be a nightmare. Here we use an ad-hoc local network instead of trying to connect to eduroam. (Note that even if you manage to share the connection from your laptop, this may not be the solution, as your school's network setup may block some ports).

      Incidentally, this worked fine for me to share the connection to Bela over USB from eduroam (university network) on MacOS X 10.10 Yosemite:

      $ sudo /usr/sbin/sysctl -w net.inet.ip.forwarding=1
      $ sudo /usr/sbin/natd -interface en1 -dynamic
      $ sudo /sbin/ipfw add divert natd all from any to any via en1

      where en1 is your wifi interface

      additionally, you have to issue proper route and resolv commands on the bbb
      BBB:

      $ echo "nameserver 8.8.8.8" > /etc/resolv.conf
      $ /etc/init.d/networking restart
      you may also need
      $ route add default gw 192.168.7.1 usb0

      where 192.168.7.1 is the address of your host and usb0 is the connection in use 🙂

      works a treat on the imac with yosemite. I don't think it would work on later versions of MacOS