Skip to content

bauerji/merry-christmas-from-rossum

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Merry Christmas from Rossum!

This simple project demonstrates how Rossum can be used not only as a data extraction tool but also as an integration between various tools and technologies.

We want to prepare a simple document, which Rossum should be able to extract message from, and send it to our display device at home using its awesome hook mechanism.

Overview

We're gonna build a simple stack using a various option of technologies

  • Wemos D1 mini as a server displaying message on a display
  • SSD1306 OLED display to display our message
  • fast-api server as a bridge between ngrok and our local display
  • ngrok to be able to access our local server from the internet
  • Rossum to extract data from .docx file (yes, Rossum is able to process MS Word and Excel documents as well 🚀) and display message on our display using its amazing hook functions

How to

Wemos D1 mini

First we need to prepare our esp-8266 to be able to display our message.

  • we will need a Wemos D1 mini board and a SSD1306 OLED display

  • we need to flash micropython firmware to our wemos d1 mini (more here)

  • download the newest firmware here

  • install esptool

    python3 -m pip install esptool

  • erase flash of your d1 mini

    esptool.py --chip esp8266 erase_flash

  • install the latest firmware

    esptool.py --port /dev/cu.usbserial-110 --baud 460800 write_flash --flash_size=detect 0 esp8266-20210902-v1.17.bin

  • connection

    SSD1306 Wemos D1 mini
    GND GND
    VCC 5V
    SCL D1
    SDA D2
  • we need to prepare a configuration file wemos_display/configuration.py based on configuration template

    • if you're using the same display - SSD1306 you should follow
    WIFI_CREDENTIALS = {
        "ssid": "...",
        "password": "...",
        "hostname": "RossumDisplay",
    }
    
    I2C_PINS = {
        "sda": 4,  # D2
        "scl": 5,  # D1
    }
    
    DISPLAY_RESOLUTION = (128, 64)

    fill in WIFI_CREDENTIALS based on your configuration

  • boot.py is run on d1 startup and creates local Wi-Fi connection

  • display.py is a simple module handling our display

  • main.py defines a simple http server listening on 80 port for any http GET request with ?text=... in its path

  • the simplest way how to load .py files to d1 mini is using PyCharm's micropython plugin

Fast-Api local server

Since most of people does not have a private IP we need to create another http server that will be made public using ngrok.com and will simply call our d1 mini

  • requirements.txt defines the only two dependencies our simple server has (fastapi and uvicorn)
  • main.py defines a light-weight Fast-API server that accepts HTTP POST request and converts it to HTTP GET request sent to our d1 mini
  • to start the server simply run
    python3 -m pip install -r requirements.txt
    uvicorn main:app --reload
    

Ngrok to make our FastApi server public

  • download ngrok
  • run ngrok http 8000 to make our fast-api app public (make note of the displayed URL - in our case https://82dd-2a00-1028-8392-1dea-d875-b857-3121-5883.ngrok.io)

Prepare Rossum python function extension

  • visit rossum-elis
  • update queue schema according to schema.json (it creates 3 string fields: address (url of our ngrok server), local_address (local address of our d1 mini server), text (text message to display on our display))
  • create function extension function extension attached to the queue with updated schema
  • set the trigger event document content - export
  • update function code according to function.py

Prepare MS Word document

  • create a merry_christmas.docx file with following fields
    • address (url of our ngrok server)
    • local address (local address of our d1 mini server)
    • text (text message to display on our display) docx file

Let the magic happen in Rossum

  • upload the MS Word file to your Rossum queue dashboard
  • click on your Christmas document
  • make sure the bounding boxes cover your texts review
  • click the Confirm button confirm
  • the document gets exported
  • you should see the message on your display! 🎉

3D printed enclosure

Now that we have working prototype we can use 3D printer and create a case for our device There are several cases on thingiverse we could use e.g. this one

  • solder wires
  • print case
  • put it all together case

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages