Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ESP 3D 2.0 Status #179

Closed
luc-github opened this issue Oct 27, 2017 · 55 comments
Closed

ESP 3D 2.0 Status #179

luc-github opened this issue Oct 27, 2017 · 55 comments

Comments

@luc-github
Copy link
Owner

luc-github commented Oct 27, 2017

Ok time to prepare 2.0

What is the plan ?

It will definitly use ASync WebServer to have better both way communication between server and client and avoid some unecessary poiling which can disturb printer:

Any suggestion is welcome and can be discussed here

Devt Plan should follow this list:
1 - File upload check with file size (ESP3D + ESP3D-WEBUI) (done Async 👍 / Sync not Available ATM )
2 - ESP3D as library for daughter board (ESP3D) (done 👍 )
3 - Oled support (ESP3D) (done 👍 )
4 - WSocket + terminal like output (ESP3D + ESP3D-WEBUI)(done 👍 )
5 - GRBL support (ESP3D + ESP3D-WEBUI) (done 👍 )
6 - Output to printer configuration (ESP3D + ESP3D-WEBUI)(done 👍 )
7 - Event management (ESP3D + ESP3D-WEBUI)

  • IP update (done 👍 )
  • Ensure main UI is open once (close others if new is open like github) (done 👍 )

8 - DHT 11 / 22 support (done 👍 )
9 - Nextion Screen support ((ESP3D + Nextion FW)
10 - M408 support according target FW support
11 - Reprap support
12 - MKS TFT WiFI support (Simulate MKS-WiFi module behavior to use the connector)
14 - ESP3D as Library as part of main board FW (eg Marlin)
15 UI improvement :

  • Add Read Only mode (done 👍 )
  • Follow disconnection in authenticate page (Authentication is currently disabled in 2.X)
  • Allow to customise visible module (if no bed, if no temperature like for CNC, etc..) (done 👍 )

16 - Better support for CNC/laser
17 - support of smoothieware config-override file in settings (done 👍 )
18 - add mixed extruder support (done 👍 )
19 - add toshiba flash air support
20 - add ethernet support for ESP32 (like olimex)
21 - add optional translation file on SPIFFS for oled ESP3D message like (connected, update, etc...)
22 - monitor temperatures on Oled in autonomous way (no web browser connected)

@luc-github
Copy link
Owner Author

luc-github commented Oct 27, 2017

Also will support this kind of screen (0.96 inch oled 12864 ) which is cheap and popular (just received today ^_^) :
image

@luc-github luc-github added this to the ESP3D 2.0 milestone Oct 28, 2017
@kafftass
Copy link

kafftass commented Nov 1, 2017

If have added support for ILI9341 SPI Display for me , just a test, works fine. with 320x240/2.4 '' Resolution its better for my eyes. ;) At the momemt i only display sprites on it. With the optional Touch these display are multifunctional usable, no more worry about buttons. They are available from china for less than 6 €.
I also use MQTT for status messages and control, could be a choice for the next Version.

@luc-github
Copy link
Owner Author

I am not familiar with MQTT protocole so sorry if my question looks weird:

It seems mqtt is a subscribe/puplish protocole so it needs to be implemented with a goal to discuss with specific target, also the mqtt client for browser looks using websocket.
I understand it is used on home server like Jeedom or Domoticz but main usage of ESP3D is WebBrowser
So for sending some data to web browser need tcp/ip + websocket + mqtt - when today ESP3D use http+ JSON also based on query - answer way.

Can you explain / share to me what is the gain to use mqtt for ESP3D ? I would like to learn and understand.

@kafftass
Copy link

kafftass commented Nov 2, 2017 via email

@luc-github
Copy link
Owner Author

luc-github commented Nov 2, 2017

@kafftass thanks, so this confirm this is only in purpose to link to home automation server.
I have already added a ticket for that : #148

