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/carriers/portenta-hat-carrier/tutorials/user-manual/content.md
+49-17Lines changed: 49 additions & 17 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -417,17 +417,7 @@ The file is uploaded to `/home/fio` directory. Navigate to the directory using A
417
417
python3 hello_world_python.py
418
418
```
419
419
420
-
Portenta Hat Carrier's user programmable LED will start blinking whenever the script is running. If you wish to upload to a containerized environment, as a Docker container, the following command can be used to do so:
421
-
422
-
```bash
423
-
docker cp hello_world_python.py mycontainer:/app/
424
-
```
425
-
426
-
Then the script can be used by accessing the container with the following command:
427
-
428
-
```bash
429
-
docker exec -it mycontainer sh
430
-
```
420
+
Portenta Hat Carrier's user programmable LED will start blinking whenever the script is running.
431
421
432
422
#### Hello World Using Linux and Docker
433
423
<br></br>
@@ -766,24 +756,66 @@ Devices with a USB-A interface, such as storage drives, can be used for logging
766
756
#### Using Linux
767
757
<br></br>
768
758
769
-
As an example, following command on Portenta X8's shell can be used to test write command with a USB memory drive.
759
+
As an example, following command on Portenta X8's shell can be used to test write command with a USB memory drive. To write a file, following sequence of commands can help you accomplish such task.
760
+
761
+
```bash
762
+
dmesg -w
763
+
```
764
+
765
+
The `dmesg -w` command displays kernel messages, helping you monitor system events in real-time. It is particularly useful to see if it has recognized the USB drive when plugged in.
770
766
771
767
```bash
772
-
dd if=/dev/urandom of=random.bin bs=1M count=128
768
+
lsblk
773
769
```
774
770
775
-
This command will create a _random.bin_ file filled with 128 Megabytes of random data. It reads data from the system's pseudo-random number generator `/dev/urandom` and writes it to the file in chunks of 1 Megabyte.
771
+
The `lsblk` command lists all available block devices, such as hard drives and USB drives. It helps in identifying the device name, like `/dev/sda1` which is the partition designation, of the plugged-in USB drive.
772
+
773
+
```bash
774
+
mkdir -p /mnt/USBmount
775
+
```
776
+
777
+
The `mkdir -p` command creates the directory `/mnt/USBmount`. If the directory already exists, this command won't produce an error. This directory will be used as a mount point for the USB drive.
778
+
779
+
```bash
780
+
mount -t vfat /dev/sda1 /mnt/USBmount
781
+
```
782
+
783
+
This mount command mounts the USB drive, assumed to have a FAT filesystem (`vfat`), located at `/dev/sda1` to the directory `/mnt/USBmount`. Once mounted, the content of the USB drive can be accessed from the `/mnt/USBmount` directory.
This command will create a _random.bin_ file filled with 16 Kilobytes of random data. It reads data from the system's pseudo-random number generator `/dev/urandom` and writes it to the file in chunks of 1 Kilobyte.
776
790
777
791
To read the _random.bin_ file with random data, you can use the following command:
This will read the previously generated _random.bin_ file and displays its content in a hexadecimal format on the console. Data is read in chunks of 1 Megabyte up to 128 Megabytes and then processed for display using `hexdump`.
797
+
This will read the previously generated _random.bin_ file and displays its content in a hexadecimal format on the console. Data is read in chunks of 1 Kilobyte up to 16 Kilobytes and then processed for display using `hexdump`.
784
798
785
799
***Reading the entire _random.bin_ file with the `hexdump` command will produce a large output on the console. Use with caution.***
786
800
801
+
In the Portenta X8's shell, if you aim to create a text file containing the message `Hello, World!` on a USB memory drive, you can employ the command:
This command uses the `dd` utility, combined with process substitution. Specifically, it seizes the output of the `echo` command, responsible for generating the `Hello, World!` message, and channels it as an input stream to `dd`.
808
+
809
+
Subsequently, the message gets inscribed into a file named _helloworld.txt_ situated in the `/mnt/USBmount` directory.
810
+
811
+
After creating the file, if you wish to retrieve its contents and display them on the shell, you can use:
812
+
813
+
```bash
814
+
dd if=/mnt/USBmount/helloworld.txt bs=1K count=1
815
+
```
816
+
817
+
This command directs `dd` to peruse the contents of _helloworld.txt_. With a specified block size of 1 Kilobyte, the reading is confined to a single block—adequate given the brevity of the `Hello, World!` message. Upon executing this command, the content of the text file will be displayed on your shell.
818
+
787
819
#### Using Arduino IDE
788
820
<br></br>
789
821
@@ -2762,7 +2794,7 @@ It can interact with up to four relay ports on the board. Among its various feat
0 commit comments