Skip to content

Commit

Permalink
README update
Browse files Browse the repository at this point in the history
  • Loading branch information
sashacmc committed Dec 6, 2024
1 parent 24b7338 commit c8f24ec
Show file tree
Hide file tree
Showing 2 changed files with 46 additions and 7 deletions.
51 changes: 44 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ Currently, zenoh-pico provides support for the following (RT)OSs and protocols:
| **OpenCR** | UDP (unicast and multicast), TCP | IPv4 | WiFi |
| **Emscripten** | Websocket | IPv4, IPv6 | WiFi, Ethernet |
| **FreeRTOS-Plus-TCP** | UDP (unicast), TCP | IPv4 | Ethernet |
| **Raspberry Pi Pico** | UDP (unicast and multicast), TCP | IPv4 | WiFi (for "W" version), Serial |
| **Raspberry Pi Pico** | UDP (unicast and multicast), TCP | IPv4 | WiFi (for "W" version), Serial, USB (CDC) |

Check the website [zenoh.io](http://zenoh.io) and the [roadmap](https://github.com/eclipse-zenoh/roadmap) for more detailed information.

Expand Down Expand Up @@ -361,12 +361,12 @@ git submodule update --init
```

Setup and build the examples:
`PICO_BOARD` - Pico board type: pico, pico_w, pico2, pico2_w (default: pico_w)
`WIFI_SSID` - Wi-Fi network SSID
`WIFI_PASSWORD` - Wi-Fi password
`ZENOH_CONFIG_MODE` - client or peer mode (default: client)
`ZENOH_CONFIG_CONNECT` - connect endpoint (only for client mode, optional)
`ZENOH_CONFIG_LISTEN` - listen endpoint (only for peer mode, optional)
- `PICO_BOARD` - Pico board type: pico, pico_w, pico2, pico2_w (default: pico_w)
- `WIFI_SSID` - Wi-Fi network SSID
- `WIFI_PASSWORD` - Wi-Fi password
- `ZENOH_CONFIG_MODE` - client or peer mode (default: client)
- `ZENOH_CONFIG_CONNECT` - connect endpoint (only for client mode, optional)
- `ZENOH_CONFIG_LISTEN` - listen endpoint (only for peer mode, optional)

```bash
cd examples/rpi_pico
Expand All @@ -376,6 +376,43 @@ cmake --build ./build

To flash the Raspberry Pi Pico board, connect it in bootloader mode (it will appear as a removable drive) and copy the generated .uf2 file onto it.

**Serial connection**:

To connect via UART specify pins or predefined device name and baud rate:

e.g.
```
-DZENOH_CONFIG_CONNECT="serial/0.1#baudrate=38400"
-DZENOH_CONFIG_CONNECT="serial/uart1_0#baudrate=38400"
```

Valid PIN combinations and associated device names:

| **PINS** | **Device name** |
|---------:|:---------------:|
| 0.1 | uart0_0 |
| 4.5 | uart1_0 |
| 8.9 | uart1_1 |
| 12.13 | uart0_1 |
| 16.17 | uart0_2 |


**USB Serial connection (experemental)**:

To connect via USB CDC, specify `usb` device:

e.g.
```
-DZENOH_CONFIG_CONNECT="serial/usb#baudrate=112500"
```

On the host Zenoh, specify the USB CDC device:

e.g.
```
zenohd -l serial//dev/ttyACM1#baudrate=112500
```

## 3. Running the Examples
The simplest way to run some of the example is to get a Docker image of the **zenoh** router (see [http://zenoh.io/docs/getting-started/quick-test/](http://zenoh.io/docs/getting-started/quick-test/)) and then to run the examples on your machine.

Expand Down
2 changes: 2 additions & 0 deletions src/system/rpi_pico/network.c
Original file line number Diff line number Diff line change
Expand Up @@ -522,6 +522,7 @@ z_result_t _z_open_serial_from_pins(_z_sys_net_socket_t *sock, uint32_t txpin, u
}

if (sock->_serial == NULL) {
_Z_ERROR("invalid pin combination");
return _Z_ERR_INVALID;
}

Expand Down Expand Up @@ -555,6 +556,7 @@ z_result_t _z_open_serial_from_dev(_z_sys_net_socket_t *sock, char *dev, uint32_
}

if (sock->_serial == NULL) {
_Z_ERROR("invalid device name");
return _Z_ERR_INVALID;
}

Expand Down

0 comments on commit c8f24ec

Please sign in to comment.