janick / WT32-SqLn

Getting started with Wireless Tag's WT32-SC01 Plus using SquareLine Studio and LVGL
MIT License
84 stars 11 forks source link

Thank you - IO ideas #3

Closed cimpok closed 1 year ago

cimpok commented 1 year ago

Hi Janick, just a quick thank you for now, I just found your repo. Some days ago my 2 pcs of SC01 Plus arrived, and while desperately trying to program them a Hello world with 8ms thru USB-C (seems that I managed to brick one of them, hope the right programmer revives it) and finding almost no information, you came to my rescue. I was even thinking to switch to the plain SC01 version: more info, more IO (with standard pin headers), extension boards available, but I am tempted by the prettier and faster display. have to compromise.

Your Boot Button looks great! I have a similar lying around somewhere, will do it!

I am looking to interface the SC01 Plus with some of my CNC machines first, so I will need IO to some MOSFET and relay drivers, motor control, PWM output for LED drivers, maybe I2C or SPI input. Will buy some of those 8-pin MX1.25 connectors (thank you for showing the source, I found no info how they are even called) Do you have an idea what existing IO extension board or ICs to use, in terms of what there are more examples for, software driver libraries? Considering the few available IO lines, I may rather choose to interface everything thru the RS485, making my on data bus with all my peripherals (with PIC controllers to convert everything to RS485), but how is serial communication supported by software libraries? I do not have much experience in ESP32 programming, previously I programmed the Microchip family microcontrollers.

sorry to barrage you with questions, (there will be more if I didn't scare you away) you're my only source of wisdom for now.

janick commented 1 year ago

The only experience I have with using the serial pins on the ESP32 platform is through ESPHome and that has a nice abstraction built-in. I'm sure the Arduino IDE or platform.io or espidf offer similar libraries but I have no idea where nor what they are. You could also use the 6 GPIO pins to create a SPI bus. Writing the READ/WRITE abstractions would be easy as it would be simply GPIO toggling.

Here's another suggestion: use a bunch of ESP32 minis to directly drive your physical interfaces where needed, then use bluetooth to communicate between them and the SC01. These would become BLE servers and the SC01 would connect as a client to all or a subset of them. Sending and receiving messages using NimBLE is trivial. That's the approach I use. For relays, you can find pre-made ESP32 control boards with AC supply: https://www.aliexpress.us/item/3256804005123216.html. I like the single-relay ESP32 boards because of their built-in power supply. I use it everywhere even if I don't need the relay. Only downside is the lack of USB port for programming, but there is a convenient header for the serial programmer. Put in OTA and you don't need to connect anything afterward.

cimpok commented 1 year ago

Thank you, great ideas! I'm coming from the wired age, don't trust RF communication's reliability yet that much, but I'll try that Bluetooth thing, would definitely give more flexibility in installation. Thank you for the links to those parts too, right on target, and crazy cheap. I have also bought this board to experiment with: https://de.aliexpress.com/item/1005002006058892.html with the zero power e-paper display it has many new opportunities. I hope I can you use the same dev environment with it as the SC01 Plus? You might want to try this board too?