Skip to content
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

Update connecting-to-the-internet-via-usb.md #306

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

ghpille
Copy link

@ghpille ghpille commented Dec 9, 2016

I've never used Gnome, and never any GUI for my network connections. I couldn't find how to establish the connection, so I found out myself, but I wanted to register what I learned. This page seemed the most appropriate place.

Copy link
Member

@dlech dlech left a comment

Choose a reason for hiding this comment

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

Thanks for the pull request. There are a few things I would like to fix before we merge it.

Also see #39. It is basically the same thing as what is being added here, but was never finished. It is quite a bit out of date, but there may be some useful info there.

3. Set default Linux network settings: "Wireless and Networks" > "All Network Connections" > "Wired" >
"IPv4" > "Change" > "Load Linux Defaults". The EV3 should get address 10.42.0.3, gateway 10.42.0.1.

4. Verify if the EV3 is recognized by your Linux PC: "lsusb" should show
Copy link
Member

Choose a reason for hiding this comment

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

use single backtick instead of quotes for lsusb

@@ -135,6 +135,75 @@ If you are using an older version, please upgrade.

{% include /util/screenshot.html source="/images/brickman/wired-status-online-connect-automatically-selected.png" %}


* {: tab="Debian_commandline"}{% include /style/icon.html type="info" %}
Copy link
Member

Choose a reason for hiding this comment

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

There doesn't seem to be anything Debian-specifc here. Maybe we could just call this "linux_command_line"?

Copy link
Author

Choose a reason for hiding this comment

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

You're probably right.


* {: tab="Debian_commandline"}{% include /style/icon.html type="info" %}
These instructions were written using Debian look-alikes for those wanting to know what happens under the hood.
The commands need to be executed by or as root.
Copy link
Member

Choose a reason for hiding this comment

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

"by or as" seems redundant. One or the other is sufficient.

Copy link
Author

Choose a reason for hiding this comment

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

as = sudo


2. Verify that USB tethering is disabled: "Wireless and Networks" > "Tethering.

3. Set default Linux network settings: "Wireless and Networks" > "All Network Connections" > "Wired" >
Copy link
Member

Choose a reason for hiding this comment

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

To be consistent with the rest of the website, use italics for name of things printed on the screen.

*Wireless and Networks > All Network Connections > Wired*

Also, a screenshot here would be nice. We may have some existing ones that can be reused.

Copy link
Author

Choose a reason for hiding this comment

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

Do you mean screenshots of how to navigate through ev3dev's menus?


4. Verify if the EV3 is recognized by your Linux PC: "lsusb" should show

`Bus 001 Device 002: ID 0525:a4aa Netchip Technology, Inc. Linux-USB CDC Composite Gadge (Ethernet and ACM)`
Copy link
Member

Choose a reason for hiding this comment

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

indent 4 extra spaces instead of using single backtick

Copy link
Member

Choose a reason for hiding this comment

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

With #307, we'll be able to use code fences, so let's replace this with a fence and not remove the fences in other places. Fences are much more readable than indentation.

Copy link
Member

Choose a reason for hiding this comment

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

Fences are much more readable than indentation.

I disagree.

Copy link
Member

Choose a reason for hiding this comment

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

Although it really doesn't make a difference in normal text, in lists I find it very hard to identify code formatting when it's space-indented. I think that code fences make it much easier to quickly identify the code in an indented list.

Copy link
Member

Choose a reason for hiding this comment

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

In lists, it is still indented 4 extra spaces from the list text, so it looks exactly the same as normal text to me.

And regardless of any opinions on which is "better", the rest of the website uses indents, so I would like to stay consistent with that.

Copy link
Member

Choose a reason for hiding this comment

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

Additionally, indented code is a pain to edit, especially in lists.

Copy link
Member

Choose a reason for hiding this comment

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

How so?

Copy link
Member

Choose a reason for hiding this comment

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

OK, I've changed my mind (c.f. #308).

In this pull request though, I would like to have a blank line before the start of each code fence.

Copy link
Member

Choose a reason for hiding this comment

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

In lists, it is still indented 4 extra spaces from the list text, so it looks exactly the same as normal text to me.

It's extremely difficult to differentiate between sub-bullets, indented additional lines, and code blocks; they all are indented in the same way. Using indentation for code blocks is an unnatural use of whitespace, and as a result it conflicts with all the other uses of whitespace.

And regardless of any opinions on which is "better", the rest of the website uses indents, so I would like to stay consistent with that.

argumentum ad antiquitatem. "It has always been done this way" isn't a reason to continue doing it; switching to code fences is trivial and something that I would happily put in the work for now that we have that ability.

How so?

