Blocks documentation

Section specific for ESP8266 based boards

Board setup

  1. Install MicroPython or CircuitPython
  2. Connect to Network
  3. Start WebREPL service
  4. Access from BIPES

Basic Blocks

Info

Python

Timing

Machine

Displays

TM1640 LED Matrix

Connect TM1640 LED Matrix Shield or external TM1640 LED Matrix

CLK should go to Pin 14 and DIO to Pin 13 (or what you configured)

Sensors

DHT11/22 Sensor

Ultrasound

GPS

Oximeter

Inertial Measurement

Figure: https://www.electronicwings.com/nodemcu/mpu6050-interfacing-with-nodemcu

OneWire – DS1820

Figure: https://randomnerdtutorials.com/micropython-ds18b20-esp32-esp8266/

Figure: https://randomnerdtutorials.com/micropython-ds18b20-esp32-esp8266/

RC522 RFID Module

Tested with Amica NodeMCU

Connections Diagram:

RFID Module PinESP8266 Pin
SCK0 (D3)
MOSI2 (D4)
MISO4 (D2)
RST5 (D1)
CS or SDA14 (D5)

Library: https://github.com/wendlers/micropython-mfrc522/blob/master/examples/read.py

Image source: https://www.instructables.com/MFRC522-RFID-Reader-Interfaced-With-NodeMCU/

Foto 1 – montagem

Foto 2 – montagem

Link to example

After making the connections, click on: Load example: mfrc522, connect and run the test program.

Actuators

Communication

EMAIL

Allows BIPES to send email using SMTP services / servers!

Important: For gmail, 2-factor authentication and App Password must be enabled.

Enable here:

https://myaccount.google.com/apppasswords

Select App -> E-mail,

Select Device -> Other

Use the generated password in BIPES Block Init uMail

Of course, you must be connected to the Internet to send email!

MQTT

EasyMQTT

API

ParameterDescription
Functionlistsessions
URLhttp://bipes.net.br/easymqtt/listsessions.php
MethodGET
ReturnJSON{“success”:true,”result”:[{“session”:”session_id”,”topicsCount”:1,”messagesCount”:2}]}
ParameterDescription
Functiongetsession
URLhttp://bipes.net.br/easymqtt/getsession.php
MethodGET
Parameterssession=<session_id>
ReturnJSON
{“success”:true,”result”:[“umidade”,”temperatura”]}
ErrorsArgumentos inválidos:{“success”:false,”result”:”Invalid Parameters”}Sessão vazia:{“success”:false,”result”:”Session ‘clean_session’ does not contain any topic”}
ParameterDescription
Functiongettopic
URLhttp://bipes.net.br/easymqtt/gettopic.php
MethodGET
Parameterssession=<session_id>&topic=<topic_name>&since=<timestamp[opcional]>
ReturnJSON{“success”:true,”result”:[{“timestamp”:1605998938,”data”:”0″}]}
ErrorsArgumentos inválidos:{“success”:false,”result”:”Invalid Parameters”}
ParameterDescription
Functionpublish
URLhttp://bipes.net.br/easymqtt/publish.php
MethodGET
Parameterssession=<session_id>&topic=<topic_name>&value=<value>
ReturnJSON{“success”:true,”result”:”Value ‘1’ published to topic ‘test’ successfully!”}
ErrorsArgumentos inválidos:{“success”:false,”result”:”Invalid Parameters”} Valor não numérico:{“success”:false,”result”:”Error publishing value ‘a’ to topic ‘test’. Non-numeric input value!”} Erro na publicação MQTT:{“success”:false,”result”:”Error publishing value ‘1’ to topic ‘test’. <some other error here>”}
ParameterDescription
Functionclearsession
URLhttp://bipes.net.br/easymqtt/clearsession.php
MethodGET
Parameterssession=<session_id>
ReturnJSON{“success”:true,”result”:”Session ‘test’ cleaned”}
ErrorsArgumentos inválidos:{“success”:false,”result”:”Invalid Parameters”}

WebREPL

Files

Network

MicroPython