Jump to content

Bliss

Eurobricks Citizen
  • Posts

    107
  • Joined

  • Last visited

1 Follower

About Bliss

Spam Prevention

  • What is favorite LEGO theme? (we need this info to prevent spam)
    Technic

Recent Profile Visitors

1,091 profile views
  1. Just added the UIFlow2 Blocky version for M5Stack Devices in the drop box (Link also in post #1). I tested only on M5 Core2 ESP32 device. Not fully tested and it was very painful to make the custom block... Also, I find the blocky can be very ugly sometimes. UIFlow2 demo project LegoInterfaceB.m5f2 and also the Custom Block for Lego Interface B driver Lego9751.m5b2.
  2. I removed the "plc" version and replaced it with LegoB micropython V2 folder. I updated Post #1 too. Lego Interface B MicroPython ESP32 V2 Now I use MCU Timers for both the keep alive and Inputs Byte Frame readings... Using Timers creates constant periodic interrupts. (There are 4 of these Timers available on the ESP32) (Should have done this before...) So we can do slow sequences or non blocking fast logic (like an industrial PLC). The V2, i believe, is the simplest to use and I hope, the most stable version of the MicroPython ESP32 Lego Interface B driver. UPDATE 2025-02-05 9h47: I left the V2 running overnight with the MQTT demo and when I checked this morning it was stopped with an OS Error (Error from the umqtt.simple)... ESP32S3-zero mcu... (It seems stable with no mqtt demos) I will let the V1 running the whole day with its MQTT demo... UPDATE 2025-02-05 20h38: I left V1 MQTT demo running all day and no fail but maybe this version of mqtt has some auto reconnect feature. I'm trying LegoB V2 again since few hours with the umqtt.robust rather than umqtt.simple and it does not fail, but robust version of umqtt uses the .simple with some auto reconnects on fail... UPDATE 2025-02-06 01:06: The LegoB V2 eventually failed. Now it was a Checksum mismatch lf the LegoB continuous inputs reading... I suspect that when there is mqtt.robust auto reconnects, it takes ressources and bothers to reading on serial... idk... Anyway, I made (and uploaded in dropbox of the LegoB V2) another mqtt demo (demobv2_mqtt_2.py) that uses the same "mqtt_as" library that I used for the V1 LegoB. Now let's see if the LegoB V2 demobv2_mqtt_2.py will run overnight with no fail... UPDATE 2025-02-06 11h47: LegoB V2: demobv2_mqtt_2.py has run overnight no fail... This mqtt_as library is really solid...
  3. @Gunners TekZone I found out that the IoT MQTT app on the phone allows to backup the configuration. So, I just uploaded a backup (json) of my IoT MQTT Panel configuration. You will still need to configure your broker info. I don't know if the backup will work on an Android phone though...
  4. Indeed in every demo programs I offer, there are few settings to change (Described in the README). tx rx pin in the lego.start method and for the mqtt demo, the ip address of the broker. In addition, the secret.py should be updated as well for using the network features (MQTT and WebREPL)... If someone does not not need the network at all in his project, he does not need to replace the boot.py file and he only needs to copy the legob.py and his project file like demob.py or demob02.py that's all. No need to copy the boot.py, the lib folder, secret.py etc... The phone app IoT MQTT Panel is really just another alternative for those who wants to have a nice UI (User Interface or HMI Human Machine Interface) to control their Lego Interface B outputs from their phone a bit like the https://www.controllab.io/ which is using a webbrowser... I found myself this IoT MQTt Panel app very easy to setup and fun to play with. But since IoT MQTT panel is configurable, it is more flexible. You can also make Home Assistant Dashboard and custom "Cards" etc. Many solutions. Node-Red is great to test and make programs to interact between IoT devices... It a favorite for many in the IoT world. I update the demob_mqtt_v2.py to make all sensors avail to mqtt. I also put comments at the beginning to describe the topic to use. EDIT 2025-02-02 17h16: I made a correction in the demob_mqtt_v2 for the reset of rotation count and I also uploaded a demob_mqtt_plc_v1.py in the LegoB "PLC" version folder... The demob_mqtt_plc_v1 file uses the built-in umqtt.simple since there is no asyncio in this version... We'll see if it runs reliably... Have fun!
  5. ESP32 devkit are still the best. very stable. I like also the mini version of the ESP Wroom 32... The webrepl is really to use the Wifi to access the "Shell" so you can access remotely with no USB link to your ESP32... But it is slow. I think, for a particular project, someone will use the USB to test and when fully functionnal, the user will rename his final project file main.py so that it will be executed automatically when you apply power... Right now, I made provision to power my esp using the lego box power connector on the front but I do not use it because I prefer to use USB link to test. It is faster. But for a final project, I would disconnect the usb and use the 9vdc link to power the ESP... I'm glad you you managed to test the setup... I feel less lonely now ;-)
  6. Here is a preview of the UIFlow 2 blocky LegoB blocks and a working sample program. (nothing fancy motor port A follow state of Touch sensor input 1). (On a M5 Core 2 but same has worked on a M5Stick CPlus)
  7. I played a bit with the M5Stack ESP32 devices I have in hands. Notably the M5Stick CPlus. But I did not yet installed a bare micropython firmware in it. I was wondering if I could implement a LegoB Block in their UIFlow Blocky... I found out that their blocky thing is a bit limited and does not allow ASYNCH tasks really... ASYNCH allows to simulate some multitasking... (Micropython does not have real mutli-threading... not yet). So in blocky, you have a setup and a loop. But behind the scene they use micropython. They allow us to make our own Blocky custom blocks... I decided to try to make a LegoB blocky block that do not use asynchio... It works. I'm not finished implementing, but the basic works... If anyone is interested to my blocky LegoB code, let me know and I will finish implementing the methods and make it available in dropbox. That made me think it could be interesting to have a version of LegoB module that does not use ASYNCHIO as an alternative to the version using ASYNCHIO. So here it is: UPDATED 2025-02-04: LegoBv2 : LegoB Driver not using Asyncio. The main difference, is that your program is now responsible of the reading of the IO's. (see demob_plc01 et demob_plc02). It acts somewhat like an industrial PLC (Programmable Logic Controller which is my field of work). The code to achieve the same think as the multi tasking version seems bigger but for me it is more "logic" but I'm not objective cause I worked with PLC for over 30 yrs... So you always have to put your program in a FAST forever loop and ALWAYS include the lego.readinputs in the loop. And you have to think differently when you want to implement a sequence cause you cannot block the code for too long or you will miss input frames and might become totally un sync with the serial comm. demob_plc02 implements a sequence some how with delays between output commands... Let me know what version you prefer... The LegoB V2 is using Machine (ESP32 MCU) Timers to achieve separates tasks for KeppAlive and Read Inputs. Now the user program does not need to worry to much about timings...
  8. The M5Stack series of ESP32 products (Atom, Stick, Core) can be also a great options for those NOT wanting to solder... And their products are often LEGO compatible (HW Size, studs...) I will order for fun: ATOMIC RS232 Base TTL-RS232 ATOM Lite ESP32 IoT Dev Board I have a M5Stack Core2 already. M5Stack Core2 But I'm missing: RS232 Module 13.2 with DB9 Male Connector (Expensive, I will rather use Grove cable to a DB9 RS232/TTL converter module. But good to know it exists) Grove2Dupont Conversion Cable 20cm (5Pairs) I also have a M5Stick CPlus: M5StickC PLUS ESP32-PICO Mini IoT Development Kit . I might try it this weekend. I have grove connector cable with a bare end that I will adapt with dupont wires somehow... This small M5Stick has a small battery and a OLED screen and it also has some IR transmitter (maybe could interface the RCX?) and buttons and 6-Axis IMU, RED Led, RTC, Passive Buzzer, Microphone...
  9. Did you also buy some gender changer like: https://www.amazon.ca/DKARDU-Changer-Transfer-Adapter-Connector/dp/B09BQ4HF53 ? (Unless you aready have some...)
  10. What is Fritzing? I just picked up some pictures over the internet that looked cool. I was wondering though how these very easy to understand schematics were done. So thank you for the hint. I usually buy this kind of electronic stuff on Aliexpress. There are also on amazon of course but more expensive. I have no particular projects in mind beside this project of making these "Modern Drivers" for interface B hoping it might interest some people.
  11. Just updated the legob.py file. I added retries if it does not succeed to connect within 5 sec. (Will print a message asking to check serial connection and power to the box). Also, if the connection is lost while it's reading inputs, it will proceed to stop (shutdown) the box... EDIT: I updated again, more proofing and changed the version number...
  12. If you want to test the ESP32 micropyton legob without soldering, there are easy solutions: You will still need to get ESP32 board and a RS232 / TTL converter... and bread board or scew terminal breakout board. Those ESP32 board are easily available with pin headers already soldered...
  13. Here it is: Powered from the Power port on the front of the Interface B. So I added a Rectifier bridge to be independant of lego connector orientation. The ESP32-S3-Zero is tricky to setup micropython. Had to try with different firmwares. Had to choose the 4Mb version on the ESP32-S3 page. Also, once micropython installed and working, when enabling the wifi, the ESP32-S3 was crashing and reseting itself. After lots of readings I finally tried the trick of adding a 1000uF cap between 3.3v and GND... Those extra mini versions of ESP32 are missing some noise filtering and shielding I think... Now it works great with the demob_mqtt_v2.py file... I also put the folder "lib" on the dropbox that you can copy on your esp32 micropython device. With this, you will not need to install the improved mqtt async I talked before... It will be already there.
  14. I updated demob_mqtt_v2.py the file in the dropbox. The mqtt is now more responsive and I added few more published inputs. Will add more eventually. I tested the phone app called IoT MQTT Panel (I used the free app) with which you can easily make your own dashboard based on mqtt topic: (Also available on android device) *** WITH AN IPHONE 14, IT DOES NOT CONNECT TO MY LOCAL MQTT BROKER BUT WORKS WITH test.moquitto.orq broker... IT WORKS LOCALY WITH AN OLD IPHONE SE *** It is very responsive and the switch to start the motor on output A is quite fast. We could also configure the demo program to start a lego interface b sequence... UPDATE 2025-01-29: Updated the demob_mqtt_v2.py again and updated the image above as well
  15. Indeed, a 78L05 could probably do the job to bring the lego 9vdc to 5vdc which is safe for the ESP32 and Max 3232 board. I did not have any... But I have a bunch of buck converter boards. You also could do a more compact design with more soldering for sure. Double face tape the ESP32 on the back of the Max board and have the 5v voltage regulator also there... I might give it a try with a ESP32-S3-Zero super mini board...
×
×
  • Create New...