ESP32 IoT Future Board Kittenblock Programming Tutorial 07 - WIFI

ESP32 IoT Future Board Kittenblock Programming Tutorial 07 - WIFI

The wireless WIFI is the advantage of the Future board, we can get a lot of information through the internet, and do more things such as the Internet of things and calling the AI interface to realize AI-related functions.

Programming Blocks (Pogram with Kittenblock)

WIFI Connection

Block

Introduction

1.1 connect wifi name pwd

Connect to the WiFi with specified password and name

1.2 wifi is connected

Check whether the WiFi connection is successful, if success, it returns true, if do not success, it returns false

1.3 wifi config message

Get various data of SIFI (IP, gateway, DNS), and return a string of characters

1.4 wifi config IP

Obtain various data of wifi (IP, gateway, DNS), and return the data of a single option

1.5 mac address

Get the mac address of the WIFI module

1.6 disconnect wifi

Disconnect WIFI

 

MQTT Server

Block

Introduction

2.1 connect MQTT server id

Connect to the MQTT server (standard MQTT protocol)

2.2 connect MQTT server id username password

Log in to the MQTT server with the private key

2.3 mqtt subscribe

Subscribe to the topic

2.4 mqtt read topic

Get messages from the topic

2.6 mqtt publish message
Send messages to the specified topic

2.7 mqtt check message

Get MQTT messages

 

OneNet and NTP

Block

 Introduction

3.1 sync network time GMT+8

Set the location of the internet time (GMT+8 is Beijing time)

3.2 get time year

Get the year (month, day, hour, minute, second, microsecond) of the current time

3.3 OneNet connect device device id APIkey

Set the ID and APIkey of the OneNet device

3.4 OneNet publish data stream =

Upload data to OneNet

3.5 OneNEt read data stream

Read the value of the data on the server

 

Wireless radio

Block

Introduction

4.1 radio init

Initialization

4.2 radio set channel

Set the channel number

4.3 radio receive

Get the message from the wireless radio

4.4 radio SEND hello

Send wireless messages

 

Example

📋: Board-to-board wireless radio communication

Use this function to easily complete projects such as controlling robots remotely. The 2.4g wireless communication of Future board cannot transfer data with the wireless communication of Micro:bit, because they have different protocol and frequency band.

It supports sending and receiving Chinese content.

  1. Sending end program

1.1 Sending end

 

  1. Receiving end program

1.2 Receiving End

 

📋: WIFI Connection & WIFI configuration information

WIFI Connection & WIFI configuration information

 

📋: MQTT Communication

Kittenbot provides you a free MQTT server, you can use it after registration    https://iot.kittenbot.cn/

MQTT Communication

 

📋: Future board MQTT connects to the local server of the computer

📎Future board MQTT connects to the computer local server.zip

  1. Open the local IoT server, click the IoT button, open the local server, note down the IP address of your computer server, and fill in the program later

Future board MQTT connects to the local server of the computer 1

Future board MQTT connects to the local server of the computer 2

Future board MQTT connects to the local server of the computer 3

 

📋: ntp gets the internet time

ntp gets the internet time

 

If you have any question, please feel free to contact us at Discord, we will always be there to help.

 

KittenBot Team

Leave a comment

Please note, comments need to be approved before they are published.

SUBHEADING

Blog posts