You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: content/hardware/04.pro/shields/portenta-vision-shield/tutorials/ethernet-with-openmv/content.md
+11-11Lines changed: 11 additions & 11 deletions
Original file line number
Diff line number
Diff line change
@@ -34,7 +34,7 @@ With the Ethernet version of the Arduino Portenta Vision Shield it is possible t
34
34
- Ethernet cable
35
35
- USB-C cable
36
36
37
-
***If you want to know about the ethernet connection please go to the [Arduino IDE ethernet tutorial](https://docs.arduino.cc/tutorials/portenta-vision-shield/ethernet-with-ide#ethernet-connection)***
37
+
***If you want to know more about the ethernet connection please go to the [Arduino IDE ethernet tutorial](https://docs.arduino.cc/tutorials/portenta-vision-shield/ethernet-with-ide#ethernet-connection)***
38
38
39
39
## Instructions
40
40
@@ -44,17 +44,17 @@ Connect the Portenta Vision Shield Ethernet to the Portenta H7. Now connect the
44
44
45
45
### Programming the Board
46
46
47
-
After everything is connected, connect the board to OpenMV to install the latest firmware. Once it is connected, we can open the example we are going to upload. In OpenMV go to: **File > Examples > Arduino > Portenta H7 > Ethernet > http_client.py**.
47
+
After everything is connected, connect the board to OpenMV to install the latest firmware. Once it is connected, you can open the example we are going to upload. In OpenMV go to: **File > Examples > Arduino > Portenta H7 > Ethernet > http_client.py**.
48
48
49
49

50
50
51
-
Next we will look at some of the code in the example script.
51
+
Next you can have a look at some of the code in the example script.
52
52
53
53
### Testing It Out
54
54
55
-
Now lets take a look at some important parts of the code.
55
+
Now let's take a look at some important parts of the code.
56
56
57
-
First we are making use of some micropython libraries, [network](http://docs.micropython.org/en/latest/library/network.html) and [usocket](http://docs.micropython.org/en/v1.14/library/usocket.html).
57
+
First you are making use of some micropython libraries, [network](http://docs.micropython.org/en/latest/library/network.html) and [usocket](http://docs.micropython.org/en/v1.14/library/usocket.html).
58
58
59
59
```arduino
60
60
import network, usocket
@@ -67,7 +67,7 @@ PORT = 80
67
67
HOST = "www.google.com"
68
68
```
69
69
70
-
The `usocket.getaddrinfo(HOST, PORT)[0][4]` function will translate the host/port argument into a sequence of 5-tuples that contain all the necessary arguments for creating a socket connected to that service. Then we can create a socket object with `usocket.socket(usocket.AF_INET, usocket.SOCK_STREAM)`. We can combine these variables we have created, allowing us to connect the socket to our desired address.
70
+
The `usocket.getaddrinfo(HOST, PORT)[0][4]` function will translate the host/port argument into a sequence of 5-tuples that contains all the necessary arguments for creating a socket connected to that service. Then, you can create a socket object with `usocket.socket(usocket.AF_INET, usocket.SOCK_STREAM)`. You can combine these variables you have createdto connect the socket to your desired address.
71
71
72
72
```arduino
73
73
addr = usocket.getaddrinfo(HOST, PORT)[0][4]
@@ -83,20 +83,20 @@ This will print the websites content in the serial terminal in OpenMV. The argum
83
83
print(client.recv(1024))
84
84
```
85
85
86
-
After the board has printed all of the websites content it will automatically disconnect with a simple `close()` call. Now lets take a look at what the output should look like if everything went correctly.
86
+
After the board has printed all of the websites content, it will automatically disconnect with a simple `close()` call. Now let's take a look at what the output should look like if everything went correctly.
87
87
88
88
### Sketch Result
89
89
90
-
After uploading the sketch, open the serial terminal. The board will connect to a website. Then print the websites content in the serial terminal. If everything went correctly your serial terminal should look like the image below.
90
+
After uploading the sketch, open the serial terminal. The board will connect to a website. Then print the websites content in the serial terminal. If everything went correctly, your serial terminal should look like the image below.
91
91
92
92

93
93
94
-
After the connection has been made, the html code of the website entered into the sketch will be printed in the serial monitor.
94
+
After the connection has been made, the html code of the website entered into the sketch will be printed in the Serial Monitor.
95
95
96
96
## Conclusion
97
97
98
-
This tutorial showed how to connect the Portenta H7 with a Vision Shield Ethernet to the Internet, with an example script in the OpenMV. The sketch allowed the board to connect to a website and print it's content. The Portenta H7 and Vision Shield can also be used with the Arduino IDE, have a look at the [Arduino IDE Ethernet tutorial](https://docs.arduino.cc/tutorials/portenta-vision-shield/ethernet-with-ide) if you want to see a similar example.
98
+
This tutorial showed how to connect the Portenta H7 with a Vision Shield Ethernet to the Internet, with an example script in the OpenMV. The sketch allowed the board to connect to a website and print its content. The Portenta H7 and Vision Shield can also be used with the Arduino IDE, have a look at the [Arduino IDE Ethernet tutorial](https://docs.arduino.cc/tutorials/portenta-vision-shield/ethernet-with-ide) if you want to see a similar example.
99
99
100
100
### Next Steps
101
101
102
-
Now that you know the basics of how to establish a connection to the Internet with Ethernet, you can try to create more advanced scripts with this connection. An Ethernet connection allows you to send HTTP methods to another device, communicate with another device, API, or even another Portenta. A good next step would be to take a look at the other examples listed under Ethernet in OpenMV, or take a look at the library documentation.
102
+
Now that you know the basics of how to establish a connection to the Internet with Ethernet, you can try to create more advanced scripts with this connection. An Ethernet connection allows you to send HTTP methods to another device, communicate with another device, API, or even another Portenta. A good next step would be to take a look at the other examples listed under Ethernet in OpenMV, or take a look at the library documentation.
0 commit comments