Skip to content

Create setting-up-ethernet-over-usb-on-linux-command-line.md #39

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,82 @@
---
title: Setting Up Ethernet Over USB on Linux with Command Line
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What tools are you using? The name of the tools should be added to the title. For example, it is possible to configure NetworkManager from the command line. If I was doing this, I would make the title something like "Setting Up Ethernet Over USB on Linux using NetworkManager via the Command Line"

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Okay, The RaspberryPi doesn't have network-manager installed by default.
When I find a persistent method then I will update the title accordingly.

subject: Ethernet Over USB
---

1. On the EV3, first verify that the CDC driver is enabled. In brickman,
open the *USB* settings and make sure *CDC* is selected and active.

{% include screenshot.html source="/images/brickman/usb-cdc-active.png" %}

2. Then, in *Networking*, make sure *Gadget* is enabled.

{% include screenshot.html source="/images/brickman/networking-technologies-gadget-selected.png" %}

3. On your host computer, with the Ev3 connected via USB, open a *Terminal* and run

user@host:~$ ifconfig | grep usb

Assuming there is only ```usb0``` the output should look like:
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code snippets actually only need one backtick like this: usb0 (unless the snippet contains a backtick as well like in this comment).

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you! I've done so many code snippets in commit messages and comments and have always been using three.


usb0 Link encap:Ethernet HWaddr 12:16:53:46:2e:42

Now set the ip address of ```usb0``` to ```10.42.0.1``` with the following command. The ```/24``` lets the host computer know the range of ip addresses connected to this interface.

user@host:~$ sudo ip ad add 10.42.0.1/24 dev usb0
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am not familiar with setting up the network this way. Does this persist across reboots? Does it make changes to /etc/network/interfaces?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No, actually it's not even persistent when the USB cable is removed and re inserted.
It doesn't change /etc/network/interfaces.

I will find a way to do it persistently - edit /etc/network/interfaces is one, I'll check if there is another.


4. Now, we need to assign an IP address to our EV3. In brickman, go to
*Networking* and select *Manage connections...*, then select the *Wired*
connection.

{% include screenshot.html source="/images/brickman/networking-connections-wired-only.png" %}

On the *IPv4* tab, select *Change...*.

{% include screenshot.html source="/images/brickman/networking-ipv4-tab-change-selected.png" %}

Then choose *Load Linux Defaults*.

{% include screenshot.html source="/images/brickman/networking-load-linux-defaults.png" %}

The settings on the *IPv4* tab will remain blank because we are not
connected yet. On the *Conn.* tab, check the box for *Connect automatically*.
This way you don't have to connect manually after you reboot.

{% include screenshot.html source="/images/brickman/networking-connect-automatically-selected.png" %}

Then select *Connect*. *State* should change to *Online*. Go back to
the *IPv4* tab. It will show the IP address of your EV3.

{% include screenshot.html source="/images/brickman/networking-ipv4-tab-with-linux-defaults.png" %}

5. Now we are going to connect to the EV3 using ssh.

user@host:~$ ssh [email protected]

If you have never connected before, you will prompted to confirm the
authenticity of the host, so type `yes` when prompted.

The authenticity of host '10.42.0.3 (10.42.0.3)' can't be established.
ECDSA key fingerprint is be:9e:66:8b:d1:14:b8:8a:ea:4c:6e:07:2d:d9:68:05.
Are you sure you want to continue connecting (yes/no)? yes
Warning: Permanently added '10.42.0.3' (ECDSA) to the list of known hosts.

The default root password is `r00tme`.

[email protected]'s password:
Linux ev3dev 3.3.0-0-ev3dev #2 PREEMPT Wed Mar 19 20:10:05 CDT 2014 armv5tejl
_____ _
_____ _|___ / __| | _____ __
/ _ \ \ / / |_ \ / _` |/ _ \ \ / /
| __/\ V / ___) | (_| | __/\ V /
\___| \_/ |____/ \__,_|\___| \_/

Debian GNU/Linux 7 on LEGO MINDSTORMS EV3!

The programs included with the Debian GNU/Linux system are free software;
the exact distribution terms for each program are described in the
individual files in /usr/share/doc/*/copyright.

Debian GNU/Linux comes with ABSOLUTELY NO WARRANTY, to the extent
permitted by applicable law.
root@ev3dev:~#