Because you must maintain the indentation. Every line must be prepended with four spaces, so not only do you need to add the spacing before every line, but you also need to mess with indentation when copy-pasting code. This is especially difficult in GitHub's online editor.

Copy link
Member

Choose a reason for hiding this comment

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

Oh, it looks like GitHub has decided not to auto-load comments on review threads 😆 Sounds good.

`# ifconfig enp0s2f1u5 10.42.0.1 netmask 255.255.255.0 up`

8. Verify if you can ping the EV3:
```
Copy link
Member

Choose a reason for hiding this comment

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

indent 4 extra spaces instead of using code fence

connection which you want to make available to your EV3, there is more that needs to be done.

10. Allow your system to forward IP traffic (given eth0 carries your internet connection):
```
Copy link
Member

Choose a reason for hiding this comment

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

and here

# echo 1 > /proc/sys/net/ipv4/ip_forward
```
(to make this permanent, add "net.ipv4.ip_forward=1" to /etc/sysctl.conf)
```
Copy link
Member

Choose a reason for hiding this comment

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

and here


11. Assign a name-server (eg. google-public-dns-a) to your EV3 (you need to be logged in on your EV3 as root):

`# echo "nameserver 8.8.8.8" > /etc/resolv.conf`
Copy link
Member

Choose a reason for hiding this comment

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

We use ConnMan on the EV3 for network management. It will write over any changes made manually to /etc/resolv.conf. Instead a step should be added after step 3 that explains how to set the DNS using Brickman.

Copy link
Author

Choose a reason for hiding this comment

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

I did some reading about connman (does it sound like con-man?), tried in vain to get it to do what I wanted, and disabled it. Now, ev3dev nicely configures the network the way I tell it to in /etc/network/interfaces and /etc/resolv.conf.

12. Verify if you can ping that nameserver:

`# ping 8.8.8.8`

Copy link
Member

Choose a reason for hiding this comment

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

Shouldn't there be a step where you press the Connect button for the network connection on the EV3? When you do this, it will say "Online" on the screen, which verifies that DNS resolution is working.

Copy link
Author

Choose a reason for hiding this comment

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

Quite right, after selection of the "Load Linux Defaults", but possibly because of the manual interventions, the state remains "Connected", even though I can "apt-get upgrade".

@ghpille
Copy link
Author

ghpille commented Dec 10, 2016

Hallo David,
I was quite angry this morning, just after having issued my pull request, when I came across #39. I hate to waste my time, not so much finding a solution myself, that's always fun, but getting to grips with Github and its PITA editor. Then, scanning the pull requests, I found the same information was entered two years ago.
You'll need to convince me to put any more effort into documenting my encounters with EV3.
Kind regards,
Gerard

Forgot an elementary part of this exercise: loading the g_cdc module.
@dlech
Copy link
Member

dlech commented Dec 11, 2016

I am sorry that this makes you angry. I hope that you are willing to complete this work so that other people will not have to be frustrated like you are now.

@ghpille
Copy link
Author

ghpille commented Dec 12, 2016

Can you tell me what went wrong with #39 so that I don't make the same mistake? Can I update the documentation offline and avoid the Github-interface? Is it possible to see what it will look like? The Github online editor's "preview" looks nothing like the real page.

@ghpille
Copy link
Author

ghpille commented Dec 12, 2016

Just found the answers to my offline and preview questions in the README.md. What a strange name for that document. Why is it called "README.md"?

@WasabiFan
Copy link
Member

What a strange name for that document. Why is it called "README.md"?

Because that is the convention across GitHub and the broader software-development world. The expectation is that you will "read it" (hence "read me") to get important information on the project you are looking at. GitHub extends that basic idea to render the README as the home page of your repository. I would recommend getting into the habit of reading the opening paragraph of every README that you see on GitHub, because it'll probably answer most of your questions about the project.

@ghpille
Copy link
Author

ghpille commented Dec 12, 2016

Sorry about that, WasabiFan, this is probably not the right place, but I was only making fun of myself.

@dlech
Copy link
Member

dlech commented Dec 12, 2016

Can you tell me what went wrong with #39 so that I don't make the same mistake?

Nothing went wrong. The submitter just did not make time to address the review comments. You have already done this (thank you), so there is nothing to worry about.

@WasabiFan
Copy link
Member

@dlech can you take another pass at this now that your review has been addressed?

@WasabiFan WasabiFan requested a review from dlech December 20, 2016 06:25

1. Booting with a standard ev3dev image, lsusb will show

`Bus 002 Device 008: ID 0694:0005 Lego Group`
Copy link
Member

Choose a reason for hiding this comment

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

This should be using code fence. e.g.

```
Bus 002 Device 008: ID 0694:0005 Lego Group
```


10. Assign the gateway address to the EV3 network device:

