Bliss Posted Monday at 11:50 PM Author Posted Monday at 11:50 PM @Toastie, Wow, I knew from your other threads and posts that you don't do things halfway and this is no exception. This is a very cool setup as you can easily use USB or BT (HC-05). I'm working on a version based on the Int.A V2, but is uses WebSocket through wifi. It's using an ESP32 to make the bridge between wifi and the Arduino serial. ESP32 (WIFI) here replaces an HC-05 (BT) It still under testing and I'm not sure I will officially release it as the setup is a bit more complex to get a bit more speed and a lot more distance... The setup for the WebSocket Bridge requires: Need Wifi (goes through a wifi router. I guess everybody has wifi at home... I guess it could work with ESP32 in AP mode... I did not test this) Wire RX2, TX2 of ESP32 to TX, RX of arduino... Need nginx sofware on the computer that has blockly (small exe and conf file) Upload the Lego9750_ws sketch (which is almost the same as the v2) into an arduino uno or nano. (This is temporary as I want to adapt so it is the same sketch) Upload a ESP32_WS_Bridge sketch into an ESP32 Wroom (I use mini esp32 devkit) You must edit the sketch to enter your wifi ssid and password before you upload. Once uploaded, use the arduino IDE serial debug to get the IP address of the ESP32 Edit the nginx.conf to put this ip address. Start NGINX. Enter https://127.0.0.1 in chrome to accept security warning and get the welcome to nginx page... In blockly, select Int.A WS and connect... Use the same blocks as for Int.A V2... So as you can see, it's more setup but it's feasible. After many iterations, it's appears to work reliably but it has not been easy. So i might add the files in my github and some instructions but not sure anyone will use it :-) Quote
Gunners TekZone Posted Tuesday at 01:07 AM Posted Tuesday at 01:07 AM (edited) 6 hours ago, Toastie said: Now I have a BT/USB Int.A interface for LEGO Blockly, which works without Int.A connected - regarding the outputs. I can just carry the lill Uno with me when traveling ;) Input wise, bold switches, as the 4.5V touch sensors work as well (but logic is inverted). Oh wow! Very nice!! Makes me want to build something similar to fit in my current MEGA with display sandwich (it is already three boards thick including MEGA and display), to add in the Blockly BT option, and a nicer Int-A connection with less dupont. As well as just for the fun of building it Alas... First I still need to find a way to merge the MEGA Touch Screen control and Blockly interface code together... And catch up with all the Blockly changes... But all that requires too much thinking So for now I just lurk BTW... I have noticed that both of my Interface-A's only output 3.7 - 3.8vdc (but it is stable even with motors running) regardless of type of AC or DC adapter connected to them. Can others measure their voltage outputs and let me know what they are? Thanks! I am wondering if I need to do some regulator upgrades in both of mine?? Edited Tuesday at 03:16 AM by Gunners TekZone Quote
Toastie Posted Tuesday at 09:56 AM Posted Tuesday at 09:56 AM (edited) @Gunners TekZone Thanks - and yes, the BT connection clears up some mess, particularly when you feed Int.A as well as the Arduino/Mega from the same 9-12 V power supply. That doesn't even violate the strict LEGO philosophy of isolating everything on the Int.A power side incl. GND from the PC power side, as air is rather non-conductive :D Also, the Dupont type connection to 9750 (I am always using when prototyping) is a bit shaky when moving the equipment around. 18 hours ago, Gunners TekZone said: Can others measure their voltage outputs and let me know what they are? Thanks! I am wondering if I need to do some regulator upgrades in both of mine? The circuit diagram of 9750 says "+4V" as feed voltage for the power MOSFETs of the 6 outputs and the permanent 4V output. So I guess 3.7 - 3.8V is fine. My three 9750's are all in the same range as yours on the permanent 4V output. Best Thorsten @Bliss Thank you - well, I am trying to do it as clean as I can, but that does not mean much! 19 hours ago, Bliss said: I'm working on a version based on the Int.A V2, but is uses WebSocket through wifi. It's using an ESP32 to make the bridge between wifi and the Arduino serial. ESP32 (WIFI) here replaces an HC-05 (BT) THAT sounds also really cool! Yes, Wifi seems to be everywhere ... don't the Shelly people use customized ESP32s to use and extend Wifi range at the same time for all their wireless stuff? There are some Shellys (Wifi power plugs) in the house, as the Huawei EMMA controller for our PV system knows how to talk to them. "No sun, no juice" control :D How about using the Arduino "UNO Rev4 WiFi" board with RA4M1 and ESP32-S3 controllers for that purpose? There are also ample of LEDs on the board itself, as shown for example here: https://www.reichelt.com/de/en/shop/product/arduino_uno_rev4_wifi_ra4m1_esp32-s3-353108?country=de&CCTYPE=private&LANGUAGE=en EDIT: And it has BT as well ... All the best Thorsten Edited Tuesday at 07:26 PM by Toastie Quote
Bliss Posted Wednesday at 02:57 AM Author Posted Wednesday at 02:57 AM 19 hours ago, Gunners TekZone said: Alas... First I still need to find a way to merge the MEGA Touch Screen control and Blockly interface code together. Correct me if I'm wrong but your display + mega setup is for testing "Interface A" inputs and outputs only, there is no lego project program running in this setup? This is the setup we see on LVL1 website right? The version 1 of Interface A blockly driver using arduino is using LVL1 arduino code so I guess you could add the necessary code in arduino to support the touch screen but you would need to add some kind of button, on the touch screen maybe, to switch between outputs controlled by the screen or outputs controlled by blockly so they don't fight each other... However, I'm planning to get rid of v1 arduino code and replace it with v2 arduino code which is a totally different code not compatible with LVL1 as it is more like Int.B protocol in v2 version. But it does not mean you cannot integrate the touch screen to v2 arduino code... It just might be less obvious as the original LVL1 touch screen mega program would have to be modified a bit. Both versions are still avail in lego blockly but I encourage every one to start using Int.A v2 and convert their v1 blockly program to v2.... Why did I make a Int.A Arduino v2? It's to try to optimize serial requests... Every time we checked inputs in a loop, it was doing a read request to the arduino... If we check input 6 and 7 in a loop, it was 2 separate read request. In v2 arduino sends a packet with all input states (even output states). Blockly app read continuously in a separate internal routine like Interface B. In v1, LVL1 version is using TEXT commands and it takes few bytes per command. (1 byte for each characters) v2 now uses only byte opCode. Like interface B. I'm not sure it is realy faster and efficient but it feels like it is ;-) Quote
Toastie Posted Wednesday at 08:37 AM Posted Wednesday at 08:37 AM 5 hours ago, Bliss said: I'm not sure it is realy faster and efficient but it feels like it is ;-) I have the same feeling, but did not yet stress test. I shall do that over the weekend - if you leave V1 up until then, that is. Also, I like your V2 Arduino code much better than the V1 version. Regards Thorsten Quote
Gunners TekZone Posted Wednesday at 08:40 PM Posted Wednesday at 08:40 PM (edited) 17 hours ago, Bliss said: Correct me if I'm wrong but your display + mega setup is for testing "Interface A" inputs and outputs only, there is no lego project program running in this setup? This is the setup we see on LVL1 website right? YES, as is just manual. NO LEGO program (although some simple "ladder logic?" like LEGO Lines could be programmed in) and YES same one on LVL1. Edited Wednesday at 08:42 PM by Gunners TekZone Quote
Bliss Posted Wednesday at 10:52 PM Author Posted Wednesday at 10:52 PM (edited) On 5/5/2026 at 5:56 AM, Toastie said: How about using the Arduino "UNO Rev4 WiFi" board with RA4M1 and ESP32-S3 controllers for that purpose? There are also ample of LEDs on the board itself For Web Socket (WiFi), it might do the job. However, ESP32 wroom is more mature for this matter. This new UNO R4 is not cheap though compared to a cheap clone Nano/UNO with a cheap ESP32 Wroom Mini. On 5/5/2026 at 5:56 AM, Toastie said: EDIT: And it has BT as well ... S3 has only BLE. It does not support bluetooth classic. BLE is longer range but is much slower than BT Classic. An HC-05 would be faster. However I tried ESP32 Wroom BT to see if it was better than HC-05 and I did not see much gain so I abandonned the project but it was working somehow. Edited Wednesday at 10:54 PM by Bliss Quote
Toastie Posted 19 hours ago Posted 19 hours ago (edited) 19 hours ago, Bliss said: For Web Socket (WiFi), it might do the job. However, ESP32 wroom is more mature for this matter. 19 hours ago, Bliss said: S3 has only BLE. It does not support bluetooth classic. BLE is longer range but is much slower than BT Classic. An HC-05 would be faster. However I tried ESP32 Wroom BT to see if it was better than HC-05 and I did not see much gain so I abandonned the project but it was working somehow. Ah, I see! Thanks for the clarification! And yes, it really is expensive. For controlling my PoweredUp stuff, I am using the ESP32 Vroom Devkit 1 boards along with the LEGOino software Cornelius Munz has developed earlier; would that do the trick for the Wi-Fi application you are working on? If not, can you suggest appropriate ESP32 boards? There are soo many ... Best wishes, Thorsten Edited 10 hours ago by Toastie Quote
Bliss Posted 10 hours ago Author Posted 10 hours ago (edited) 15 hours ago, Toastie said: ESP32 Vroom Devkit 1 boards This board should be fine to run the WebSocket Bridge. I'm using ESP32 MiniKIT myself which I like cause the 4 pins I need are all aligned together. Pins used: VCC, GND, IO16 (RX2), IO17(TX2) I re-wrote my github Readme file in https://github.com/BlissCA/lego-blockly/tree/main I added a folder called WebSocket and inside this folder there is a README_WS.md. If you are interested to test, please read the README_WS and let me know here if you have any questions. Latest version of Lego Blockly is: Version: 2026-05-07-1412 Please, use Ctrl-Shift R to make sure it loads to latest version. PLEASE NOTE: When you connect to Intertface A using WebSocket, the javascript uses "https://127.0.0.1:7890" local URL to discover any ESP32 WS Bridge alive. Since we use self signed certificate, you will see a small message at the top (In chrome, it is at the right of the address bar) that says this is not Secure. This is unarmful and will not stop Blockly to run. Edited 4 hours ago by Bliss Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.