Ok, so I have an Ubuntu laptop with Wi-Fi, to which I attach a Bela.io; I'd like the Bela to use internet from the Ubuntu laptop's WiFi, through the USB connection.
I have learned through this forum and other posts, that what I should do is, in principle:
- Attach Bela.io to Ubuntu laptop
- When a network connection is established (typically visible as
usb0
on Ubuntu laptop), then via NetworkManager on Ubuntu laptop, one should set this connection through its "IPv4 Settings" tab as "Shared to other computers", and then set the connection's IP adress to 192.168.7.1 (so it is fixed); then save the connection
- Finally, detach then attach the Bela again via USB to Ubuntu laptop - Ubuntu should boot up the network connection again; after logging in to the Bela.io via
ssh root@192.168.7.2
, execute (on the Bela bash prompt): route add default gw 192.168.7.1
or ip route add default via 192.168.7.1
-> then ping yahoo.com
should work...
I tried the above first with Ubuntu 14.04, but I couldn't set up the network connection to both be "Shared to other computers" and have a fixed IP of 192.168.7.1 - this turned out to be fixed in newer Ubuntus (see https://askubuntu.com/questions/609645/configure-connection-sharing-with-specific-ip-address), so I upgraded PC/laptop to Ubuntu 18.04.
With Ubuntu 18.04 and one Bela.io I had worked with, this worked great; this Bela apparently had an older image:
root@bela ~$ uname -a
Linux bela 3.8.13xenomai-bone41 #2 Wed Mar 26 11:41:31 GMT 2014 armv7l GNU/Linux
So, now I'm working with another Bela, which apparently has a newer image:
root@bela:~# uname -a
Linux bela 4.4.87-ti-xenomai-r121 #1 PREEMPT Wed Oct 25 17:50:16 BST 2017 armv7l GNU/Linux
Now, I simply CANNOT repeat the above procedure, because whenever I connect the Bela, edit its network connection (in 18.04 it has to be through the nm-connection-editor
command) to set it to shared and a fixed IP, saved, and un/re-plugged the Bela via USB - NetworkManager simply ignores the old (edited) network connection, and creates a new one! 🙁 Which means I can never set up a connection to be Shared with Fixed IP address, since at each new USB plugging, I get a new network connection created, with default settings that do not include internet sharing 🙁
I've posted about the Ubuntu side of things here (no answers as of yet):
https://askubuntu.com/questions/1082926/have-network-manager-1-10-6-reuse-existing-usb-network-connection-new-network-c
... however, I was thinking - since I had confirmed the above approach working, on the same laptop and Ubuntu 18.04 OS - but with a Bela with an older image; - it must be something in the new Bela image, that sets up the connection differently from Bela's side: say, maybe a different, random MAC address is used? (I should note that I tried specifying a fixed MAC address from Bela's /etc/network/interfaces
by adding hwaddress ether DE:AD:BE:EF:CA:FE
under iface usb0 inet static
, that didn't help. Also, as I see it, this is the MAC address by which the Bela.io will see its own usb0
network connection - not necessarily the MAC address that the Ubuntu PC/laptop will see, once the Bela has been attached to it?).
Or, maybe some other parameter is changed, other than a randomized MAC address?
I'm guessing this probably has to do with something related to RNDIS on the Bela, which I hear of the first time today, so I don't quite know it.
Would anyone know, what could I possibly do on the Bela, so that when it is attached to Ubuntu 18.04 PC/laptop, the Ubuntu will note that this is the same device as the one in an earlier network connection, thus ending up using this earlier network connection, instead of creating a new one?