Duet3D Logo Duet3D
    • Tags
    • Documentation
    • Order
    • Register
    • Login

    3.2 JSON Parse error: Unrecognized token '<' Password bug

    Scheduled Pinned Locked Moved
    Beta Firmware
    8
    58
    3.8k
    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.
    • Charlieundefined
      Charlie
      last edited by

      M122:

      === Diagnostics ===
      RepRapFirmware for Duet 2 WiFi/Ethernet version 3.2 running on Duet WiFi 1.02 or later
      Board ID: 08DGM-917DA-G4MS8-6J1DD-3S46R-1STHB
      Used output buffers: 3 of 24 (11 max)
      === RTOS ===
      Static ram: 23460
      Dynamic ram: 74108 of which 40 recycled
      Never used RAM 14472, free system stack 180 words
      Tasks: NETWORK(ready,162) HEAT(blocked,295) MAIN(running,448) IDLE(ready,19)
      Owned mutexes: WiFi(NETWORK)
      === Platform ===
      Last reset 00:06:49 ago, cause: power up
      Last software reset at 2021-01-06 23:23, reason: User, GCodes spinning, available RAM 14472, slot 1
      Software reset code 0x0003 HFSR 0x00000000 CFSR 0x00000000 ICSR 0x0041f000 BFAR 0xe000ed38 SP 0x00000000 Task MAIN Freestk 0 n/a
      Error status: 0x00
      Aux0 errors 0,0,0
      MCU temperature: min 16.0, current 19.8, max 20.7
      Supply voltage: min 24.0, current 24.2, max 24.5, under voltage events: 0, over voltage events: 0, power good: yes
      Driver 0: position 0, standstill, SG min/max not available
      Driver 1: position 0, standstill, SG min/max not available
      Driver 2: position 0, standstill, SG min/max not available
      Driver 3: position 0, standstill, SG min/max not available
      Driver 4: position 0, standstill, SG min/max not available
      Driver 5: position 0
      Driver 6: position 0
      Driver 7: position 0
      Driver 8: position 0
      Driver 9: position 0
      Driver 10: position 0
      Driver 11: position 0
      Date/time: 2021-01-07 13:19:54
      Cache data hit count 498401202
      Slowest loop: 8.01ms; fastest: 0.21ms
      I2C nak errors 0, send timeouts 0, receive timeouts 0, finishTimeouts 0, resets 0
      === Storage ===
      Free file entries: 10
      SD card 0 detected, interface speed: 20.0MBytes/sec
      SD card longest read time 5.6ms, write time 0.0ms, max retries 0
      === Move ===
      DMs created 83, maxWait 0ms, bed compensation in use: none, comp offset 0.000
      === MainDDARing ===
      Scheduled moves 0, completed moves 0, hiccups 0, stepErrors 0, LaErrors 0, Underruns [0, 0, 0], CDDA state -1
      === AuxDDARing ===
      Scheduled moves 0, completed moves 0, hiccups 0, stepErrors 0, LaErrors 0, Underruns [0, 0, 0], CDDA state -1
      === Heat ===
      Bed heaters = 0 -1 -1 -1, chamberHeaters = -1 -1 -1 -1
      Heater 1 is on, I-accum = 0.0
      === GCodes ===
      Segments left: 0
      Movement lock held by null
      HTTP is idle in state(s) 0
      Telnet is idle in state(s) 0
      File is idle in state(s) 0
      USB is idle in state(s) 0
      Aux is idle in state(s) 0
      Trigger is idle in state(s) 0
      Queue is idle in state(s) 0
      LCD is idle in state(s) 0
      Daemon is idle in state(s) 0
      Autopause is idle in state(s) 0
      Code queue is empty.
      === Network ===
      Slowest loop: 16.82ms; fastest: 0.00ms
      Responder states: HTTP(0) HTTP(0) HTTP(0) HTTP(0) FTP(0) Telnet(0), 0 sessions
      HTTP sessions: 1 of 8
      - WiFi -
      Network state is active
      WiFi module is connected to access point 
      Failed messages: pending 0, notready 0, noresp 0
      WiFi firmware version 1.25
      WiFi MAC address ec:fa:bc:2d:dd:0f
      WiFi Vcc 3.39, reset reason Turned on by main processor
      WiFi flash size 4194304, free heap 27136
      WiFi IP address 192.168.1.44
      WiFi signal strength -71dBm, mode 802.11n, reconnections 0, sleep mode modem
      Clock register 00002002
      Socket states: 0 0 0 0 0 0 0 0
      === Filament sensors ===
      Extruder 0: pos 0.00, errs: frame 0 parity 0 ovrun 0 pol 0 ovdue 0
      
      1 Reply Last reply Reply Quote 0
      • Phaedruxundefined
        Phaedrux Moderator
        last edited by Phaedrux

        In the General tab of DWC do you have Save settings in local storage and Save cache in local storage checked or unchecked? Either way can you try toggling that?

        Also, your wifi signal strength is pretty borderline.

        WiFi signal strength -71dBm

        Is the printer far from the router?

        Z-Bot CoreXY Build | Thingiverse Profile

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

          @Phaedrux

          Save settings in local storage: Unchecked.
          Save cache in local storage: Checked.

          Screen Shot 2021-01-07 at 2.07.12 PM.png

          Ill try toggling both and see if there is any change.

          Yeah, its pretty far from the router, though Ive never had any issues before using 1.21, 2.0.3, or 3.1.1 (even when it was in a steel case, lol).

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

            @Charlie Also try with both off and both on.

            I'm just poking in the dark here. I'm not certain it's related.

            Z-Bot CoreXY Build | Thingiverse Profile

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

              @Phaedrux

              Definitely will do. Your guesses are way more educated than mine, so I greatly appreciate it. Ill let you know the results.

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

                My theory is that it's trying to save the cache or settings on the SD card and the weak wifi signal is causing issues.

                I'm not sure which storage the "local storage" is referring to. It's a bit ambiguous and I never got clarification last time it came up. It's either the SD card as in local to the machine, or the browser side, as in local to the viewer.

                @chrishamm will know for sure, but he's probably sleeping like a baby at the moment. 😉

                Z-Bot CoreXY Build | Thingiverse Profile

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

                  @Phaedrux

                  Unfortunately all four configurations (emptying browser cache each time) still had the same error come up.

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

                    My last suggestion is to manually replace the contents of the /www folder with a fresh set from https://github.com/Duet3D/RepRapFirmware/releases/download/3.2/DuetWebControl-SD.zip

                    And if that doesn't work, try a fresh SD card.

                    And if that doesn't work, wait for chrishamm

                    Z-Bot CoreXY Build | Thingiverse Profile

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

                      @Phaedrux

                      Unfortunately manually replacing the www folder did not change anything, and neither did a new SD card. Thank you for your input though!

                      1 Reply Last reply Reply Quote 0
                      • Charlieundefined
                        Charlie @chrishamm
                        last edited by

                        @chrishamm

                        If you have any insight, I would greatly appreciate it.

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

                          @Charlie Some response doesn't seem right, no valid JSON should start with '<' so you're getting an error. Try to open the developer console with F12 and check the log for further details. You should be able to see an error trace in there.

                          What browser are you using? Can you open DWC from a different device?

                          Duet software engineer

                          Charlieundefined 1 Reply Last reply Reply Quote 0
                          • Charlieundefined
                            Charlie @chrishamm
                            last edited by

                            @chrishamm

                            Thank you for your response.

                            I opened the developer console in Safari (Develop > Show Web Inspector > Console). I found the following errors and warnings:

                            Screen Shot 2021-01-08 at 12.58.28 PM.png

                            Im currently using Safari.

                            1 Reply Last reply Reply Quote 0
                            • Charlieundefined
                              Charlie
                              last edited by

                              The first error does not seem to be the cause of the issue, and was resolved by inserting a blank "dwc-plugins.json" file in the sys/ folder using DWC.

                              The subsequent errors seem to be the cause of the issue. Ive diffchecked both the "pollconnector.js" and the "BaseConnector.js" files against the files in GitHub and they appear to be identical. Im pretty out of my depth when it comes to coding, so any help would be greatly appreciated.

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

                                Can you test with Chrome just to see if it's isolated to safari on your machine? What MacOS and Safari version are you running?

                                Z-Bot CoreXY Build | Thingiverse Profile

                                Charlieundefined 2 Replies Last reply Reply Quote 0
                                • Sindariusundefined
                                  Sindarius
                                  last edited by

                                  The 401 error would mean the < you are getting is because it's sending an HTML 401 error page response.

                                  What happens if you take out the M551 in your config? Maybe there is an issue going on with passwords?

                                  1 Reply Last reply Reply Quote 1
                                  • Charlieundefined
                                    Charlie @Phaedrux
                                    last edited by

                                    @Phaedrux

                                    I will try to see if I can replicate the issue on Chrome, though its difficult to reliably replicate the issue. I am using macOS Big Sur 11.1 and Safari 14.0.2 (most up to date I believe).

                                    1 Reply Last reply Reply Quote 0
                                    • alankilianundefined
                                      alankilian
                                      last edited by alankilian

                                      (I'm NOT a JavaScript guy, so....))

                                      It looks like the code is trying to parse a JSON tesponse, but the response is not JSON, it's text.

                                      I notice in PollConnector.js this code:

                                      				if (xhr.status >= 200 && xhr.status < 300) {
                                      					if (responseType === 'json') {
                                      						try {
                                      							if (!xhr.responseText) {
                                      								resolve(null);
                                      							} else {
                                      								resolve(JSON.parse(xhr.responseText));
                                      							}
                                      						} catch (e) {
                                      							reject(e);
                                      						}
                                      					} else {
                                      						resolve(xhr.response);
                                      					}
                                      

                                      But in BaseConnector.js I see this code:

                                      				if (xhr.status >= 200 && xhr.status < 300) {
                                      					try {
                                      						if (!xhr.responseText) {
                                      							resolve(null);
                                      						} else {
                                      							resolve(JSON.parse(xhr.responseText));
                                      						}
                                      					} catch (e) {
                                      						reject(e);
                                      					}
                                      

                                      Maybe if you use the code from PollConnector.js in BaseConnector.js you'll fix the issue.

                                      SeemeCNC Rostock Max V3 converted to V3.2 with a Duet2 Ethernet Firmware 3.2 and SE300

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

                                        @Phaedrux

                                        It appears as though this is NOT occurring in Chrome, though Ive been having issues replicating the error recently.

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

                                          Wouldn't be the first time Safari has behaved oddly.

                                          Z-Bot CoreXY Build | Thingiverse Profile

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

                                            @Phaedrux

                                            Hahaha! Very true.

                                            I am testing out the solution by @Sindarius and I will report back the results.

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