I am quite new in home automation but all servers I have tested Jeedom, Domoticz, openhab support different protocol including JSON for event signal
https://community.openhab.org/t/how-to-recieve-json-data/3720

@luc-github
Copy link
Owner Author

@khseal m5stack have their github https://github.com/m5stack - I have ordered one to play with
Thanks for sharing ^_^

@shaddow501
Copy link

Suggestion.

  1. Add some GPIO control for turn on/off additional LEDs.
  2. Option to Connect / Disconnect to the printer if using both Wireless and USB connection that one will not work when other is connected.
  3. Option to see the IP address and connection status in the OLED screen.
  4. Option to control PTZ wireless camera

a269962fe1424e1ca3e68c328b9fed61_preview_featured

@luc-github
Copy link
Owner Author

1 -Add some GPIO control for turn on/off additional LEDs.
[luc]This is already available :

*Get/Set pin value
[ESP201]P<pin> V<value> [PULLUP=YES RAW=YES]
if no V<value> get P<pin> value
if V<value> 0/1 set INPUT_PULLUP value, but for GPIO16 INPUT_PULLDOWN_16
GPIO1 and GPIO3 cannot be used as they are used for serial
if PULLUP=YES set input pull up, if not set input
if RAW=YES do not set pinmode just read value

and put the according command in UI using macro

2 - Option to Connect / Disconnect to the printer if using both Wireless and USB connection that one will not work when other is connected.
[Luc]How this can be done ? It is handled by printer FW or you need a daughter board that do the job according ESP priority on Serial and cutting USB if ESP is discussing with printer

3 [Luc] Yes that is the plan

4 - [Luc]Not sure how to do that , do you mean Macro accept url as command ? what camera has such command ?

@shaddow501
Copy link

1 -Add some GPIO control for turn on/off additional LEDs.
[luc]This is already available :

*Get/Set pin value
[ESP201]P V [PULLUP=YES RAW=YES]
if no V get P value
if V 0/1 set INPUT_PULLUP value, but for GPIO16 INPUT_PULLDOWN_16
GPIO1 and GPIO3 cannot be used as they are used for serial
if PULLUP=YES set input pull up, if not set input
if RAW=YES do not set pinmode just read value
and put the according command in UI using macro
[shaddow501] -I mean buttons on the web UI

2 - Option to Connect / Disconnect to the printer if using both Wireless and USB connection that one will not work when other is connected.
[Luc]How this can be done ? It is handled by printer FW or you need a daughter board that do the job according ESP priority on Serial and cutting USB if ESP is discussing with printer

[shaddow501] - to add a check mark whether it is controlled by USB or Wireless, than if selected USB than the ESP32 do not transmit TX commands only receives RX.

3 [Luc] Yes that is the plan

4 - [Luc]Not sure how to do that , do you mean Macro accept url as command ? what camera has such command ? ---- I have no idea lol

@luc-github
Copy link
Owner Author

1- Macro buttons are buttons ^_^ no ?
2 - Ok so User set the status not ESP3D automaticaly and UI will be read only for printer commands - is that what you mean ?

@shaddow501
Copy link

1- where can I find it in the web page?
2 - yes. the ESP3D will not send commands only will receive then,

@luc-github
Copy link
Owner Author

1 - image
image

2 - Currently ESP / ESP-WEBUI do not send anything unless user request info / send command on UI to printer

@shaddow501
Copy link

How do you write there the command to turn on / off the GPIO can you give an example?

@luc-github
Copy link
Owner Author

Should be :
[ESP201]P5 V1 High on GPIO 5
[ESP201]P5 V0 Low on GPIO 5

You can check the code also : https://github.com/luc-github/ESP3D/blob/master/esp3d/command.cpp#L391-L470

@shaddow501
Copy link

Thanks

@luc-github
Copy link
Owner Author

I have created a ticket for every topic - thank you everyone

@luc-github
Copy link
Owner Author

