πŸ›œ 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

#BlockWhat it doesDropdown optionsWhat the options mean
1Connect Wi-Fi name "wifiname" password "wifipassword"Connects to a Wi-Fi networkβ€”Just like logging in to your home internet
2Config Wi-Fi Set Wi-Fi mode to STASets Wi-Fi modeSTA, APSTA: connects to a router
AP: becomes a hotspot
3Activate Network InterfaceTurns Wi-Fi on or offActivate, DeactivateControls whether the robot’s Wi-Fi is active
4Get Wi-Fi IP addressGets network infoIP address, subnet mask, Gateway, DNSUseful for debugging or displaying status
5Get Wi-Fi Access Point NameGets Wi-Fi name or channelAccess Point Name, Wi-Fi channelShows current network name or channel number

πŸ”Œ Socket Communication (TCP/UDP)

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

πŸ“€ TCP/UDP Data Transfer

#BlockWhat it doesDropdown optionsWhat the options mean
12TCP Send transfer byte "Clu-Bots"Sends data over TCPtoInt, toFloat, transfer byte, bytetoIntChoose how to format the data
13UDP Send transfer byte "Clu-Bots"Sends data over UDPSame as aboveFaster, but less reliable than TCP

πŸ•’ Network Time Protocol (NTP)

#BlockWhat it doesDropdown optionsWhat the options mean
14Get network time(NTP) Server Address ntp.aliyun.comGets the current time from the internetntp.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