ESP8266 Controlled Display Project Log

  • I'm currently working on adding an LCD to my printer. I've read a bit about the pins being available on the board but no firmware support and I lack the knowledge to change the firmware so I'm doing the next best thing!

    I'm going to attach that LCD to an ESP8266 and use the HTTP commands to control the printer, the only connection to the Duet will be power/ground. So far I've got to the point where I can parse status 1 and 2, print those values to serial, and turn the fan on/off based off axis position - no real use yet I was just testing reading values and sending g-code.

    alt text

    I have built a torch height control for my plasma cutter with a similar display but I really struggled with making a menu in Arduino - if you are interested in seeing how I did it go here and for a video of it in action go here and an older video of navigating/working the display before I added more values is here.

    Once I get it working I'll roll a pcb to allow easy attachment to the display, here's the board for the plasma cutter alt text

    I'm doing this because I would like to learn more about the ESP8266 and it seems like a cheap solution to getting a cheap LCD working with the Duet without firmware/hardware changes. If anyone is interested in helping with the LCD, JSON parsing, or just the project in general please let me know!

  • I've hit a bit of a road block on how to handle variable length replies like those that come from http://printerip/rr_filelist?dir= or http://printerip/rr_filelist?dir=gcodes since both of these replies will depend on how many directories you have created and how many files you have currently uploaded.

    I've found this on the ArduinoJSON FAQ which basically says to throw memory at the buffersize if you are unsure of what the response will be but that seems a bit wasteful considering how big some of the status replies are and the buffer they will need. Does anyone know of a better way to handle parsing the response?

    Here is the response from my printer for http://printerip/rr_filelist?dir=gcodes


  • And to get started with the code -

  • I'm just gonna throw this out here for some ideas. It doesn't look like there is enough IO available on the typical 30 pin ESP8266 board to use the standard 20x4 smart controller or 128x64 full graphic without modification; 9 pins are required just for LCD, Encoder, and Encoder Button - still need 7 more pins for the reset button, SD card, and buzzer.



    1. Display and encoder (with button) only - no modifications required to the ESP8266
    2. Display, encoder, reset button, and buzzer - requires use of shift register for LCD, will cut pins from 6 to 3 - no SD card

    ESP32 - Availability looks odd so I may want to stick with an Adafruit Huzzah32 or Sparkfun ESP32 Thing

    1. Display, encoder, reset button, and SD card - no modifications required
    2. Everything! - requires use of shift register for LCD

    Unfortunately with the 32 as discussed there are several different on Amazon has 38 pins while all of the ones I seen with a quick glance on Aliexpress have 30. I'm kind of stuck with using a dev board as I don't have the electronics or PCB knowledge to create my own ESP32 breakout.

    I would like to stick with the RepRap style displays as they are cheap and the goal of this is to keep the price down. Both displays run around $10-15 for the display, encoder, reset, buzzer, and SD. There are options for i2c displays and encoders but that pushes cost up for minimal gain.

    I'm thinking ESP8266 with the shift register and just ignore the SD card as you can just use DWC or the slicer to send the file to the Duet. There will still be the option to select which file to print (provided I can figure out how to do it). There is one more option of using a Teensy and an ESP8266 but that's really pushing it for my skill level.

  • Why SD-CARD? It will work much shittier than the Duet embedded version.

  • @sigxcpu said in ESP8266 Controlled Display Project Log:

    Why SD-CARD? It will work much shittier than the Duet embedded version.

    The PanelDue has an SD card and these displays already have one, its just a matter of hooking it up. Files would be sent from the SD card over WIFI to the Duet anyway, it would not be for printing from the display.

  • @tjb1 You said you are constrained on number of pins. So adding a SD-CARD because PanelDue has one (not constrained in number of pins) and not using it will eat precious pins count, right?

  • just downloaded your lib to my esp8266, and I think I'm connecting but I'm getting zeros for all values. Do you know what might be my issue? I don't see how the code handles login to the duet, don't see a password value anywhere.

    Great job with your library though, this looks very promising for my project. I just want to monitor everything from an arduino, without using hardwired i/o.

    Serial Display:
    HTTP Code: 401
    X Pos: 0.00
    Y Pos: 0.00
    Z Pos: 0.00
    Current Voltage: 0.00

  • @btmcmahan said in ESP8266 Controlled Display Project Log:

    HTTP Code: 401

    unauthorized, so odds are its not dealing (correctly) with login - disabling the password on the duet temporarily is a quick test.

Log in to reply