ESP3D 2.X topic are now properly tagged : https://github.com/luc-github/ESP3D/issues?q=is%3Aissue+is%3Aopen+label%3AESP-2.X

@luc-github
Copy link
Owner Author

luc-github commented Jan 14, 2018

Devt Plan should follow this list:
1 - File upload check with file size (ESP3D + ESP3D-WEBUI) (done 👍 )
2 - ESP3D as library (ESP3D) (done 👍 )
3 - Oled support (ESP3D) (ongoing 👨‍⚕️ )
4 - WSocket + terminal like output (ESP3D + ESP3D-WEBUI)
5 - GRBL support (ESP3D + ESP3D-WEBUI)
6 - Output to printer configuration (ESP3D + ESP3D-WEBUI)
7 - Event management (ESP3D + ESP3D-WEBUI)
8 - DHT 11 / 22 support
9 - Nextion Screen support ((ESP3D + Nextion FW)
10 - TBD

@luc-github
Copy link
Owner Author

DHT support is now done, will push it to repo soon
it is displayed on nav bar as not linked to extruder temperature
image

can be show/hide based on preferences
image

because it is handled by FW and not UI - settings are in EEPROM
image

the refresh interval is for ESP3D to query sensor - result is send to WEB UI using events

On OLED only temperature is displayed currently to save space
image

@luc-github
Copy link
Owner Author

WSocket + terminal like output is now implemented upstream - will be in next push to this repo like others new features

Now all printer serial output can be redirected to websocket
here repetier output in terminal
image

and of course it can be disabled anytime
image

@luc-github
Copy link
Owner Author

Now working on Reprap Native FW support - thanks to @svs072477 and his nice board ruramps4

M115 give : FIRMWARE_NAME: RepRapFirmware for RURAMPS4D FIRMWARE_VERSION: 1.21 ELECTRONICS: RADDS 1.5 FIRMWARE_DATE: 2018-03-21

I have already filled the needed info in https://github.com/luc-github/ESP3D/wiki/Firmware--support
looks like the answers are always one line ended by \r\n but no Ok ack like others FW

The support of M408 will be another part as no more specific to reprap/duet3d

@cyberhasse
Copy link

Hi!
Great work :)
I would like to try the GRBL functionality but i can't find the sources to compile.
Maybe i'm dumb or blind..
Regards.

@luc-github
Copy link
Owner Author

GRBL is on development version for 2.0 branch which as mentioned on read me is :
Development version for 2.0 (asyncwebserver branch) & ESP-WEBUI (asyncUI branch):
🙈 😸

@cyberhasse
Copy link

Thank you for the quick reply.
Yes i found that but how do i compile the source?
V1 was easy when loading ino file in arduino ide..
Regards.

@luc-github
Copy link
Owner Author

@cyberhasse
Copy link

Great thank you!
Regards.

@luc-github
Copy link
Owner Author

luc-github commented Jun 3, 2018

Just pushed latest update for DHT / Oled support / Websocket:
https://github.com/luc-github/ESP3D/tree/asyncwebserver

Current FW size is now around 415KB for esp8266 - I think for ESP01 need to disable some feature to fit the space if want to keep Web update - disabling DHT/OLED may help but did not checked

@luc-github
Copy link
Owner Author

luc-github commented Jun 12, 2018

Mixed extruders feature is now ready (up to 9 mixed extruders, still 2 extruders max for not mixed)
In preferences:
image
In UI:
image

Read only feature is also ready:
In preferences:
image

In UI if enabled:
Only control that do not affect printer are allowed
image

Progress button is the only exception because it is the one that allows to check print status

I will push these update to git when authentication and support of smoothieware config-override file in settings are done

@mosvov
Copy link

mosvov commented Jun 18, 2018

Hi Luc! You doing awesome work! Great project!
I have a question, you defined in config DHT_PIN to 22, but in esp8266 there is that pin?
DHT is not supported for esp8266?

