Skip to content

Commit b6fd667

Browse files
committed
Review suggestions applied 1/2
1 parent ea9675e commit b6fd667

File tree

1 file changed

+54
-2
lines changed
  • content/hardware/02.uno/boards/uno-q/tutorials/01.user-manual

1 file changed

+54
-2
lines changed

content/hardware/02.uno/boards/uno-q/tutorials/01.user-manual/content.md

Lines changed: 54 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -793,7 +793,11 @@ While the `Bridge` library is what you use in your code, the Router is the traff
793793

794794
**Key Features:**
795795

796-
- **Multipoint Communication:** Unlike simple serial communication (which is typically point-to-point), the Router allows multiple Linux processes to communicate with the MCU simultaneously. For example, you could have a Python script reading sensor data while a separate C++ application commands motors, both interacting with the same running Sketch.
796+
- **Multipoint Communication:** Unlike simple serial communication (which is typically point-to-point), the Router allows multiple Linux processes to communicate with the MCU simultaneously (and with each other).
797+
798+
**Linux ↔ MCU:** Multiple Linux processes can interact with the MCU simultaneously (e.g., a Python script reading sensors while a separate C++ application commands motors).
799+
800+
**Linux ↔ Linux:** You can use the Router to bridge different applications running on the MPU. For example, a Python script can expose an RPC function that another Python or C++ application calls directly, allowing services to exchange data without involving the MCU at all.
797801

798802
- **Service Discovery:** Clients (like your Python script or the MCU Sketch) "register" functions they want to expose. The Router keeps a directory of these functions and routes calls to the correct destination.
799803

@@ -814,6 +818,55 @@ sudo systemctl restart arduino-router
814818
journalctl -u arduino-router -f
815819
```
816820

821+
To capture more detailed information in the logs, you can append the `--verbose` argument to the systemd service configuration.
822+
823+
- Open the service file for editing:
824+
```bash
825+
sudo nano /etc/systemd/system/arduino-router.service
826+
```
827+
828+
- Locate the line beginning with `ExecStart=` and append `--verbose` to the end of the command. The updated service file should look like this:
829+
830+
```bash
831+
[Unit]
832+
Description=Arduino Router Service
833+
After=network-online.target
834+
Wants=network-online.target
835+
Requires=
836+
837+
[Service]
838+
# Put the micro in a ready state.
839+
ExecStartPre=-/usr/bin/gpioset -c /dev/gpiochip1 -t0 37=0
840+
ExecStart=/usr/bin/arduino-router --unix-port /var/run/arduino-router.sock --serial-port /dev/ttyHS1 --serial-baudrate 115200 --verbose # <--- ADD THIS
841+
# End the boot animation after the router is started.
842+
ExecStartPost=/usr/bin/gpioset -c /dev/gpiochip1 -t0 70=1
843+
StandardOutput=journal
844+
StandardError=journal
845+
Restart=always
846+
RestartSec=3
847+
848+
[Install]
849+
WantedBy=multi-user.target
850+
```
851+
852+
- You must reload the systemd daemon for the configuration changes to take effect.
853+
854+
```bash
855+
sudo systemctl daemon-reload
856+
```
857+
858+
- Restart the Router:
859+
860+
```bash
861+
sudo systemctl restart arduino-router
862+
```
863+
864+
- View the verbose logs:
865+
866+
```bash
867+
journalctl -u arduino-router -f
868+
```
869+
817870
#### Core Components
818871

819872
`BridgeClass` The main class managing RPC clients and servers.
@@ -822,7 +875,6 @@ journalctl -u arduino-router -f
822875
- `notify(method, args...)`: Invokes a function on the Linux side without waiting for a response (fire-and-forget).
823876
- `provide(name, function)`: Exposes a local MCU function to Linux. Note: The function executes in the high-priority background RPC thread. Keep these functions short and thread-safe.
824877
- `provide_safe(name, function)`: Exposes a local MCU function, but ensures it executes within the main `loop()` context. Use this if your function interacts with standard Arduino APIs (like `digitalWrite` or `Serial`) to avoid concurrency crashes.
825-
- `update()`: Process incoming requests.
826878

827879
`RpcCall`
828880
- Helper class representing an asynchronous RPC. If its `.result` method is invoked, it waits for the response, extracts the return value, and propagates error codes if needed.

0 commit comments

Comments
 (0)