ESP32/S2/S3 LinuxCNC Controller (6 axis hardware step gen), USB plug-and-play

More
2 years 13 hours ago - 2 years 13 hours ago #313587 by michaeln
@tommylight
i had the same way and problems.

It is a pity that wez apparently no longer works on this project and finish it. But he made a good job. Thanks to him.
Hal2UDP is plug and play.
But this is not so easy to get it working.
For me first i need a lot of time to see what is future and what is working with this code.

Please have a look to the for from SybexX: github.com/SybexX/ESP32_LinuxCNC_MotionController_RealTime
He fixed the Linux compile errors and added the ESP32_WROOM_DEV board.

What is not working for me, is it the configuration for the spi-ethernet. First i want to change the configuration for the Hal2UDP wiring, but it is not working and seems there is a bug. You have to change the wiring to the default and it should work.
Last edit: 2 years 13 hours ago by michaeln.

Please Log in or Create an account to join the conversation.

More
2 years 12 hours ago #313591 by tommylight
If you get an error compiling the LinuxCNC component, rename the containing folder and remove empty spaces in the name.
You will also get an error when compiling for ESP as there is something with 2 letters in upper case but the other file has it in lower case, forgot what file and where.
Use serial monitor and
github.com/SybexX/ESP32_LinuxCNC_MotionC...in/SerialCommands.md
to check what pins are in use for W5500 as in most config files one pin is 5 while on esp32 it shows as 0, so had to rewire that.

Please Log in or Create an account to join the conversation.

More
2 years 11 hours ago - 2 years 11 hours ago #313596 by michaeln
Does the spiethconfig work for anybody?
I tested a lot, but i don't find the problem.
I insert printf commands in the code and get strange outputs. I change from picocom to putty, the same.

The command in short and long version:
spiethconfig -s 19 -i 23 -c 18 -e 0 -t 4
spiethconfig --miso 19 --mosi 23 --sck 18 --csenable 0 --interrupt 4
The output:
Invalid or missing Chip Select pin (0>128)
Command returned non-zero error code: 0x1 (ERROR)

I insert some printf-commands ( bold my changes):
            printf("argc: %d\r\n", argc);     

          
  if (result.count("s")) { miso_pin = result["s"].as<int>;(); }
            printf("MISO pin: %d \r\n", miso_pin);
            if (miso_pin < 0 || miso_pin > 128 ) { printf_P(PSTR("Invalid or missing MISO pin (0>128)\n")); return EXIT_FAILURE;}
            
            if (result.count("i")) { mosi_pin = result["i"].as<int>;(); }
            printf("MOSI pin: %d \r\n", mosi_pin);
            if (mosi_pin < 0 || mosi_pin > 128 ) { printf_P(PSTR("Invalid or missing MOSI pin (0>128)\n")); return EXIT_FAILURE;}

            if (result.count("c")) { sck_pin = result["c"].as<int>;(); }
            printf("SCK pin: %d \r\n", sck_pin);
            if (sck_pin < 0 || sck_pin > 128 ) { printf_P(PSTR("Invalid or missing SCK pin (0>128)\n")); return EXIT_FAILURE;}

            if (result.count("e")) { cs_pin = result["e"].as<int>;(); }
            printf("CS pin: %d \r\n", cs_pin);
            if (cs_pin < 0 || cs_pin > 128 ) { printf_P(PSTR("Invalid or missing Chip Select pin (0>128)\n")); return EXIT_FAILURE;}

            if (result.count("t")) { int_pin = result["t"].as<int>;(); }
            printf("INT pin: %d \r\n", int_pin);
            if (int_pin < 0 || int_pin > 128 ) { printf_P(PSTR("Invalid or missing Interrupt pin (0>128)\n")); return EXIT_FAILURE;}

and get the result:
argc: 7
MISO pin: 19
MOSI pin: 23
SCK pin: 18
CS pin: 255
Invalid or missing Chip Select pin (0>128)
Command returned non-zero error code: 0x1 (ERROR)

After that i change the sequence of the variables, the problems stay at the forth position. i saw that the out from argc stay at maximum 7 (in my opinion it should be 11).

Does it work for anybody?
If yes, what does is made wrong?

Thanks and best regards
michaeln
Last edit: 2 years 11 hours ago by michaeln.

Please Log in or Create an account to join the conversation.

More
1 year 11 months ago #315506 by tommylight
Had the same issue, so it was easier to resolder the pins, but still did not work.
Had no time to test anymore, it is sitting on my desk here for quite some time, but i think i might give it a go these days.
Did you get any further?

Please Log in or Create an account to join the conversation.

More
1 year 11 months ago - 1 year 11 months ago #315541 by Mecanix
Last edit: 1 year 11 months ago by Mecanix.

Please Log in or Create an account to join the conversation.

More
1 year 11 months ago #315542 by Mecanix

Had the same issue, so it was easier to resolder the pins, but still did not work.
Had no time to test anymore, it is sitting on my desk here for quite some time, but i think i might give it a go these days.
 
Doubt this will be reliable, Tommy. Sure, prolly be spinning a motor on the benchtop and comm for 10~20min but most likely be failing more often than not. E.g. zero timing critical pthread/mutex//locks/semaphores/gives/takes nothing at all. Could get away without it in a parallel compute domain but in this case, it's all serialized runtime (locks/integrity mandatory).

Wouldn't be surprised this is the reason Wez abandoned the extra efforts that it needed. 
The following user(s) said Thank You: tommylight

Please Log in or Create an account to join the conversation.

Time to create page: 0.092 seconds
Powered by Kunena Forum