@luc-github
Copy link
Owner Author

22 is. On esp32, on esp8266 you can use 16 or any free pin you have

@luc-github
Copy link
Owner Author

On ESP8266 I got several data lost issue from serial when quantity is more than 10K, several middle parts are missing - I did not test ESP32 as much as ESP8266 so not sure about behavior on ESP32

I am not sure where the issue come from as even using TCP commands, the bridge is loosing data ....
As the only big difference is the webserver - I will fork async branch and use sync web server for ESP8266 to see if it solve issues on ESP8266 - I wil use https://github.com/Links2004/arduinoWebSockets to keeps same feature to be able to compare behavior properly
this is not a little change so need time to work on it

@luc-github
Copy link
Owner Author

Ok it is confirmed: using same core but just put webserver sync and reading 24KB text file - got 0 data lost using serial/telnet bridge (which is not related to Webserver) , and 0 data lost with Serial / Webserver bridge.
So issues come from Async webserver somehow - but no idea why...

New ESP3D 2.0c is based on ESP3D 2.0b allowing ESP32/ESP8266 and Webserver Sync or Async , actions to be done are:

  • I currently focus on sync/esp8266 to bring back all features - still miss event / websockets but should be done soon

  • After I will check sync ESP32 to be sure everything is Ok

  • If Ok, I will push code to github

  • Then I will complete ESP3D 2.0c todo list

So test on Async will be postopned until issue root cause is found - to find out I will do a Minimal code to reproduce Async + Serial/TCP bridge , but currently it is not a priority vs the ESP3D 2.0c

@luc-github
Copy link
Owner Author

Ok 3 small issues moving to sync webserver :

  • Post arguments are not available untill all files download are processed, this is needed to check files are properly downloaded on SPIFFS and even FW update file.
    => solution : do a PR for ESP8266 Webserver allowing query to temporary post arguments array,
    this should not break anything in existing code, so hope PR will be accepted when I push it

  • Websocket library is not part of Webserver unlike async one, so need to use a different port number than webserver,
    => solution : Because I am not sure this is a necessary flexible parameter, I am planning to set automaticaly websocket port as web port +1, eg Webport = 80, Websocket will be 80 +1= 81, so not need to have a configuration for it

  • There is no event class / support in Websocket library
    => solution Use a second instance of Websocket adding [label] in message to discriminate messages, using web port + 2 (eg:80 +2 = 82) as need a new port for new instance, so not need to have a configuration for it neither

This will need a small modification of Web UI but all features will be there.

One drawback : this need now to forward 3 ports instead of 1port on routers for external access

@luc-github
Copy link
Owner Author

Update : actually use 1 additional port is enough :

  • use Text message for events
  • use Binary message for Serial to Websocket bridge
    So only one instance of websocket of websocket is neccessary

@luc-github
Copy link
Owner Author

Smoothieware config-override is now supported 🐱
Default page:
image

When no config-override file:
image

If there is a config-override file:
image

Will test this week end and fine tune some parts, then next week 2.0 sync for ESP8266 will be pushed to repo, I will then test if ESP32 is still Ok

@luc-github
Copy link
Owner Author

luc-github commented Jun 30, 2018

I have changed the /sd/config.txt and /sd/config-override push buttons by radio buttons for UI consistency vs ESP3D Settings
image
image

image

@luc-github
Copy link
Owner Author

Code pushed on https://github.com/luc-github/ESP3D/tree/2.0
Compatible ESP8266/ESP32 Async/Sync Webserver:
For best performances use :
ESP8266 with Sync webserver
ESP32 with Async Webserver

I did not tested all configurations yet, but it is quite stable, feedback are welcome here #238

For open topics I move them to #239

So this topic can be closed as it become to be long

@LKotumTeam
Copy link

А экран oled 128*32

@github-actions
Copy link

This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Sep 21, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

7 participants