`# ifconfig enp0s2f1u5 10.42.0.1 netmask 255.255.255.0 up`
Copy link
Member

Choose a reason for hiding this comment

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

code fence

13. Allow your system to forward IP traffic (given eth0 carries your
internet connection):

`# echo 1 > /proc/sys/net/ipv4/ip_forward`
Copy link
Member

Choose a reason for hiding this comment

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

code fence

14. Assign a name-server (eg. google-public-dns-a) to your EV3 (you need
to be logged in on your EV3 as root):

`# echo "nameserver 8.8.8.8" > /etc/resolv.conf`
Copy link
Member

Choose a reason for hiding this comment

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

As I mentioned in my previous review, ev3dev uses ConnMan for network management. It will write over /etc/resolv.conf, so I don't thing manually editing it is a good idea. Instead, I think it would be better to set the nameserver using Bricman at the same time we are setting the manual configuration above.


15. Verify if you can ping that nameserver:

`# ping 8.8.8.8`
Copy link
Member

Choose a reason for hiding this comment

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

Again, as in my previous review, I mentioned that it is possible to see the connection status using Brickman. It would save the steps of having to log in to the EV3 in order to complete this tutorial.

Copy link
Author

Choose a reason for hiding this comment

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

I see. In that case we can drop steps 1 to 15.


4. Connect the USB cable to your computer and its mini-B plug to the EV3 (slot marked "PC").

5. Verify that USB tethering is disabled: *"Wireless and Networks" > "Tethering*.
Copy link
Member

Choose a reason for hiding this comment

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

Prefer no quotes on *Wireless and Networks > Tethering*

If you insist on quotes, you are missing one at the end of Tethering.

Copy link
Member

Choose a reason for hiding this comment

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

This could also be more clear that we are now using the EV3, not the host computer.


5. Verify that USB tethering is disabled: *"Wireless and Networks" > "Tethering*.

6. Set default Linux network settings: *"Wireless and Networks" > "All Network Connections" > "Wired" >
Copy link
Member

Choose a reason for hiding this comment

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

again, prefer no quotes here

The commands need to be executed by root.
{:class="alert alert-info"}

1. Booting with a standard ev3dev image, lsusb will show
Copy link
Member

Choose a reason for hiding this comment

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

This is not clear if lsusb should be run on the EV3 or the host computer.

Copy link
Author

Choose a reason for hiding this comment

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

I think you should give some credit to the people interested in this subject: they would not expect to see the EV3 when lsusb would be run on the EV3. Moreover, before step 12 it is not possible to enter an OS command on the EV3. But I'll try to add this to the introduction, along with Debian version etc.


I'll be using the EV3 as a USB Gadget, as follows.

2. When you've copied the ev3dev's image to the SD-card, mount the second partition (EV3DEV_ROOTFS).
Copy link
Member

Choose a reason for hiding this comment

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

Why are we doing this? ev3dev already sets up a gadget driver by default. Does it not work for you?

@@ -135,6 +135,99 @@ If you are using an older version, please upgrade.

{% include /util/screenshot.html source="/images/brickman/wired-status-online-connect-automatically-selected.png" %}


* {: tab="linux_command_line"}{% include /style/icon.html type="info" %}
These instructions were written using Debian look-alikes for those wanting to know what happens under the hood.
Copy link
Member

Choose a reason for hiding this comment

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

Please mention the exact debian version that was used for the tutorial. We should also mention that is should work for most Linux distros that don't otherwise have a network manager program (or something like that).

@WasabiFan
Copy link
Member

@ghpille Are you going to be able to finish this? I really want to make sure that we get these changes merged this time!

@ghpille
Copy link
Author

ghpille commented Dec 29, 2016

@WasabiFan I certainly hope so, but currently facing a part of my roof taken away by a storm and my girlfriends heating system breaking down while it's winter down here. Priorities, priorities ...

@WasabiFan
Copy link
Member

currently facing a part of my roof taken away by a storm

Aw, I hate when that happens 😉


No problem, I just wanted to make sure this wasn't forgotten about. There's no rush on this work.

@egnrse
Copy link
Contributor

egnrse commented Aug 4, 2017

@ghpille why aren't you finishing this??

@ghpille
Copy link
Author

ghpille commented Aug 9, 2017

@enitsche Are you interested in my private life? It took me a couple of weeks to replace my girlfriends heating system, the replacment weighing some 280kg. The same time I had to replace a 200l boiler. Then my dog died, took me a week to find a new one, but this last one asks for more attention then the previous one. I've been on holiday for 3 weeks to southern France, spent an entire weekend making plum jam, had a small car accident but it took me some time to repair the damage. I don't keep a diary, there are large hiatuses.

Dlech made it clear that the steps I added to the tutorial, are unnecessary. In that case, why would I finish it?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants