-
Notifications
You must be signed in to change notification settings - Fork 43
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
Is this code functional for anyone #10
Comments
Oops, the latest version is broken - I'll try to get a fix out with an update later today. If you want to give it a try now then the fix is replacing all occurences of |
I have been trying to get this compiled and working with a ESP32-WROVER-B. Had an issue with Ethernet and SDCard and may be related to FTP. Here is the issue. but now cannot get WIFI working. So I don't know if WEBUI is working and not sure if this is ready to go out of the box. |
The version I committed yesterday works for me: FTP is not started unless enabled with $70, 15 enables all protocols. @troth530 - what are your settings in CMakelists.txt? |
OK, success with the latest check-in from today 11/21/21. It compiled after fixing the board include file #ifdef VFD_SPINDLE statement(s). Basic machine stepping is working with ESPDUINO32 and protoner-style shield. |
@terjeio I need to build with SDcard hardware to verify FTP functionality works which I haven't done yet. In CMakelist.txt, I am using default for everything except Networking (line 18) and SDCard (line 21) set to ON. I am using ESP32-WROVER-B and WIFI is not broadcasting a SSID or working at all as far as I can tell. |
@troth530 Default wifi mode is station, you will have to enable access point (AP) mode to make it broadcast anything:
I have not tested this in a long time, hopefully it still works...
|
@terjeio [VER:1.1f.20211029:] |
@terjeio I think your code is different, for example $73 had 4 options for me, I pulled from your repo about 2 weeks ago using these commands. Thank you! $help wifi |
The
which is the same as you get. Did you reset the settings with I commited an update yesterday, if the one you have is not working please update to that. |
@terjeio, I stashed what I had, updated to the latest commit and it compiled with |
You get compilation errors?
Yes, since my_machine.h is disabled in CMakeLists.txt by default. |
@terjeio here is the error with FtpDaemon set ON (SDcard set ON). Compile error snippet |
@troth530 This compiler error makes no sense for me, no line number where it fails? |
@troth530 I believe I've found the reason, the networking plugin somehow was not updated yesterday. My local master were not pushed by the script I use, I have now done it manually. |
@terjeio I believe there is more missing. [56/57] Linking CXX executable grbl.elf |
@troth530 That helps, same issue here as with the iMXRT1062 - ffconf.h has to be edited and It is a pity that the FatFs source is not written in a way that allow setting configuration symbols like this in CMakeLists.txt, perhaps the author ChaN should be asked to change that? |
@terjeio correct. In fact on the Teensy I used your patched utility/sd_sdhc.c and had to #define FF_FS_PATH to 2. In addition to those items you had documented, for the Teensy I had to make several manual changes so the include statements would point to the correct location I'd placed the FatFS- maybe due to how I organized the files manually and my inexperience with GIT. On my computer there is also ffconf.h in the same location as yours in the ESP SDK and I made the change to FF_FS_PATH=2. Do you believe it is preferred to use the one in the SDK or FatFS by WMXZ-EU? However it still does not explain my issues with wifi not broadcasting, am I missing a manual step to turn wifi on for this device due to my inexperience? FTPDaemon=ON compile error seems a downstream artifact of wifi not working and possibly something different in my code versus your code. Confirming that I have used $RST=* and $73 is set to 2, I cannot set $70 to 15 (only can set o 7). I have confirmed same behavior of wifi not broadcasting with both ESP WROVER-B and WROOM. |
The SDK is used by the ESP32 driver, the WMXZ-EU by the iMXRT1062 driver - they cannot be swapped around as there is low level driver code added by the framework used by the drivers that is MCU specific.
Add your CMakelists.txt and your settings here, preferably as attachments, and I'll check. If you are on Windows and have ioSender installed use Help > About > To clipboard to get both |
@terjeio |
Settings looks ok, I have flashed with your settings and it works for me. Can you try with the binary I made? I have uploaded it as grblHAL ESP32 FTP.zip here. There is one snag likely due to the fact that I run the ESP32 "naked" (not inserted in a breakout board) - it crashes in a loop when I connect the SD card. I guess this is due to some missing pull-up resistors... When I run it when compiled for and inserted in my CNC Boosterpack board this does not happen. Here is the output to a terminal I get when I connect and run a short WebUI session, after I connected I issued a
|
@terjeio your bin file works great, I used ESP download tool to program. For now, I am running my development boards naked as well. With my bin file no Wifi, no SSID broadcast. I also tried fresh install on another computer using esp-idf-tools-setup-offline-2.12.exe Still no Wifi when I compile. |
@troth530 What is your IDF version? You can find it in components\esp_common\include\esp_idf_version.h I am using 4.2 and compiling with VSCode. |
@terjeio ESP IDF Version is 4.3.1. I did some looking around in WebUI with your build (the bin file you uploaded) and the machine does not respond to jog commands, commands at the User Interface or read back grbl settings. It does however show information in the ESP Status window as you've shown. Do you have instructions how to downgrade IDF version and install VSCode? Thank you. |
@troth530 Please wait a bit - I have rewritten the event handling to not use deprecated calls, I want you to try that first. I will complete that tomorrow. What is the status shown in the WebUI? Is it "IDLE"? If in "ALARM" state this could be the reason there is no reaction to jog commands. Check this wiki page for more. Here is the console output when I execute a jog: What do you get? |
@terjeio , I get no response in WebUI, I can see the $J input commands but no response from the ESP32. |
Port 81 for the websocket is blocked? Try connecting with ioSender to that. |
@troth530 In IDF versions after 4.2 Espressif have changed the returned wifi mode in a call that leads to AP mode not beeing set up: Lines 390 to 416 in 52f2d83
The test at line 416 fails due to this. Add |
@terjio I still cannot compile with FtpDaemon=ON here is the error, same as before may be an IDF compiler error.
Bluetooth=ON makes the device constantly reboot Connecting to HTTP 192.168.5.1:80 still has same behavior and jogging does not work in WebUI Thank you! |
See issue #8 - the latest commit has a workaround for this IDF/compiler issue.
I'll try this again - enabling Bluetooth on a "naked" board may trigger an ESP32 issue that has not been resolved. It has been reported by several people, including myself.
No, it is due to the websocket connection not established/not working. I you have a terminal window open when you start the WebUI do you get this message: Which browser are you using? Is compatible with the WebUI? |
@terjeio interesting. Slowing the speeds and accel way down seems to keep the Guru from showing himself, but does it make sense that the ESP32 can only spool gCode at half the speed of STM32? I am now getting around 1:11 via USB/UART and I observed better using websocket around 1:00. This is now in a practical range of operation for some machines but not all. Basically limited to 200mm/sec, with accel approximately 2000mm/s/s. I did observe that it was sensitive to acceleration, so I changed the M4 to M3 to see if it helped and it did, but that may imply a processing issue, not a communications issue. |
Over a USB connection yes it does, ESP32 has an USB <> UART chip in between the USB port and the MCU so the configured baud rate is real, with the USB stack in the MCU there is no such bottleneck and the baud rate setting usually has no meaning. I have seen transfer rates > 150Kbytes/s with iMXRT1062, ESP32 is limited to 115Kbits/s (which is ~11Kbytes/s) as it is configured now. The baud rate setting can be increased for ESP32 here if you want to try that: Line 1681 in 31e0781
Hopefully the workaround I made will fix that - I will commit that later as it required changes to the core. |
Unfortunately, increasing Baud shows no benefit tried 460800 and no benefit.
Looking forward to that. For the control pins- reset_pin, feed_hold_pin and cycle_start_pin, are external pullups required? For some reason reset pin does not perform control reset when pulled low (so I used the reset pin on the ESP32) but it's behavior is a full controller restart. feed_hold works, but then cycle_start does not restart execution of the gCode. To complicate matters I should mention that on the WROVER device I am using, GPIO36 and 39 are senseVP and senseVN. Thank you! |
I halved the time to transfer data in Check mode when I went to 230400, to 460800 showed no improvement over 230400. The workaround is now committet alongside a lot of other changes that I hope does not break anything. These are a using new core based stream switcher (from UART to Websocket to SD Card etc. and back), support for ganged/auto squared axes, Trinamic stepper driver support++
IMO yes. Relying on the weak internal pullups is inviting problems. More current through the switches are generally better, at least above the wetting current. A capacitor across the switch may help increasing the wetting current too. I see some using optocouplers adding the capacitor on the transistor side of the optocoupler for noise filtering, better to have it accross the switch as most optocouplers act as a low-pass filter anyway.
Does the LED indicators change in ioSender depending on the switch state?
I'll have to check this as I do not know what senseVP and senseVN is for. |
@terjeio Control pins are working as expected, some minor errors on my end. senseVP and senseVN work fine as inputs only (limits switches) Latest build I am unable to compile with FTP turned on. But I don't need it, was just trying to help provide cross-feature feedback for you. As I have expanded testing to hardware, I find that using 3 axes works fine, if I set N_AXES to 4 in config.h not only does the A axis not work, but it disables the Z axis (or I should say the Z axis no longer moves). Commands like G0A10 are accepted but do not enable the step enable, direction or step pins on A axis and Z axis has same behavior. The pins assigned to A axis, can be swapped over to the Z axis with N_AXES set to 3, so it appears the hardware is not at fault. It seems like it could be a copy paste error in the driver??? Thank you! |
I have fixed a mistake introduced when I added support for ganged/auto squared axes - I only tested auto squaring so I missed it. Up now. FTP compiles for me but is a bit unstable at times. To be investigated. FYI I got bitten by what is likely silicone bug when I switched to my CNC Boosterpack test jig with limit and control inputs open - I got a hard limit alarm with wifi enabled and hard limits disabled. It is due to a spuroius interrupt intermittently generated by the radio. The workaround suggested by Espressif does not help.
Which board map are you using then? Your own? |
@terjeio, I am using my own board map to get 4 axes, cutting probe and flood to get step and direction pins for A axis. I tried FTP again and it now compiles, and I don't know why it was not compiling before. Now testing bluetooth and it shows this error I will try your latest updates and verify if bluetooth compile error remains. |
@terjeio , the latest build (Dec20) does not move any motors, even with 3 axes. |
$4=15? or 7 with 3 axes configured.
It compiles for me, but suddenly started to send the welcome message repeatedly. ESP32 can drive you crazy... |
@terjeio definitely was using $4=15, by #define INVERT_ST_ENABLE_MASK AXES_BITMASK in config.h. None of the motors move, but the controller believes they have moved, I will hook up a scope tomorrow to see if the issue is enable pin or step/dir pins not getting signals On Dec03 build the Bluetooth compile error is: Much of the behavior I see with ESP32 makes no sense, and above expected even for a new device. aIssues not always repeatable. It's a very moody device. |
Post your map file. Do you enable bluetooth and wifi at the same time? - asking since the error is for not enough DRAM (overflowed by 30360 bytes). I have tested bluetooth with all the board maps that can be run "naked" - and I can connect to all. My CNC Boosterpack map causes spurious interrupts triggering reset and may reenter main() repeatedly without the Guru reporting anything at all. And no joy connecting via bluetooth. To be investigated further... This issue is revealing that the Guru may in fact be a Demon? |
Pin 36 and 39 fire regular interrupts at roughly 500ms interval when bluetooth is enabled. I use those for feed hold and cycle start. This comment sums it up? A settings reset cured the bluetooth connect problem with my CNC Boosterpack, my bad not doing that earlier. This with feed hold and cycle start pins remapped (not using pin 36 and 39). |
@terjeio yes, I see there are lots of problems, CPUs like ESP32 make you perform a lot of magic tricks that otherwise should not be required. Is there any way to be able to use Bluetooth with Networking enabled? I think the DevKits are limited to 4Mb, but it looks like I need 8Mb which will mean I need to make my own DevKit using a 8Mb WROVER module. Can it be done with a change to the partition table for the 8Mb WROVER module? Thank you! |
I do not know, if you search for that some says it can be done some not. When I compile with both enabled the ESP32 reboots itself endlessly with no reason given - the Guru beeing fast asleep. Maybe not enough RAM, not detected/reported by the linker?
There is plenty of flash available, your issue is abour RAM so no. When I check RAM with the WebUI interface I have 100K free, how much do you have? |
@terjeio I will see what can be done to resolve the compilation error with both Bluetooth and Networking, but in the end, I may run into the same issue with the ESP32 that you have observed. As a general grblHal question, I have observed that Z and A axes seem to be negative axes. By that I mean that with soft limits enabled after homing jogging is only allowed in negative direction (attempts to jog in + result in soft limit error). Is there a simple $ setting to adjust? Thank you! |
Yes, use
|
@terjeio I now have dedicated hardware and my latest testing shows disconnect from wifi through windows 10 and windows 7 Network settings will panic the core and cause the guru to meditate. Have you observed clean wifi disconnects. I hesitate to post this since my build is a little behind your latest commits. Still trying to get Bluetooth and WiFi working together and checking for why Z and A (non-homed axes are effectively negative) with $22=9, I have been using $22=11. |
I do not use a ESP32 based controller myself, and it is not my goto platform for development as it is painfully slow to work with due to the snowflake guru and the lack of a debugger. So no I have not seen any.
Please update then.
Not sure what you mean by this. All axes are set to machine position 0 on a cold start regardless of their physical position. After homing the homed axes are changed to 0 or -(max travel - pulloff distance) depending on the configuration. |
@terjeio To clarify- when I connect to the AP I can open and close the Webgui properly, but disconnecting from the AP through windows Network Settings makes the Guru rear its ugly head (both on Win 7 and Win10). I would suspect that even moving out of wifi range while connected would also cause the crash. I will also check Android. Disregard the homing issue, with the latest build it behaves properly. Thank you! |
@terjeio crash reports Android when disconnecting from AP Windows 7 [MSG:WIFI AP CONNECTED] |
…red code in the core. Another fix for #10.
@troth530 - another commit is just up. Issue was likely due a regression caused by consolidationg stream handling in the core. |
@terjeio The latest commit does in fact fix the crash during AP disconnect, but gCode that previously could run in about 60 seconds now takes over 14:20. The last time I tested the speed may have been around Dec 20,2021 before you fixed the 4th axis issue. Thank you! |
Change this line to: that should improve speed a bit. However, I cannot get this driver to to achieve transfer speeds that others can. E.g. the iMXRT1062 driver tops out at over 600Kbytes/s in check mode over a websocket connection and is rock solid. It runs "bare metal" though - no RTOS. The MSP432E401Y driver runs as a FreeRTOS task and manages 75Kbytes/s - again rock solid. The ESP32 manages a whopping 38Kbytes/s if it does not mess up the data stream, which it does regularly for some reason my aging brain cannot understand. Maybe somebody else can figure out what I am doing wrong? For a fair comparison the MSP432E401Y has a single core 120MHz M4 processor, the ESP32 a dual core 240 MHz processor. Here are the relevant ioSender settings I have used when tesing: And the websocket code pre a refactoring I did late december: I have renamed the file and some functions so it can be used with the current codebase. |
@troth530 Increasing the task priority caused the watchdog to start barking out a stack trace at irregular intervals without crashing the MCU. I then found out that the FreeRTOS scheduler was running at a tick rate of only 100Hz. So I gave it another go by increasing the tick rate to 1KHz and once again trying to figure out why this MCU is so slow and unstable when it comes to network traffic. By adding a critical section around some code in the telnet and websocket daemons I could increase the polling frequency and bingo now it seems to be stable and a bit faster to boot! It now manages a transfer rate of about 84 Kbytes/s - not super impressive but tolerable? I have just committed the changes and I hope this is the end of this saga. |
Hi @terjeio, yes booting is very much faster and you did improve the speed from 14:20 to 6:20 for the same Gcode I uploaded greyscale_raster_test_500.nc . With the latest code, with no motors it runs in 6:20 with speed and accel turned very high. In Check Mode it runs in 0:50. The behavior is also much more stable. Is it possible that the issue is something as simple as the spindle spinning up? Anyway hoping I am giving you enough hints to help you sort this out and hopefully not confusing you. |
Another regression from a requested change... Add
For me it runs in 0:08 after the latest changes, a bit strange that you get 0:50. A sender issue? And you may have to tune the planner buffer size to get high engraving speeds. Some have set this as high as 1000+ for the iMXRT1062 driver but I doubt the ESP32 is able to handle that. Start with 200 - 300? |
@terjeio that was the correct fix. Prior to the fix it worked in Check Mode in 0:50, now 0:08 and impressive times with other senders at high velocity and accel. Yes, I'm very aware of the tuning needed and it was that fix you posted. If you would like someone to test your future releases with hardware, I can give you my email. Impressive work. Thank you! |
Honest question before I waste more hours debugging endless guru meditations.
Does this code work for anyone ? If so what hardware are you using ?
Thanks !
The text was updated successfully, but these errors were encountered: