B4R Tutorials

MQTT controlling 8 relays, WeMos D1 mini WiFi, Android 4G

Here is a short tutorial on how to control an 8 channel relay module via MQTT. Below you will find both the WeMos and Android source codes needed to get started. The relay module is connected to a...
 
Last edited:

ESP32 WITH LCD (16*2) WITH 4 LINE INTERFACE (WITHOUT I2C)

ESP32 WITH LCD (16X2) 4 LINES INTERFACE:
Sub Process_Globals
    Public Serial1 As Serial
    Private wifi As ESP8266WiFi
    Public mylcd As LiquidCrystal
End Sub

Private Sub AppStart
    Serial1.Initialize(115200)...
 

Attachments

  • WhatsApp Image 2023-05-10 at 09.28.39.jpeg
    WhatsApp Image 2023-05-10 at 09.28.39.jpeg
    125.7 KB · Views: 205
  • WhatsApp Image 2023-05-10 at 09.31.55.jpeg
    WhatsApp Image 2023-05-10 at 09.31.55.jpeg
    176.2 KB · Views: 179

Tips to use an M5Stamp-C3U

It's a very small and quite powerful ESP32-board with WIFI/BLE and B4R support!

Use following board library in the Arduino-IDE in 'Settings'...
 

ESP32: AES256 encrypted & Base64 encoded post message to and from PHP

Example:

- AES256 encrypt a message with IV and Salt
- Base64 encode it
- send a http post request to a php script
- decrypt in php
- send back a AES256 encrypted and Base64 encoded message to...
 

Attachments

  • httpaes256.zip
    3.2 KB · Views: 201

RSA Encryption: Create keys, en-/decrypt, hash, sign/verify signature (clean code)

This example replaces my previous examples with cleaner inline C coding (I'm getting better :))using almost all variables from Globals. You can define the keysizes (eg. 2048 or 4096). It's fully...
 

Attachments

  • RSAOnly.zip
    3.4 KB · Views: 189

Correct this misconseption - "Call B4R subs from InLine c code" - see post #2

Having had my work flow cut down in the middle by vicious "circumstances" I decided to let it all go and "go fishing" as mr. Miyaghi (Karate kid) would say. So I did some things I couldn't do...
 
Last edited:

Arduino MicroPython is coming

 

Node-Red MQTT controlling 8+8 digital Inp-Out and I2C ADC on ESP32

Hi
Here a sample program to control/monitor 8+8 digital Out-Inp, plus an I2C ADC.
The program use the MQTT protocol.
This program is an evolution of the previous one I posted.

This version add...
 

Attachments

  • NodeRed_Analog_Digital_Ex.rar
    68.3 KB · Views: 448

Node-Red MQTT controlling 8 relays ESP32

Hi
Here a sample program to control 8 outputs on arduino ESP32. The program use the MQTT protocol to exchange the data (really a single byte). By Node-red web interface the user set or reset the...
 

Attachments

  • 8_relay_ESP.Nodered_example.zip
    154.2 KB · Views: 591

SD cards

The rSD library allows reading and writing to SD cards. The Ethernet shield as well as other shields include a SD slot.

The steps required to work with files:
1. Initialize a SD object. You need...
 

Attachments

  • B4J_PrepareCurrencyFile.zip
    2.8 KB · Views: 937
  • SD_Example.zip
    1.1 KB · Views: 1,161

[Tool]LCD Display Designer

Tool to design LCD Display Layouts for 20x4 or 16x2 displays connected to Arduino, Raspberry Pi or other.

1613395535658.png

Screenshot application with generated B4R code and an Arduino UNO with...
 

Attachments

  • rLiquidCrystal_I2C-110.zip
    23.3 KB · Views: 499
  • lcddisplaydesigner.zip
    6.6 KB · Views: 497
Last edited:

Arduino Simulator

Hey everybody,

Just found this and looks very impressive...

 

Glossary for Arduino Development

This is not a tutorial for B4R. I think a glossary of terms might be useful for beginners to electronics and B4R. So I created my own list in GitHub to record the terms that I find need...
 

ESP32: Simple OTA/Update via WebServer

This example (adapted from the Arduino examples under Arduino->File->Examples)

- downloads a file from a server (exactly: the update file)
- store this file to the filesystem (SPIFFS)
- starts an...
 

ESP Configurator based on B4RSerializator

SS-2017-07-09_16.48.51.png


This tool replaces the browser based solution...
 

Attachments

  • B4R_ESPConfigurator.zip
    2 KB · Views: 2,560
  • B4J_ESPConfigurator.zip
    46.1 KB · Views: 2,295
Last edited:

ESP8266 - Getting Started

B4R v1.20 added support for ESP8266 modules. ESP8266 is a great module for IoT solutions. For a few dollars you get a powerful microcontroller with built-in support for wifi.

I recommend to...
 

Attachments

  • B4J_ConnectToESP8266.zip
    3.7 KB · Views: 2,541
Last edited:

ESP32: OTP/2FA example

This example generates a OTP/2FA ("One Time Password") as you know it when you login to a website and you get a 6 digit code via sms. It changes every 30 seconds.

How it works:

- as it is time...
 

E-Paper (probably suitable for battery powered projects)

Here is a nice tutorial by the guy in DronebotWorkshop. What surprised me (and I did not know that) is that with e-paper you only have power consumption while writing to it and no more. Even if...
 
Last edited:

Updated RSA Encryption between B4x and ESP32's (any other plattform will do, too)

Here's an updated example how to

- generate an RSA keypair (Public and Private key) on a ESP32 and on B4x
- export these keys in PEM format (compatible with any other plattform like B4x, .net...
 

Attachments

  • ExchangeKeysB4J.zip
    5 KB · Views: 400
  • ExchangeKeysB4R.zip
    4.4 KB · Views: 404

DroneBot Workshop - A great dissection of the new Arduino IDE

 
Top