Hi there,

I'm having problems getting the Pd [netsend]/[netreceive] objects to communicate from Bela to my mac - I'm sure this is a very basic question and hopefully very easy to answer.

I've tried normal [netsend], [netsend -u], [netsend 1], and even [netsend -u -b] (with corresponding [netreceive] objects], but nothing ever seems to reach my Pd patch on my mac.

Here is a screenshot of the most recent patch I tested in the IDE:

alt text

And the patch I'm running on the mac:

alt text

As a newcomer to Bela and all means of programming, I've realised I'm a little out of my depth, but I'm trying to find the simplest workaround possible. Many thanks for all your help so far!

This was a bug which got fixed recently. You should update your board, follow instructions here.

Thanks Giulio!

I'd actually already updated, but I finally realised that the problem was that I had a firewall switched on - it was preventing UDP packets from being sent from the Bela into the Mac.

2 months later

Hi Everyone,

I'm having this issue too.

I've made a simple patch to test netreceive:

alt text

And I get a lot of Mode Switches:

alt text

I updated the board from your prior post but that doesn't seem to fix the issue.

hmmm can you run

grep PD_THREADED_IO /root/Bela/core/default_libpd_render.cpp

in the console at the bottom of the IDE and see what it returns?

right, it seems that your update didn't get through, because you should get one extra line

#define PD_THREADED_IO

Can you try to update again? To avoid doubts, this is the zip archive you should use : https://github.com/BelaPlatform/Bela/archive/master.zip

I've been using an old Bela board. I tried the update again (from your zip) but no luck.

I had a newer Bela board in storage so I grabbed that and now everything is working fine.

    giuliomoro

    I did, but the error got cleared during the update process. Can I run the update in my terminal to avoid the console being cleared?

    sure, just uncompress the archive, and run from the terminal Bela/scripts/update_board -y

    2 years later

    Hello

    I am having trouble using [netsend] from Bela to PD running on my laptop. Should the patch running on bela connect to http://192.168.7.2/ or localhost? (i tried both to no avail)

    I am able to successfully send data from my laptop to bela via [netsend] to http://192.168.7.2/, so it rules out the issues described in the thread above.

    thank you
    James

    What is created by the USB driver is a local network between Bela and the host computer, where each device has a different IP:

    • host computer is 192.168.7.1
    • Bela is 192.168.7.2

    As usual, each device can send data to itself at the IP address 127.0.0.1, or equivalently the named server localhost.

    Therefore the host would use the following to send to Bela:

    [loadbang]
    |
    [connect 192.168.7.2(
    |
    [netsend]

    and Bela would use the following to send to the host:

    [loadbang]
    |
    [connect 192.168.7.1(
    |
    [netsend]

    Hey thank you for the quick and detailed reply (as always!)

    For some reason my network shows 2 bela devices (I only have one)

    alt text

    so I had to use the secondary address of 192.168.6.1 instead of 192.168.7.1 to send from the board.

    Not sure why that happened but I'll remember to check that next time.

    cheers

      jamesstaub For some reason my network shows 2 bela devices (I only have one)

      this is explained here.

      jamesstaub so I had to use the secondary address of 192.168.6.1 instead of 192.168.7.1 to send from the board.

      That's unexpected to me, I would have expected that either would work. Does the 192.168.7.1 not work?

        giuliomoro no it did not work when my network was showing both. After disconnecting and reconnecting I've got only the .7 address and that's working again

        that's confusing and needs investigation. You may want to disable one of the two networks, e.g.: disable it on the macos side, or by removing the related entries in /etc/network/interfaces and /etc/dhcp/dhcpd.conf on the board (you should reboot after editing, but be careful that a corrupted file may mean you won't be able to connect back to the board, so make sure you backup your projects first).

        3 years later

        Hi, I've got some issue with the [netsend] module on Bela Mini- from what I've observed so far the situation is as follows:

        I run Bela Mini in standalone mode (i.e. not connected to the laptop) and I'm using a wifi dongle to connect to a network. Pure Data patch sends out some data in OSC protocol via [netsend]. Every now and then the whole patch restarts. My suspicion is that it happens due to the loss of connection to the network - the patch crashes when I try to send out some data via OSC (e.g. I press a button which sends a midi note number). The only time it happend while Bela was connected to the laptop, there was some info printed out in the IDE console, but I've neglected to copy it (when I'm trying to recreate the situation now with Bela connected to the laptop, strangely it doesn't happen, even if I turn off the wifi router to which Bela is connected). So I don't have any report from the console that I could post here, unfortunately.

        The main question, though, is as follows: is there a way to make [netsend] behave the same way it does when Pd runs on a laptop - i.e. when the device disconnects from the network, rather than crash, [netsend] sends "0" to it's left outlet, which could be used to try and reestablish the connection? I don't mind if I loose snippets of OSC data every now and then, but a crash and a restart is a major problem for me.

        After it crashes , log onto the board and access the log with journalctl -u bela_startup -n 2000 --boot | cat and see if there is any useful information there.

        I've managed to recreate the situation. Here's the info from the Bela IDE console:

        I/O thread warning: Error on outgoing socket. Discarding 0 bytes of anoutgoing packet of size 16
        I/O thread warning: failed sendto(63, 0x4a0840, 16, 0, 0xb587bd70, 16) call: 101 Network is unreachable
        Segmentation fault
        make: *** [runide] Error 139
        Makefile:613: recipe for target 'runide' failed
        Bela stopped