Websocket Head: Difference between revisions

From 3c2mWiki
Jump to navigation Jump to search
No edit summary
Line 16: Line 16:
* [https://desktop.turbowarp.org/ Dektop version]
* [https://desktop.turbowarp.org/ Dektop version]
or
or
* [https://turbowarp.org/editor online version]
* [https://turbowarp.org/editor Online version]


===Security===
===Security===

Revision as of 11:50, 26 August 2025

Robot Head controllable with Turbowrap via Websocket

Microcontroller

  • An ESP32 is Programmed in Arduino IDE
  • Servos, buttons, sonsors and speaker can be controlled with Website or websocket
  • Arduino code: esp32-sensors-and-servos

Website

  • Connect to ESP_32_servo_xxx
  • Open in browser 192.168.4.1
  • Optional: Connect ESP to local network, remember IP and connect to this IP
  • Control servos, read sensors, play sound via

Turbowrap

TurboWarp is a fast, powerful Scratch mod that adds more features and performance optimizations.

Start

or

Security

If you use the online editor, the wireless control of the microcontroller with TurboWarp will not work out of the box in most Browsers. There is are security policies (Mixed Content, Same-Origin-Policy) that only allow certain communications between http and WebSocket (https-wss http-ws). You have to allow it manually.

  • Desktop version
    • No problem
  • Firefox:
    • Enter [about:config] in adress bar
    • Search for network.websocket.allowInsecureFromHTTPS
    • Set to true
  • Chrome:
    • To be tested
    • start chrome from cmd with chrome.exe --unsafely-treat-insecure-origin-as-secure=http://192.168.4.1 --user-data-dir="C:/tmp/chrome-dev"
  • Local Hosting of TurboWrap
    • http <-> ws -> OK
  • Run finished project localy