13. How to Use One CyberPi to Control Another in the Same LAN

This article applies to:

mBot2, mBot Neo, and CyberPi.

 

In a Nutshell

操作15-介绍(童心派LAN通信控制).png

 

What's Lan Communication?

The default local area network channel for all CyberPi is 6. When devices are on the same channel in the local area network, they do not need to connect to the internet. They can send messages to each other through LAN broadcasting. Theoretically, a CyberPi can send messages to any number of other CyberPis.

In simple terms, CyberPi can use the "LAN" blocks in the Makeblock App to send broadcast messages to other CyberPi devices. Other CyberPi devices will respond accordingly based on the received messages, thus achieving mutual control.

 

Step by Step

#1 Prepare two CyberPi (A and B).

操作15-步骤1-童心派AB.png

 

#2 Connect the CyberPis to mBlock with upload mode.

For details, please see this guide: https://support.makeblock.com/hc/en-us/articles/15811949853335

操作15-步骤2-连接童心派(定制模块图).png

 

#3 Compile the broadcast program for CyberPi A.

These blocks are for CyberPi A to broadcast a message via LAN.

Upload the program to CyberPi.

操作15-步骤3-童心派A-广播.png

 

#4 Compile the receiving program for CyberPi B.

These blocks are for CyberPi B to capture the message and respond accordingly.

Upload the program to CyberPi.

操作15-步骤4-童心派B-接收.png

 

#5 Restart both CyberPi devices.

For CyberPi A (Connected with the Computer)

Unplug and replug the USB cable to restart.

操作15-步骤5-童心派A-插拔重启.gif

For CyberPi B (Mounted on mBot2 Shield)

Turn on and off the switch to restart.

操作15-步骤5-童心派B-开关重启.gif

After both CyberPis restart, press Button B on CyberPi A.

CyberPi B will says 'hi' and move forward for 1 second.

操作15-步骤5-成功演示.gif

Related Knowledge

https://support.makeblock.com/hc/en-us/articles/15811949853335

 

Got Questions?

Feel free to contact us at:

service@makeblock.com

 

Help Us Solve Faster

We have listed some useful information you can provide to us.

When you contact us, the more information you provide,

the better informed we will be and the quicker we can advise and answer your questions.

复用图-联络客服-提供信息.png

Not Sure Where to Find the Version Info?

复用图-联络客服-查看版本教程.png

Was this article helpful?
1 out of 2 found this helpful

Comments

0 comments

Article is closed for comments.