Nice(?) and cheap ESP32+Colour display

Mine arrived today.

Nice site to help create a design.
(waiting for my device)
https://haspdesigner.qrisonline.nl

2 Likes

Got Hello World sketch working :slight_smile:

JFI My libraries TFT_eSPI folder was in in Documents/Arduino/libraries/libraries for when i needed to add user_setup.h to it

I'm printing off my 3rd case - 1st one (ESP32-2432S028 enclosure for Battery and BMS - 3D model by dimosram on Thangs) is completely the wrong case for it

Printed off 2.8inch ESP32 2432S028R by Leoruiz197 - Thingiverse and that is a correct one but just a fraction too tight so I've just increase width/length by 1mm

[edit} If any of you usual suspects in the UK would like a case - just message me your address and I'll pop one in the post :slight_smile:
[edit2]Added MQTT to the TouchTest example and receiving info in NR
image
[edit3]After 24hours for some reason I CANNOT get it to receive a subscribed message from my broker - I must have programmed tens of ESPs to receive a cheerlights colour but for some reason I can't bake the cake I need from the Nick's PubSubClient recipes !!
[edit4]I'd forgotton to add client.loop() inside the main loop() #Noggin :slight_smile:

3 Likes

A couple of other resources:

This video from may 2023 mentions a website from August 2022 with details (English/Chinese[?]) and sample code. It has an annotated photo of the board, though it might not be the same version as they are selling now.

The one I got seems not to have a light sensor, but instead the LED is moved to the front of the board (!) Edit - or maybe it does have an LDR.

I wonder if it's possible to drive the display using node-red-mcu. Otherwise maybe this is a nudge to look at ESPHome.

Mine certainly not identical to that. For example, that has a Flash memory chip in the middle - mine has space but no chip. But it does have what appears to be an LDR marked as R21 on the front next to the screen.

Should be usable but I'm not sure about the screen. Does the MCU version have screen drivers available?

I'm hoping for ESPHome as all my other ESP's have gone that way including some with screens so I have some code for simple screen layouts that it would be nice to try.

But if node-red-mcu were to work, that would also be amazing.

Has anyone managed to get the OpenHASP nightly web installer to work?

Do I need to do something to get it into a programming mode?

A lot. Then either there's an already-existing & usable config, or the team at Moddable may support to create one on short notice. Is there a link to a spec of the board available?

I don't have one of these boards, but usually gpio 0 needs to be grounded.

There are instructions for building here

There are a few different sizes and specs of this board available. The one I have has specs and other documents at http://pan.jczn1688.com/directlink/1/ESP32%20module/2.4inch_ESP32-2432S024.zip
If I can work out how to get the new and improved dropbox to share a document I'll put a link to the specifications pdf.

Here it is Deleted

Looks like this device uses an ILI9341 display driver chip.
There are a number of configurations already prepared & supported by node-red-mcu for the combination of an ESP32 + ILI9341. If they don't run out-of-the-box, it shouldn't be too complicated to generate a config file based on those templates.

Depends on your language skills :slight_smile: fmzhangpei241的主页 - 21ic电子技术开发论坛

But there is quite a lot of info here: GitHub - witnessmenow/ESP32-Cheap-Yellow-Display: Building a community around a cheap ESP32 Display with a touch screen

Appears to be a fairly standard ESP32-WROOM with a 320 x 240 2.8" ili9341 screen with either resistive or capacitive touch. Along with a single addressable RGB LED and an LDR.


These are the ESPHome settings for the screen and touch, fairly self-explanitory:

# Setup SPI for the display. The ESP32-2432S028R uses separate SPI buses for display and touch
spi:
  - id: tft
    clk_pin: GPIO14
    mosi_pin: GPIO13
    miso_pin: GPIO12
  - id: touch
    clk_pin: GPIO25
    mosi_pin: GPIO32
    miso_pin: GPIO39

# Use ili9xxx as the screen type
display:
  - platform: ili9xxx
    model: ili9341
    spi_id: tft
    cs_pin: GPIO15
    dc_pin: GPIO2
    # 240x320 by default so we rotate it to 90° if needed
    rotation: 90
    # Example output
    # lambda: |-
    #   it.print(160, 140, id(arimo20), id(ha_blue), TextAlign::BOTTOM_CENTER, "Hello World!");
    #   it.rectangle(0, 0, 320, 240, id(ha_blue));

# Set up the xpt2046 touch platform
touchscreen:
  platform: xpt2046
  spi_id: touch
  cs_pin: GPIO33
  interrupt_pin: GPIO36
  update_interval: 50ms
  report_interval: 1s
  threshold: 400
  calibration_x_min: 3860
  calibration_x_max: 280
  calibration_y_min: 340
  calibration_y_max: 3860
  swap_x_y: false

# Backlight for display - eg for Cheap Yellow Display
light:
  - platform: monochromatic
    output: backlight_pwm
    name: Display Backlight
    id: backlight
    restore_mode: ALWAYS_ON

Thanks for that. I was hoping it had been made easier. :grinning:

I just need to work out where GPIO 0 is!

I have only tried an led blink sketch so far but didn't need to ground gpio 0 to flash it (I have never needed to do this on esp development boards)

OK, thanks. I can't see an exposed GPIO 0 anyway but there is a boot and a reset button.

It might be that the OpenHASP web installer via my browser simply doesn't like the COM port. I'll have to download and try the old-fashioned way.

So, I've been revisiting this and thinking about the weaknesses of developing for MCU's with screens.

While ESPHome is fantastic for most things and makes development easy without losing flexibility. The one thing it is majorly missing is a GUI designer or GUI high-level library. This makes designing screens a real PITA. OpenHASP has the designer but only limited hardware support (M5Stack v1 not supported for example and the ESP32-3543D024 only in nightly builds right now). Then there is the GUIslice library but no obvious way to directly integrate with ESP Home or other standard firmware integration that I can see.

I can see that Moddable have a GUI library and I haven't had a chance to look at that yet or work out whether it is available as open source.

So it feels like there might be an opening for node-red-mcu if it could integrate Modable's GUI library or GUIslice (or some other equivalent) then it would become an incredibly powerful low-code platform for even wider use.

I guess this probably isn't the right place to have this discussion? But maybe it is worth starting?

node-red-mcu has GUI support - as well as the option to run the (standard) Dashboard v1 nodes on an MCU with screen. An appetizer: Peter demonstrated this already last year at Node-RED Con 2022. I'm pretty convinced, the implementation of the ui nodes may act as a great template to add further node-driven capabilities.
By the way, the touch interface is operational as well...

Always. There's a lot more potential in node-red-mcu than currently uncovered!

1 Like

Ok, you've got me - I will give it a go. :grinning:

I assume I have to install Moddable first? The node-red-mcu instructions aren't terribly clear on the getting going front unless I've missed something obvious.

1 Like

I have to admit it was quite overwhelming for me also. Hopefully this step by step tutorial helps.

Note that the tutorial is for an ethernet wired wt32-eth01 device. But for wireless devices (wemo,...) it is easier, because then you don't need an usb/ttl converter and you don't need to hardware anything to enter programming mode.

Yes. Either follow the instruction given by the Moddable SDK repo @ GitHub and/or the great tutorial of @BartButenaers and/or use xs-dev, tasked to make the installation of the SDK a lot easier.

That done, just install node-red-mcu-plugin from the Palette Manager (which will pull in node-red-mcu). I assume - based on past experience - that you'll hit an issue due to your installation. If so, we'll get that fixed fast...

1 Like

Phew, thanks both, too tired now to try tonight. I've some time off tomorrow, may try then.

1 Like