> For the complete documentation index, see [llms.txt](https://docs.petoi.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.petoi.com/web-block-base-programming/petoi-web-coding-blocks/setup-on-nyboard.md).

# Setup on NyBoard

The Petoi Web Coding Block can be used with the robot, which uses the [NyBoard](/nyboard/overview.md).

## Upload the OpenCat firmware to the NyBoard

Please refer to [NyBoard Preparation](/block-based-programming/petoi-coding-blocks/nyboard-preparation.md) and upload the Mind+ mode firmware to the NyBoard first.

## Compatible sensors

### Analog sensor modules:&#x20;

[Light sensor](/extensible-modules/light-sensor.md)

[Infrared distance sensor](/extensible-modules/ir-distance-sensor-double-infrared-reflection-sensor.md)

Other sensors that output 0–5 V analog signals.

### Digital sensor modules:&#x20;

[Touch sensor](/extensible-modules/touch-sensor.md)

[PIR motion sensor](/extensible-modules/pir-motion-sensor.md)

Other sensors that output only high/low logic levels.

### [Dedicated ultrasonic sensor](/extensible-modules/ultrasonic-sensor.md)

For instructions on connecting more compatible sensors to the board, please refer to the [manual page](/extensible-modules/introduction.md).

{% hint style="warning" %}
The web coding blocks are **NOT** suitable for external cameras, gesture sensors, OLED displays, voice modules, or other I²C/UART extensible modules.
{% endhint %}

## Connect method

The web coding blocks support the following three connection methods for connecting the robot to the computer.

### Use the USB Adapter

The kit includes a [**USB Adapter and USB data cable**](/communication-modules/usb-downloader-ch340c.md) that connect the robot's mainboard to the computer.

### Use the Bluetooth module

The kit includes a [**Bluetooth module**](/communication-modules/dual-mode-bluetooth.md) connecting the robot's mainboard to the computer.

### Use the WiFi module

Please refer to the related section in the Wi-Fi module for instructions on [hardware](/communication-modules/wifi-esp8266.md#hardware-setup) and software setup ([2.1 Add ESP8266 source to the board manager](https://docs.petoi.com/web-block-base-programming/petoi-web-coding-blocks/pages/-MY_xwWUGyQMiEPNsU2m#id-2.1-add-esp8266-source-to-the-board-manager) and [2.2 Configuration of the Module](https://docs.petoi.com/web-block-base-programming/petoi-web-coding-blocks/pages/-MY_xwWUGyQMiEPNsU2m#id-2.2-configuration-of-the-module)).

<figure><img src="/files/f6E8VWohbJ18QYRmHcTo" alt=""><figcaption></figcaption></figure>

#### Upload the WiFi Firmware to the WiFi module

Project URL：

<https://github.com/PetoiCamp/OpenCat-Quadruped-Robot/tree/main/ModuleTests/WebCoding8266>

There are two files in the project:

* WebCoding8266.ino: Arduino sketch.
* README.md: Help document.

Please open **WebCoding8266.ino** in the Arduino IDE and install the libraries **WiFiManager**, **WebSockets**, and **ArduinoJson** in the Library Manager:

<figure><img src="/files/fX71MttAdyRtYl220KTb" alt=""><figcaption></figcaption></figure>

<figure><img src="/files/YHS9OORsWoFvtHMH3HqH" alt=""><figcaption></figcaption></figure>

<figure><img src="/files/hza89iQJaWiGIGgAlaC3" alt=""><figcaption></figcaption></figure>

<figure><img src="/files/jms9seorE2rcOfRAt4FZ" alt=""><figcaption></figcaption></figure>

Then connect the USB uploader, plugged into the WiFi module, to the computer via the USB data cable. Select the correct serial port and upload the sketch to the ESP8266 WiFi module as follows:

<figure><img src="/files/HPUflE4YU5zztY0ooy5P" alt=""><figcaption></figcaption></figure>

<figure><img src="/files/cgUoLFCtQga4a5Uuj43r" alt=""><figcaption></figcaption></figure>

After the sketch is uploaded to the WiFi module, open the serial monitor in Arduino IDE. Then, unplug and re-plug the WiFi module into the USB uploader.

<figure><img src="/files/y4Cep8BI5MTkbqkVLErJ" alt=""><figcaption></figcaption></figure>

Open your smartphone's WiFi scanner and find an unencrypted access point named "Petoi-AP\*\*\*\*" (shown in the serial monitor) and connect to it to configure the WiFi parameters of the module, let the WiFi module join the local network, and get a local IP address. For more details, please refer to the " [How to use](/communication-modules/wifi-esp8266.md#how-to-use)" section of the WiFi module.

<figure><img src="/files/2JyEHcmAZsQ6JAfHzW15" alt=""><figcaption></figcaption></figure>

Then the WiFi module will get the IP address (as shown in the serial monitor above). &#x20;

#### Connection and Usage

Unplug the WiFi module from the USB uploader, plug it into the NyBoard:

<figure><img src="/files/fHXeZgod170liPwyM76z" alt=""><figcaption></figcaption></figure>

Power on the robot, and enter the WiFi module's IP address in the coding block.&#x20;

Now you can use the web coding page to run the program:

<figure><img src="/files/UIGFYgR4hcg3DNxzWQRm" alt=""><figcaption></figcaption></figure>


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://docs.petoi.com/web-block-base-programming/petoi-web-coding-blocks/setup-on-nyboard.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
