that's interesting, thanks for sharing ... so if I understand correctly, on the Bela side you use the Gui library, but without actually visualising the HTML/Js GUI in the browser, rather you establish a websocket connection with the Arduino, right? Out of curiosity, what motivated the use of the Arduino here? Was it to leverage the expanded connectivity or was it mostly about the opportunities of the wireless link? What did you connect to the Arduino?

    The connection is directly to the Bela and bypasses the browser, thereby allowing the Arduino to be used as an instrument and keeps the latency down (I think). When the Arduino is booted it keeps searching indefinitely until it finds the wifi signal (which I'm using a wifi dongle on the Bela setup as an AP) then does the same with the websockets. I've only used actual push buttons so far. Next I plan on connecting some Trill sensors to the Arduino. Also I plan on using arduino's gyroscope and accelerometer as toggles/instruments. It just makes sense to me to use websockets to connect it all since the framework is already there, it's bi-directional, reliable, etc. There's almost no noticeable overhead on the Bela processor. I tried this project using UDP first but it was very cpu intensive.

      giuliomoro I have a usb hub connected to the embedded bela mini I'm using and it's running 3 wifi dongles, one ad-hoc, one ap and one client. I would love to have some usb 3.0 functionality just for the increased throughput and I'm guessing reduced latency, is there a beaglebone I could attach a cape to for easy realization?

      not really 🙁 Either way, I doubt you'll be constrained by the USB 2 bandwidth ... my gut feeling would be that the bottleneck is in the wireless link and/or the co-existence if several antennas in such a constrained space.

      What are you using each dongle for?

      thanks for the clarification.

      ZekeNorris I tried this project using UDP first but it was very cpu intensive.

      that's unexpected... I am wondering there was anything wrong with your implementation ....

        giuliomoro There was possibly error in implementation of UDP. I seem to recall not significantly negligible increase in cpu (~10%) when using bela as a UDP client then something substantial (30-40%) cpu load as a server. Before spending too much time on it I researched websockets more and it seemed on paper to be a non-substantial latency increase with solid error reduction built in. The websockets over wifi have just performed impressively well- and as you mentioned the biggest bottle neck would theoretically seem to be in the usb2, although I haven't noticed much of a hit. I do however see extremely fast connections over the statically coded ad-hoc network along with steady ~ 0.7-2.4 ms max pings vs intermittant 4-5ms pings on the access point network connection along with it taking longer to connect initally and sometimtes not even starting. The wpa_supplicant client connection is pretty stable and in the middle for speed.

          ZekeNorris steady ~ 0.7-2.4 ms max pings vs intermittant 4-5ms pings o

          You'll probably find that you may have much larger peak delays especially under system load. While this specific setup was not analysed, the paper below goes through some of the issues with jitter also related to wireless networks: even if the average latency seems acceptable, the worst-case one is unlikely to be good enough http://www.eecs.qmul.ac.uk/~andrewm/mcpherson_nime2016.pdf

          Also, check out
          S. Madgwick and T. J. Mitchell. x-OSC: A versatile wireless I/O device for creative/music applications. In
          Proc. SMC, 2013.

          ZekeNorris and as you mentioned the biggest bottle neck would theoretically seem to be in the usb2, a

          I actually suggested the bottleneck would be in the wireless link. By the way, what are you using 3 separate dongles at the same time for? What is the purpose of each?

            giuliomoro The reason behind multiple dongles is mainly versatility when it's embedded and difficult to reach physically. One wifi dongle connects to my home router and there are high ping delays due to cross traffic but it reaches the outside internet and is a fail safe in case I screw up one of the other two while tinkering. One is setup as an access point but that one intermittently doesn't even come up and I have to ssh through the first and ifdown/up it. The third is an ad-hoc setup I just started using but it's very quick and stable, my next goal will be to utilize that with arduio and maybe combine two together for more stability/coverage or just get rid of the extra connections to reduce power consumption and resource utilization, still just messing around with it all and having fun.

            giuliomoro Thanks for the read:

            I see there is not much focus on the ad-hoc network, and it actually took a while for me to get it working properly. Also the for the access point I did follow your article:

            and had a hard time getting it to consistently bring itself up, potentially due to my lack of linux experience as well, but after a whole lot of trial and error, it seems the following addition to /etc/network/interfaces helps it remain consistent on reboot:

            allow-hotplug wlan2
            iface wlan2 inet static
             address 192.168.30.1
             netmask 255.255.255.0
             up hostapd /etc/hostapd/hostapd.conf ifup wlan2

            I had tried some other things involving systemd and scripts, but had no luck.

            As for the ad hoc, now that I have it consistently working it is rock solid and very fast. I followed the following article:
            [https://wiki.debian.org/WiFi/AdHoc]
            I'm using ubuntu on my laptop with a wifi usb dongle and it is just very stable and fast. I'm next going to figure out a way if possible to enable ad-hoc on the arduino and see if the jitter is low enough for a solid instrument. If not, I may as mentioned before combine multiple wifi devices for further latency and jitter reduction.

              giuliomoro I'm thinking also maybe using virtual wifi devices over the same connection for redundancy, haven't researched it much but in theory I would imagine it would help with jitter reduction, if anyone has experience it would be welcome to lessen the research/time it will take to learn it lol.

              giuliomoro I don't know if it's the case anytime a new connection is made in linux/ubuntu, but for some reason I think it didn't work until I actually pinged from the laptop to the bela. But after that initial ping, it's been up immediately and very consistent with no additional work required and after any reboot.