Navigation

    Duet3D Logo

    Duet3D

    • Register
    • Login
    • Search
    • Categories
    • Tags
    • Documentation
    • Order

    Auto Bed Compensation Javascript Error

    Duet Web Control wishlist
    5
    22
    1241
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • esserr
      esserr last edited by

      Re: Height Map Javascript Error

      I am seeing the following message after running the auto bed compensation and the only way I am able to remove such error is to remove saving of the height map as the final line in bed.g file (M374) .

      0_1540947524056_93d846a9-4cb9-4ff3-a6f1-69d0b8605d3e-image.png

      1 Reply Last reply Reply Quote 0
      • Phaedrux
        Phaedrux Moderator last edited by

        Perhaps give this new release a try.

        https://github.com/chrishamm/DuetWebControl/blob/dev/DuetWebControl-1.22.4.zip

        esserr 2 Replies Last reply Reply Quote 0
        • dc42
          dc42 administrators last edited by

          Please tell us what version of main firmware you are using, and share your bed.g file. If you can do that today then I may be able to fix this in the 2.02 firmware release, if it hasn't been fixed already.

          1 Reply Last reply Reply Quote 0
          • esserr
            esserr last edited by

            Thank you,

            I am running 2.01 with web control 1.22.3 and server 1.21. All from latest stable release.

            dc42 1 Reply Last reply Reply Quote 0
            • esserr
              esserr @Phaedrux last edited by

              @phaedrux thank you I will give this a try tonight!

              1 Reply Last reply Reply Quote 0
              • dc42
                dc42 administrators @esserr last edited by

                @esserr said in Auto Bed Compensation Javascript Error:

                Thank you,

                I am running 2.01 with web control 1.22.3 and server 1.21. All from latest stable release.

                And your bed.g file? Specifically, are you using just M374 at the end, or are you using a P parameter to name the height map file - and if so, what name are you using?

                esserr 1 Reply Last reply Reply Quote 0
                • esserr
                  esserr @dc42 last edited by

                  @dc42

                  ; bed.g
                  ; called to perform automatic bed compensation via G32
                  ;
                  ; generated by RepRapFirmware Configuration Tool on Wed Oct 31 2018 12:24:34 GMT-0400 (Eastern Daylight Time)
                  M561 ; clear any bed transform
                  G28 ; home all axes
                  ; Probe the bed at 5 points
                  G30 P0 X15 Y15 H0 Z-99999
                  G30 P1 X15 Y220 H0 Z-99999
                  G30 P2 X220 Y220 H0 Z-99999
                  G30 P3 X220 Y15 H0 Z-99999
                  G30 P4 X117.5 Y117.5 H0 Z-99999 S

                  M374

                  or

                  M374 P"MyAlternateHeightMap.csv"

                  I've done either one of the M374 with the same issue.

                  Thanks

                  1 Reply Last reply Reply Quote 0
                  • esserr
                    esserr @Phaedrux last edited by

                    @phaedrux I updated to 1.22.4 and the issue still persists

                    1 Reply Last reply Reply Quote 0
                    • esserr
                      esserr last edited by

                      Also updated to firmware 2.02 with same issue...very strange

                      1 Reply Last reply Reply Quote 0
                      • dc42
                        dc42 administrators last edited by

                        The M374 command won't do anything useful there, because it's only mesh bed probing (G29) that generates a height map that can be saved to SD card. But putting M374 there shouldn't cause a disconnection.

                        Please post your config.g file so that I can try to replicate the issue.

                        1 Reply Last reply Reply Quote 0
                        • esserr
                          esserr last edited by

                          0_1541023774302_config.g

                          Oh I see, I guess what I am trying to do is save the height map once then reference it on startup so I do not have to probe every time because I have solid bed mounts and no z-probe at this time. I plan on adding the z-probe soon. Should I just run the G29 once and use the results instead of the 5 probe points generated from the configurator? Would I delete these G30 probe points from the bed.g file?

                          Thank you again

                          1 Reply Last reply Reply Quote 0
                          • dc42
                            dc42 administrators last edited by

                            Yes, use G29 instead. If 5-point probing was good enough for you before, then you should find a 3 x 3 mesh sufficient.

                            I'll try to replicate the problem tomorrow.

                            richardmckenna 1 Reply Last reply Reply Quote 1
                            • richardmckenna
                              richardmckenna @dc42 last edited by richardmckenna

                              @dc42 did you manage to replicate this. I now see this same error and no height map file being saved after upgrading. I'm using G29 in my bed file. and see it in both Chrome and Edge.

                              A JavaScript error has occurred so the web interface has closed the connection to your board. It is recommended to reload the web interface now. If this happens again, please contact the author and share this error message:
                              
                              Version: 1.22.4-b1
                              Message: JSON.parse Error: Invalid character at position:107
                              URL: http://10.0.0.10/js/dwc.js
                              Line: 1065:9
                              Error object: {}
                              

                              Software Information
                              Firmware Name: RepRapFirmware for Duet 2 WiFi/Ethernet
                              Firmware Electronics: Duet WiFi 1.0 or 1.01
                              Firmware Version: 2.02RC3(RTOS) (2018-10-17b2)
                              WiFi Server Version: 1.21
                              Web Interface Version: 1.22.4-b1

                              I've attached my bed.g and config.g.

                              Any thoughts?

                              1 Reply Last reply Reply Quote 0
                              • dc42
                                dc42 administrators last edited by dc42

                                I was unable to replicate it.

                                Please can you update DWC to the 1.22.4 release and check whether it still occurs. If it does, then it would be most helpful if you can get a Wireshark trace of the transaction that produces the error message. You can either save the trace and make the .pcap file available to me, or search for the faulty transaction. It will be an HTTP 200 OK response with the data type reported as JSON, but when you expand it, instead of displaying the JSON object it will offer "Line based text data". That's the data I need; so right click on it, select Copy, and then paste it into a post.

                                richardmckenna 2 Replies Last reply Reply Quote 0
                                • richardmckenna
                                  richardmckenna @dc42 last edited by

                                  @dc42 yes of course I will get that this evening.

                                  1 Reply Last reply Reply Quote 0
                                  • richardmckenna
                                    richardmckenna @dc42 last edited by

                                    @dc42 ok I'm getting this response first and then following that I get the disconnect response. I assume because it's not catching the error.

                                    GET /rr_reply HTTP/1.1
                                    Host: 10.0.0.10
                                    Connection: keep-alive
                                    Accept: text/html, */*; q=0.01
                                    X-Requested-With: XMLHttpRequest
                                    User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/70.0.3538.77 Safari/537.36
                                    Referer: http://10.0.0.10/
                                    Accept-Encoding: gzip, deflate
                                    Accept-Language: en-GB,en;q=0.9,es;q=0.8
                                    
                                    HTTP/1.1 200 OK
                                    Cache-Control: no-cache, no-store, must-revalidate
                                    Pragma: no-cache
                                    Expires: 0
                                    Access-Control-Allow-Origin: *
                                    Content-Type: text/plain
                                    Content-Length: 183
                                    Connection: close
                                    
                                    Bed equation fits points [15.0, 15.0, 0.547] [15.0, 180.0, 0.097] [170.0, 180.0, -0.255] [170.0, 15.0, 0.102] [80.0, 97.5, 0.102]
                                    Error: G29: Height map file heightmap.csv not found
                                    
                                    GET /rr_disconnect HTTP/1.1
                                    Host: 10.0.0.10
                                    Connection: keep-alive
                                    Accept: application/json, text/javascript, */*; q=0.01
                                    X-Requested-With: XMLHttpRequest
                                    User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/70.0.3538.77 Safari/537.36
                                    Referer: http://10.0.0.10/
                                    Accept-Encoding: gzip, deflate
                                    Accept-Language: en-GB,en;q=0.9,es;q=0.8
                                    
                                    HTTP/1.1 200 OK
                                    Cache-Control: no-cache, no-store, must-revalidate
                                    Pragma: no-cache
                                    Expires: 0
                                    Access-Control-Allow-Origin: *
                                    Content-Type: application/json
                                    Content-Length: 9
                                    Connection: close
                                    
                                    {"err":0}
                                    

                                    Is this because I am running G29 S1 instead of G29 S0? What should be used to probe the bed, save the file and activate bed compensation or if file exists load the file?

                                    This is what the configuration tool gave me.

                                    M561 ; clear any bed transform
                                    G28  ; home all axes
                                    ; Probe the bed at 5 points
                                    G30 P0 X15 Y15 H0 Z-99999
                                    G30 P1 X15 Y180 H0 Z-99999
                                    G30 P2 X170 Y180 H0 Z-99999
                                    G30 P3 X170 Y15 H0 Z-99999
                                    G30 P4 X80 Y97.5 H0 Z-99999 S
                                    
                                    G29 S1 ; Detailed Z-Probe. Load the height map from file and activate bed compensation.
                                    
                                    1 Reply Last reply Reply Quote 0
                                    • dc42
                                      dc42 administrators last edited by

                                      Those are not the responses that cause the error message from DWC.

                                      richardmckenna 1 Reply Last reply Reply Quote 0
                                      • richardmckenna
                                        richardmckenna @dc42 last edited by

                                        @dc42 The only calls I can see before that were to GET /rr_status?type=2 HTTP/1.1 and GET /rr_status?type=1 HTTP/1.1. Here is the network trace the printer is at 10.0.0.10 and the PC is at 10.0.0.187.

                                        My previous post is after I changed from DWC 1.22.4-b1 from your Git repo to 1.22.4 from Chris Hamm https://github.com/chrishamm/DuetWebControl. I was already running 1.22.4-b1 when you asked me to upgrade to 1.22.4 and Chris's version was the only one I could find that was specifically 1.22.4. So I don't know if there are any differences.

                                        So I tried some other stuff last night if I run "Perform automatic mesh compensation (G29)" from the drop down menu. It proceeds to probe the bed in 20mm grid completes, saves the heightmap.csv and displays it.

                                        If I then run Auto Bed Compensation it probes the bed at the 5 points defined in the map.g file then displays the height map.

                                        So to me that seems like if there isn't an existing heightmap.csv and G29 S1 is run, it throws the error on the GET /rr_reply call. Then immediately after that GET /rr_disconnect is called.

                                        Thanks

                                        1 Reply Last reply Reply Quote 0
                                        • dc42
                                          dc42 administrators last edited by

                                          Thanks for providing the network trace. I was expecting to see an invalid JSON response, but there isn't one. So I suspect it is a DWC issue, not a firmware issue. I have asked chrishamm to take a look.

                                          richardmckenna 1 Reply Last reply Reply Quote 0
                                          • richardmckenna
                                            richardmckenna @dc42 last edited by

                                            @dc42 thatโ€™s great thanks!

                                            1 Reply Last reply Reply Quote 0
                                            • chrishamm
                                              chrishamm administrators last edited by

                                              Thank you very much for the Wireshark dump, it makes things easier to diagnose.

                                              I tried out the same bed probing macro that you used and it worked without problems for me too, but once I copied the response from rr_reply and reran the corresponding parsing code I was able to figure out why it fails for you. Apparently DWC receives a multi-line string after the G32 call that it cannot deal with, so I need to work-around this.

                                              I'll come up with a fix soon. In the meantime I suggest you remove the G29 S1 call from your bed.g - in fact I don't quite understand why you use it at all. You can only use bed compensation -or- mesh compensation, but not both at the same time AFAIK.

                                              richardmckenna 1 Reply Last reply Reply Quote 1
                                              • richardmckenna
                                                richardmckenna @chrishamm last edited by

                                                @chrishamm cool thanks for looking at it.

                                                G29 S1 is in the bed.g file as the RepRap Configuration Tool put it there ๐Ÿ˜‰

                                                1 Reply Last reply Reply Quote 1
                                                • First post
                                                  Last post
                                                Unless otherwise noted, all forum content is licensed under CC-BY-SA