{"id":20477351,"url":"https://github.com/harbaum/ftduino-controller","last_synced_at":"2025-04-13T12:51:02.586Z","repository":{"id":43024252,"uuid":"349480500","full_name":"harbaum/ftDuino-controller","owner":"harbaum","description":"Firmware for the ftDuino controller","archived":false,"fork":false,"pushed_at":"2022-07-06T05:53:13.000Z","size":1670,"stargazers_count":11,"open_issues_count":2,"forks_count":3,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-03-27T03:51:20.032Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/harbaum.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2021-03-19T16:04:13.000Z","updated_at":"2024-01-01T19:12:30.000Z","dependencies_parsed_at":"2022-09-06T05:00:33.579Z","dependency_job_id":null,"html_url":"https://github.com/harbaum/ftDuino-controller","commit_stats":null,"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/harbaum%2FftDuino-controller","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/harbaum%2FftDuino-controller/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/harbaum%2FftDuino-controller/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/harbaum%2FftDuino-controller/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/harbaum","download_url":"https://codeload.github.com/harbaum/ftDuino-controller/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248717252,"owners_count":21150388,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-15T15:27:42.162Z","updated_at":"2025-04-13T12:51:02.560Z","avatar_url":"https://github.com/harbaum.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# ftDuino remote controller - ESP32 based blockly/python controller\n\nThis repository contains the code for the ftDuino remote controller.\n\n## What is the ftDuino controler?\n\nThe ftDuino remote controller is an ESP32 based controller with 240*320\ntouchscreen and SD card. It's meant to connect via I²C to an\n[ftDuino](http://ftduino.de) allowing fischertechnik toy robots to\nbe programmed in Python and Blockly using nothing but a browser.\n\nThe ftDuino remote controller runs [Micropython](https://micropython.org/) and\n[LVGL](https://lvgl.io/) allowing for touch based user interfaces\nwritten in Python.\n\n![ftDuino remote controller](ftduino32_www.png)\n\nFurthermore the ftDuino includes a native web server with websocket\ncapabilities allowing to use the\n[Blockly](https://developers.google.com/blockly) and\n[CodeMirror](https://codemirror.net/) code editors. Finally a remote\nview mirrors the device screen and allows to fully remote control the\ntouchscreen interface from the browser.\n\nIn the current state of the firmware it allows the user to:\n\n- Setup WLAN using the touchscreen\n- Run custom local Python apps from internal flash space or SD card\n- Write Python programs using Blockly\n- Write Python programs using CodeMirror\n- Import/export/rename/delete/... programs\n- Trigger program execution remotely\n- Get a remote live view of the devices display\n\n![ftDuino remote controller](ftduino32.jpg)\n\n## Videos\n\n- [Writing a Micropython app using Blockly](https://youtu.be/JS-Ef-26_-E)\n- [Testing the remote GUI](https://www.youtube.com/watch?v=9zsAbTVxjMw)\n\n## The hardware\n\nThe final device is planned to be sold fully assembled. But you can\nrun it on off-the-shelf breadboard components.\n\nTo run the ftDuino remote controller setup this way you need:\n\n- ESP32 Wrover with PSRAM\n- ILI9341 based 240*320 touch TFT\n- optional SD card slot + SD card\n- optional I2C level shifter to connect to ftDuino\n\nThe required wiring (VCC/GND is shared by the touch):\n\n| ESP32 | TFT | TOUCH | SD card | Optional |\n|-------|---|---|---|---|\n| 3V3 | VCC | | VDD | |\n| GND | GND | | VSS | |\n| 5 | CS | | | |\n| 27 | RESET | | | |\n| 32 | DC | | | |\n| 23 | SDI(MOSI) | T_DIN | | |\n| 18 | SCK | T_CLK| | |\n| 19 | SDO(MISO) | T_DO | | |\n| 26 | | T_CS | | |\n| 34 | | T_IRQ | | |\n| 15 | | | CD_DAT3_CS | |\n| 13 | | | CMD_DIN | |\n| 14 | | | CLK | |\n| 12 | | | DAT0_DO | |\n| 35 | | | CD (optional) | |\n| 2 | | | | LED green |\n| 4 | | | | LED yellow |\n| 25 | | | | Speaker |\n| 21 | | | | I²C SDA to ftDuino |\n| 22 | | | | I²C SCL to ftDuino |\n\n![ftDuino remote controller breadboard setup](ftduino32_bb.jpg)\n\n## Firmware setup\n\nThis build has only been tested under Linux. These instuctions may\nbe outdated as MicroPython and LVGL are being developed rather quickly.\n\n### Step 1: Install ESP-IDF\n\nClone the required 4.0 version of ESP-IDF.\n\n```\ngit clone https://github.com/espressif/esp-idf.git\ncd esp-idf\ngit checkout 4c81978a3e2220674a432a588292a4c860eef27b\ngit submodule update --init\n```\n\nInstall the dependencies and install ESP-IDF:\n\n```\ncd esp-idf\npython -m pip install --user -r ./requirements.txt\n./install.sh\n. ./export.sh\n```\n\nApply [patch](https://github.com/harbaum/ftDuino-controller/tree/main/patches)\nto add the latest http server including websocket support to the ESP-IDF 4.0:\n\n```\ncd esp-idf\npatch -p1 \u003c esp-idf.patch\n```\n\n### Step 2: Install Micropython\n\nClone Micropyton and install its dependencies:\n\n```\nsudo apt-get install build-essential libreadline-dev libffi-dev git pkg-config libsdl2-2.0-0 libsdl2-dev python3.8\n\ngit clone --recurse-submodules https://github.com/littlevgl/lv_micropython.git\n```\n\nApply [patches](https://github.com/harbaum/ftDuino-controller/tree/main/patches):\n```\ncd lv_micropython\npatch -p1 \u003c http_server.patch\npatch -p1 \u003c lvgl.patch\npatch -p1 \u003c uzlib_compression.patch\n```\n\nThis will add web server support to the micropythin bindings, increase\nRAM access speed, add ftDuino remote controller LVGL theming, disable a few\nunused things to save memory and add zlib/gzip compression to\nMicropython.\n\n### Step 3: Build and deploy micropython\n\n\n```\ncd lv_micropython\n. ../esp-idf/export.sh\nmake -C mpy-cross\nmake -C ports/esp32 BOARD=GENERIC_SPIRAM deploy\n```\n\nThis will result in the micropython firmware to be flashed to the\nESP32. You can connect a terminal program like picocom at 115200\nbit/s to the board and watch it boot and use the REPL.\n\n### Step 4: Populate embedded file system\n\nIn order to copy files into the micropython file system you need a\ntool like [ampy](https://github.com/scientifichackers/ampy). You can\nverify that ampy is working by entering e.g. ```ampy -p /dev/ttyUSB0\nls```. You omit to specify the device explicitely if you install an\nenvironment variable like ```AMPY_PORT=/dev/ttyUSB0```.\n\nIf you are using a breadboard setup with an off-the-shelf TFT touchscnreen\nyou'll likely have to change init_gui_esp32 in [gui.py](firmware/gui.py) to\ncorrect the screen colors and to ajust the touchscreen calibration:\n\n```\n    def init_gui_esp32(self):\n\n        # Initialize ILI9341 display\n        from ili9XXX import ili9341\n \n        self.disp = ili9341(miso=19, mosi=23, clk=18, cs=5, dc=32, rst=27, spihost=1, power=-1, backlight=33, backlight_on=1, mhz=80, factor=4, double_buffer=True, hybrid=True, asynchronous=True, initialize=True)\n\n        # Register xpt2046 touch driver\n        from xpt2046 import xpt2046\n\n        self.touch = xpt2046(cs=26, spihost=1, mhz=5, max_cmds=16, cal_x0 = 3783, cal_y0 = 3948, cal_x1 = 242, cal_y1 = 423, transpose = True, samples = 3)\n```\n\nAfterwards all files from [firmware](firmware/) need to be copied to\nthe internal flash. Additionally an /apps directory has to be created\nto hold the user generated programs. You can optionally copy\n[some example apps](apps/) there.\n\nFinally the [html](html/) pages need to be copies to the internal flash\nusing the [install script](html/install.sh).\n\nIf everthing has been setup correctly the firmware will boot into a\nuser interface allowing it to be integrated into any WLAN which in\nturn can be used to log into the ftDuino remote controller with a\nbrowser to write and run custom Python applications.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fharbaum%2Fftduino-controller","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fharbaum%2Fftduino-controller","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fharbaum%2Fftduino-controller/lists"}