there are at least four ways you could go about this. In all of these case, the objective is to have Bela and the phone be on the same network, so that you can access the IDE, scope and gui from the phone.
Wireless:
1) add a USB wifi dongle to Bela, connect Bela and the smartphone to the same wifi network,
2) add a USB wifi dongle to Bela, share a wifi network from the phone, connect Bela to the wifi network broadcasted from the phone.
Wired:
3) connect Bela's USB A port to the phone's micro USB (or USB-C). n this configuration the phone is powered from Bela. Enable USB tethering on the phone. On Bela, add these lines to /etc/network/interfaces
:
allow-hotplug usb2
iface usb2 inet dhcp
then run ifup usb2
, where usb2
is the USB network connection to the phone. This way Bela will have internet access through the phone and - most important for your case - it will be on the same network as the phone.
4) [doesn't seem to work] use a USB OTG cable (micro USB /USB C at the phone end, and USB micro at the BelaMini end (or USB mini if using a big Bela)). Plug Bela in there, and it will be powered from the phone. This connection is akin to the one you'd have when plugging Bela on to a computer. On my phone, I the network interface created by Bela over USB does not show up anywhere (that I could find) in the Settings. When listing interfaces with ip a
from the Termux application, however the network is shown, and it is DOWN
and would need a manual command to enable it (e.g.: ifconfig usb0 up
). My phone is not rooted so I cannot do that, but maybe other phones expose USB network connections through the GUI and can be used that way?
You may struggle to figure out what the IP address of Bela is in this network, because bela.local/
wouldn't work on Chrome on Android . I figured out the IP address by connecting to Bela from my laptop while it was connected to wifi or to the phone (first three options above), and running ip a
then made a note of the IP address shown next to the connection to the phone(wlan0
in cases 1 and 2, or usb2
in case 3), and typed that address in the Android phone browser. There may be some Android apps that allow you to scan the network for devices using resolution of .local
domains. A small bash script running in a terminal emulator on the phone (e.g.: in the termux app mentioned above) could achieve something similar.
If case 4) was to work on some device that allows to enable the USB network, then the IP address of Bela would be either 192.168.7.2
or 192.168.6.2
or both ...