Lowcode IoT | Everybody is a maker!

Exercise Level Two - M5Stack Remote Communication

Remote Communication units

Lasers can cause harm to the human body. Therefore, when using this product, do not aim it at people, and prevent the laser beam from entering the eyes to avoid injury!

Exercise Level Two - M5Stack RF433 Transmitting and receiving messages.

  1. Unit RF433T is a wireless radio frequency (RF) transmitter and Unit RF433R is an RF wireless radio frequency receiver, operating at the commonly used 433.92MHz frequency for wireless controllers.
    Note: The RF433R receiver unit is currently not supported on the Esp32-S3 chip, please connect the receiver on a Stick-C or Atom Matrix for this exercise.
  2. For this exercise we will program two controllers with UIFlow2, a transmitting and a receiving controller. The range of the RF433 units is about 10 meters.
  3. First we will program the transmitting controller.
    Connect the RF433T unit to the controller and add the unit in UIFlow2.
    Apply the following codeblock to transmit the text "Hello World!" on a button click event.
    Transmit "Hello World!" on a button click.
  4. Now we will program the receiving controller (Non ESP-32 S3).
    Connect the RF433R unit to the controller and add the unit in UIFlow2.
    Apply the following codeblock to receive the message and print it out in the serial monitor.
    UIFlow2 block for RF433R
    Receive the message.
  5. There is one problem with the output, the serial monitor will add a 'b' to the output.
    Which means the data is structured (and sent as) bytes.
    We need to decode the data to a proper string to be able to use it.
    Byte output to Serial Monitor
  6. Adding a 'decode' block will fix this issue. The decode block can be found in the 'Bytes' section of UIFlow2.
    decoded RF433R data.

Exercise Level Three - Getting Started with ESP-NOW

    How do I find my MAC Address?

  1. The Mac address of your device is listed on the sticker on the package, or can be retrieved with a code block
    (category: System : ESP-NOW):
    UIFLOW2 ESP-NOW get Mac adress
  2. To initialize the ESP-NOW protocol define a wifi channel and add a peer.
    The MAC address will be that of the device that will receive the data (not the same as in the example).
    You can configure 20 peers as receiving devices.
    A MAC address format generally consists of 6 hexadecimal digits: E4:B3:23:F6:E9:F4 but must be written as general hexadecimal number: e4b323f6e9f4.
    UIFLOW2 setup block init ESP-NOW
  3. Sending data on button click event:
    Send ESP-NOW data on button event
  4. Receiving ESP-NOW data

  5. To receive data on a device initialise the ESP-NOW protocol with the same Wifi channel:
    ESPNOW receive setup
  6. Receive (and decode) ESP_NOW data event:
    Receive and decode ESP-Now data
  7. ESP-NOW can also broadcast data without the need for peer configuration.
    Be aware though that any ESP-32 device close by (somewhere around 50 meters) can receive and read the data.