πŸ›œ Network – Your “Passport to the Internet”

What it is: Blocks for using Wi-Fi and connecting to networks.

What it does: Connects your project to Wi-Fi and the Internet.

Example: Connecting your robot to your home internet.

πŸ‘‰ It’s the robot’s personal router.

Β 

🧩 Fun Guide to Network Blocks (Clu-blocks Pro)

🌐 Important! Network blocks let your robot go online, send messages, and talk to other devices using Wi-Fi, TCP/UDP sockets, and even get the current time from the internet. It’s like giving your robot a passport to the digital world!


πŸ“Ά Wi-Fi Setup & Info

# Block What it does Dropdown options What the options mean
1 Connect Wi-Fi name "wifiname" password "wifipassword" Connects to a Wi-Fi network β€” Just like logging in to your home internet
2 Config Wi-Fi Set Wi-Fi mode to STA Sets Wi-Fi mode STA, AP STA: connects to a router
AP: becomes a hotspot
3 Activate Network Interface Turns Wi-Fi on or off Activate, Deactivate Controls whether the robot’s Wi-Fi is active
4 Get Wi-Fi IP address Gets network info IP address, subnet mask, Gateway, DNS Useful for debugging or displaying status
5 Get Wi-Fi Access Point Name Gets Wi-Fi name or channel Access Point Name, Wi-Fi channel Shows current network name or channel number

πŸ”Œ Socket Communication (TCP/UDP)

# Block What it does Dropdown options What the options mean
6 Socket Init s Socket Type TCP Starts a socket connection TCP, UDP TCP = reliable, UDP = fast
7 Bind to address initialize tuple ['0.0.0.0', 80] Sets up a server β€” Listens for incoming connections on port 80
8 Send Socket initialize tuple ['127.0.0.1', 80] Sends data to a device β€” Sends to IP address and port
9 Socket Listen Socket TCP 5 Listens for connections β€” Waits for up to 5 devices to connect
10 Accept and return Socket Accepts a connection β€” Starts talking to a connected device
11 Socket Receive 1024 Receives data β€” Reads up to 1024 bytes of incoming info

πŸ“€ TCP/UDP Data Transfer

# Block What it does Dropdown options What the options mean
12 TCP Send transfer byte "Clu-Bots" Sends data over TCP toInt, toFloat, transfer byte, bytetoInt Choose how to format the data
13 UDP Send transfer byte "Clu-Bots" Sends data over UDP Same as above Faster, but less reliable than TCP

πŸ•’ Network Time Protocol (NTP)

# Block What it does Dropdown options What the options mean
14 Get network time(NTP) Server Address ntp.aliyun.com Gets the current time from the internet ntp.aliyun.com, ntp1.aliyun.com, time1.cloud.tencent.com, etc. Choose a time server β€” great for syncing clocks or logs

🧠 Quick Tips for Students

  • Use Wi-Fi setup first β€” no internet, no networking!
  • Use STA mode to connect to a router, or AP mode to create your own hotspot.
  • Use TCP for reliable chat, UDP for fast messages β€” like games or sensors.
  • Use NTP blocks to get the real-world time β€” perfect for timestamps or alarms.
  • Always check IP and status before sending data β€” it helps avoid bugs!
On this page