Skip to content

gorenje/vda5050_erlang_red

Repository files navigation

VDA5050 Simulation employing Erlang-Red and Node-RED

This repository contains several breadboards for a collection of screencasts that discuss the development of a VDA5050 simulation using a purely visual flow-based programming approach.

Harnessing both Erlang-Red and Node-RED to simulate VDA5050 communication between a control instance and a Automated Guided Vehicle (AGV). This polyglot approach makes use of Erlang and NodeJS, which supplement each other in this visual solution. Erlang provides a solid state machine implementation, NodeJS provides JSON Schema validation - I make use of both.

These screencasts discuss various topics related to visual programming, including visual unit testing, visual version control and integrating Artificial Intelligence into a flow based solution.

Episodes

Screencasts are available at archive.org. There are seven episodes, each covering two or one topic(s):

  • Episode 1: What is VDA 5050 & How to setup MQTT

    What is VDA 5050 and for is it used? This episode presents that and also sets the communication between Node-RED and Erlang-Red - allowing them to transfer messages between them.

  • Episode 2: Defining state machines in Erlang-Red

    Erlang-Red defines nodes for some of the Erlang code behaviours including Supervisor, State machine and event machine. This episode goes through how to define a simple state machine and why this is important for VDA 5050.

  • Episode 3: Designing VDA 5050 state machine and unit testing the state-machine

    Erlang-Red being a visual tool, it is ideal for designing state machine diagrams and clearly defining state transitions. This is what I do in this episode. I also show how to unit test that design.

  • Episode 4: Visual unit testing and visual version control

    An absolute must for programmers are tests and version control, the question is: how do these things in a visual programming environment? Watch this episode to see how I have solved this in Erlang-Red.

  • Episode 5: Documenting flow code in Erlang-Red

    Besides tests, documentation is very important. Knowing what I did yesterday while procrastinating today is vital. This episode demonstrates the support for Mermaid diagrams and how documentation is a first class citizen of Erlang-Red.

  • Episode 6: Creating test data from JSON Schemas using AI

    In this episode, I show how I create a flow that interacts with Ollama to create test data from a JSON Schema. The test data is then validated against the schema to ensure correctness.

  • Episode 7: Brain-Bot communication - put it all together

    Finally it’s alive, the brain-bot communication is done. This covers how the flows work to simulate a bot that comes online, that registers itself and is then paused and unpaused by the brain.

Each episode is between 5 and 20 minutes and, in part, build upon each other - best watched consecutively.

Interacting with Breadboards

To play along locally, there is a docker compose that can be used:

git clone git@gihub.com:gorenje/vda5050_erlang_red
cd vda5050_erlang_red
docker compose build
docker compose up

Then open two browser tabs to:

  • Erlang-Red: open http://localhost:18080
  • Node-RED: open http://localhost:11880

FlowHub.org Read-Only Token

The following token can be used to directly access the breadboards in either Node-RED or Erlang-Red via the FlowHub.org nodes:

fhb_WyJvY2YzKzE4SW1PVzRmdk9LYmtkZWV3PT0iLCJmdzgwcno0YjBnTFV4QTV2ZnJvc3NwcFFibHNLVEt1WG9hVFZxMGFXVHIrSmd5OFM1YSt2UFZpMWswa3hrc2VKUXBmeGJvV1pGbmcrNGxKUzNDbFRFQnJGaE5paFhaeXdjcjQ5RVE3aU5KL3JHMEtiSXA1b212UERHZGk5bk5Id3FaelhoUnczSWk0U0ZRbkh0bzNtZFNneFFUNkl1MXI0ZGczNUhhcER4Z21UVGFhcGFQQis3VEFHTStpMDVub0JPOWwwWlJDaEdDMkdWR2dNd0Iya09ZWnNzVklXIl0

License

Public Domain.

If you are going use this, then please do reference the source material.

Releases

No releases published

Packages

No packages published