-
-
Notifications
You must be signed in to change notification settings - Fork 306
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
[FEATURE REQUEST]Add grblHAL support : https://github.com/grblHAL #252
Comments
An initial update for WebUI 3.0 of the grblHAL WebUI plugin is now available. I am testing with a Nucleo STM32F756 board and the plugin should also work with the iMXRT1062 (Teensy 4.x) driver. Note that the ESP32 grblHAL driver does not use the plugin, I will backport the code changes to that later on. @dresco is working on a STM32H7xx driver that has ethernet and SD card support, it will be possible to use the plugin for this driver when it is updated to use the latest grblHAL core. |
Ok understood - unfortunatly I have no STM boards, neither Teensy 4.x, but I can emulate webserver and board responses in webUI dev mode I saw the the https://github.com/grblHAL/Plugin_WebUI but I was thinking was same code in https://github.com/grblHAL/ESP32 so I did not realized it was V3 based - I will have a look |
@terjeio you wrote
Can you tell which ones ? I can start by these first I have added the code base to test and build grblHAL webUI bac40f9 I need some confirmation :
I will check what play SD job commands you are using, reading https://github.com/grblHAL/core/wiki/SD-Card-implementation,-a-technical-walktrough it seems
|
Issues encountered: ESP701 for querying the status of a running job suddenly (randomly) is no longer sent after a running a few. Reloading resumes the querying. If wrong password is given on login correcting it and resubmitting leads to the USER field in the form data missing. The default file system is FLASHFS, could this be the first listed in the target ESP3D-WEBUI/src/components/Panels/Files.js Lines 509 to 512 in bac40f9
I've changed the code above and it seems to work but not sure if this has any side-effects (other than failure if none are specified):
"grblHAL" is the correct version. The welcome message from the controller is not correct, but I have been reluctant to change it as it may break senders.
There are a few proposals but none has been decided upon. I have to make my mind up...
Yes, I have changed this already.
Yes. For the plugin changing this will require a flash filing system. I may add this later. If the WebUI is compiled into the binary then adding index.html.gz to the SD card www folder will override the one from the binary so there is an update path available. More work on this is needed on my end - perhaps adding download of a new version to the www folder as a first step?
I am using $F=, I can also use ESP220 (IIRC this is used by WebUI 2.1) but when I check your ESP3D source it seems to me that this (and some other commands) has been repurposed? The commands that may have been reporposed have the help text "??" in this list.
I am not sure it is up to date, I'll have to check. Most can be ignored? Here are the preferences and target folder I created: Should grblHAL get its own firmware target name and id? Some ideas: Can WebUI fetch the settings labels from the controller? grblHAL has dynamic settings handling - plugins may add new ones, even user defined plugins. In my sender the settings UI is built from information requested from the controller. I can easily add an ESP command for fetching a json formatted list of setting ids and labels (and even descriptions) in a json formatted response. On a longer term todo list will it be possible to use the WebUI style settings handling? It will require the support for floats and a flag type where bit 0 controls the enable status for the rest. |
Currently this command is for the ESP3D Gcode host not used for running job, why not use the ? like GRBL_ESP32 ?
This is already the case, no ? Flash is the default because it is the one I know it is present for sure, so not sure what issue you meet
Yes these commands are used by GRBL_ESP32 which is only supported by WebUI 2.1, and since the GRBL_ESP32 is dropped, I did not maintained them in WebUI 3.0
it is just to allow these command to be used by macro using a text descriptor as they are not printable, I also see some commands :
You will have to tell me more what you expect for UI and behavior, but I see no issue to support it The current webUI use
So actually you can add any sections / items you want in settings just follow current syntax, if need more type of settings, just need to define type, type constraint, rendering form and should be ok like others types |
Reading your version now
|
I have updated and build the index.html.gz according your changes https://github.com/luc-github/ESP3D-WEBUI/blob/3.0/dist/CNC/GRBLHal/index.html.gz I still need to update the real commands parts I have also noticed you do not support the |
Polling for the real time status continues, only the ESP701 request stops. If I remove the ESP701 request the stream status is not displayed even if it is available in the real-time report. I assume this could be changed to use the real time report instead?
It is not present in the controllers using the plugin.
Ok, this explains it. They should not have been reassigned to a different use then? Or was this a customization made by bdring and his team?
If not needed I am ok with using ID=10 as I do not know what it is used for in your code.
Ok, what is the ESP command to use for returning those. And to be clear I am talking about the grblHAL settings where those not known by the WebUI does not have useful labels:
Ok, will update. Sun came out today after a period of rain - so it may take some time. And I will be away for a period starting Tuesday 2nd.
Definitely not - or at least until an abitration protocol can be added. Only one client should be in control at the time. As a first step I might add support for additional read-only clients - but this is longer term. |
I need to check if I have added a dependency on ESP800 settings
these are in language pack - they are just translation from commands id : https://github.com/luc-github/ESP3D-WEBUI/blob/3.0/src/targets/CNC/grblHAL/translations/en.json
this feature is actually mostly handled by webUI, the FW just broadcast the last connected ID by websocket , so the old ID webUI automaticaly close - not hard to implement - I may try to do it if you want I need to setup an esp32 system for grblHal as I am afraid I will do some blind code and may misunderstood some commands if I replace the plugin files to existing ESP32 code would it work ? any other changes should I do - I can do changes manually and this will let me know also why current version is always in reset error on my board
In FluidNC they renamed all commands https://github.com/bdring/FluidNC/wiki/FluidNC-Commands-and-Settings |
Just fyi, have started looking at this. First issue is that I used the STMCubeIDE provided middleware for SD card access (using DMA & SDMMC peripheral) - which uses an older FatFs version. Am looking into what it's going to take to upgrade.. @terjeio should I aim for R0.13c as per F4/F7 etc, or latest R0.14b? |
Wait... One step at a time please. I have some support issues to clear before I can dig into the details.
No, it is a major refactoring. Ideally I should update the ESP32 driver and the plugin so it could be used directly - I do not like to maintain duplicate code.
Oops, I forgot to asnwer this, by default grblHAL uses normally closed switches for all inputs. Connect the reset pin to ground and you should be fine. @dresco - the SD card plugin can work with earlier versions of FatFS, I should have used the version id provided by FatFS but are using the target MCU family for now for detection... If you update aim for the latest version. |
Thanks, was actually the webui plugin that complained, may just be something minor... |
WebUI is updated to a7
Now will check : https://github.com/grblHAL/core/wiki/Report-extensions |
about : Can WebUI fetch the settings labels from the controller? |
I have just committed an update to the ESP32 driver that uses (parts of) the WebUI plugin. I left the Note that forms based autentication is not yet supported for the ESP32 driver. And BTW the ESP32 webserver is really slow compared to e.g. the iMXRT1062 controller where WebUI loads in the blink of an eye... |
Ok thank you I give a try tomorrow - I was out all day today and need to finish some code first SerialProtocol value to Socket in the [ESP800 response] - it is fine - there is no use currently in WebUI but better to be consistent, if the need popup Ho yes ESP32 sync webserver is very slow, the test I did on current grblHal is already far faster (it use the idf async http server right ?) I am not surprised on another chip the performances are better - on reprap they claim to have wifi file transfer of 1.2MB/s but they do not use esp webserver ... thank you for the porting It will be easier for me to experiment - I will feedback you tomorrow |
Hi I have flashed my board with latest git and webui 3.0, very cool job thank you, so I have some questions :
Some comments :
Sorry to ask so many questions, hope you can answer before you will going to vacations - so I won't bother you 😸 Edit I see: |
Yes, as it cannot be displayed for all the platforms grblHAL supports, see this wiki page. I may add SSDP and/or add the IP address to the full status real-time report to fix this. This is the latest v3 json version:
Note that the backend supports v2.1 as well as v3.0, I use the version parameter added to the ESP800 command to detect 3.0 and set the mode for all subsequent commands (until a new ESP800 is requested):
Yep, it is the stepper code clock frequency, I have to add a new HAL value for the MCU clock...
I guess it is for implying that the value is a float - inherited from legacy Grbl.
Good question, I have to check my code.
No,
Correct. I try to be backwards compatible with the legacy Grbl specification, at least in spirit.
I would rather like to add a ESP command for querying setting details, same format as ESP400. I can even add most to ESP400 by just looping trough them instead of outputting those that your backend outputs.
The reason is that |
Ok so I see the issue - I have manually sent
The ESP400 management is not part of specific FW but common to all target ESP3D ESP3DLib GRBL_ESP32 grblHal etc... if you want to merge all settings in ESP400 like format - I can remove the tab
My question was because you already display When locked the Final question : what sender currently support all/most grblHal extra features ? This is mostly to have a reference to verify I interpret properly the new states in webUI |
IMO it will be better to add a new ESP command that outputs the information in json format, possibly the same as ESP400 uses as you already have parser/UI builder code for that.
I can add that but there will still be a problem with some controllers that uses native USB for communication as most of these loses any info sent before a client is connected. Not easy this...
It should work - are you sure about this.
Only ioSender as far as I know.
Is it Norton blocking it? I have not signed the code as the certificate for doing so is expensive.
There is only one new state |
if you really want to use ESP command then keep ESP400, the parser need to be modified for the new types only - the command itself is not an issue if you use json format - the parsing is piece of cake, in all case I will remove the feature tab as it is duplicate with grblHal settings
I have reflashed to test the fixes in webUI I did and I cannot duplicate anymore ... I am stumped...
yes and deleting all files one by one, I have paused Norton and now everything seems working - only the SD tab seems unresponsive but it is working in webuI so - it is not a problem for me
Yes I need to add the news states Forget my comment about I will check everything - thank you for all feed back and enjoy your vacations, I have everything to work now I think - this will keep me busy for a couple of days ^_^ |
Yes - I guess this makes it simpler for both me and you. The datatypes not directly supported by WebUI are 2 (exclusive bitfield), 4 (axismask) and 6 (decimal or float if you will, later I might add double precision support in the core as an option...). Examples in ioSender: $22 - homing enable (exclusive bitfield) - can be emulated imperfecly by your $5 - invert limit pins (axismask)
There are many more new ones, here is the source code in report.c and motion modes supported in gcode.h. If you aim for perfection mapping of error and alarm codes to text should be pulled from the controller? Note that these can also be added to by third party code. |
ho yes mask controls are a pain - I had some before and I converted all them to simple booleans, but I will see what I can do
No I am not - I will keep this part for then end because anyway all text need to be in translations packs so I currently just refer to code for that
Yes saw it - thank you |
I have committed some updates, noatbly forms based login (as used by WebUI 3.0) should now work and I have added IP address to the WIFI STA ACTIVE message. |
Ok will check that - I am still working on sanity check if not Flash is enabled - it was not a case I had planned so I am following every rat holes to be sure I did not forget anything that bring me back to my question : [ESP800] Above status lead me to add a new flag : hostFS, because you mentioned you do not use Flash on some system, so the index.html.gz is hosted on SD (or USB may be in future), so WebUI update, preferences.json should be read/uploaded from/to SD/www, Note: I have prepared a code to handle Bit Masks, but I will wait your decision of the format of [ESP400] with all settings to implement corresponding controls |
In fact it is possible to fetch the WebUI from flash, but then from a read only file system. I do check if the file is available in the www folder and if so it will used instead.
That could work, even when file system virtualization is implemented. Perhaps Just for the fun of I added a few lines to auto push the real time status report (along the $G-parser state report if enabled and changes to the report) and it works! Just add this code before webui_init() if you want to test it:
and in webui_init() add:
Change $10 to enable auto-reporting of the parser state: If this is of interest there should be a way to set the timeout? |
I have WebDAV enabled, e.g. when I change the Telnet setting WebDAV changes too and I get the hang. |
I think it is duplicate ID problem I will recompile grblHAL with same settings as you to verify |
Hmm I do not know if it is an issue but I see a problem: Currently I check Option size = size of the mask here 5 if you use index out of the array I may be in trouble, can you clarify the behavior ? should I look for max index to know the size of the integer array instead of the options array size itself?
I reproduce the hang only if I change webdav actually |
Ok, the index it is the bit number in the mask. I'll try to encode/decode to the correct mask on my end? |
Saving any changed mask hangs with the Saving... modal at 0% and nothing in the network log... |
Value it the integer array so
is same as
Now if if you have non used bits (here 4 -5 - 6) I need to change the array size detection - but I need you confirmation
|
Yes, it is the same. But I will always deliver the bit id's in ascending order. |
so what about bits 4-5-6 ? |
Functionality not available in the controller so left out. I can try to encode/decode (or rather pack/unpack) on my end if a problem for you. |
I just need to know what to use to know the array size - so I need to search the higher value in option value, it is ok |
both issues are now fixed : https://github.com/luc-github/ESP3D-WEBUI/blob/3.0/dist/CNC/GRBLHal/index.html.gz I have question for you about the axis definition letters : because you mentioned above |
ok, will test.
1 and 2 axes are not supported, minimum is 3 If ABC is remapped to UVW then 4, 5 and 6 axes will be 4 axis =>X Y Z U and ? report exactly 4 positions and responses from the controller containing axis letters such as the |
Hmm but you mentioned here #252 (comment) XYZABCUV will be for 8 axis so if it is X Y Z U V W for 6 axis, what will be 7 and 8 axis letters ? Sorry for my questions I want to be sure I go to the right direction |
ABC cannot be remapped to UVW if configuration is for more than 6 axes. |
ok thank you for the clarification , I will work on solutîon that handle these configurations transparently for user: |
IMO there is no hurry to implement support for UVW, I do not expect it to become widely used - at least for some time. I'll commit a fix for ESP701 soon, then we can say mission accomplished? |
Yes I need to think about it properly, it will be implemented as running change so it will be compatible with current and future implementation
Cool - congratz for the task ^_^ I hope you are happy with the result |
Yes, I am - I hope you are too. I have just commited the fix for ESP701. |
Yes ^_^ - and all your suggestions help me to improve webui and related projects so very happy
Ok cool will check that - so next is bug hunting and features not related to grblHAL so I will close topic |
I have commited a fix for the |
Ok so I can push the update to support UVW and ABC now - cool ^_^ |
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. |
As started to discuss here grblHAL/ESP32#39
The text was updated successfully, but these errors were encountered: