Closed Tiktiki closed 1 year ago
Linked to commit 39aa72ff0e74879dfeb7ab51a535e0fcf06e39dc on grblHAL/Plugin_networking 10 hours ago...
Bummer - code seemingly last updated in 2003 has dependencies on code from 2017. How could that be...
Fix committed. Will add instructions on how to update lwIP when WebUI support for this driver is added.
Seems like a normal git clone off the https://git.savannah.nongnu.org/git/lwip.git repo (master) includes the files. I wonder if the repo that is currently pointed to has been modified (deleted files) somehow... even if it does not show in history.
Seems like a normal git clone off the https://git.savannah.nongnu.org/git/lwip.git repo (master) includes the files.
I have tried that - it did not work "out-of-the-box" so I ditched that attempt. Copying altpc.h to the original library, adjusting some code, and modifying lwipopts.h did - and WebUI can now be fired up:
Is this of interest? It is early days so more testing and tuning needs to be done...
That would be a great addition. Is it limited to ESP32 family or does it run on any network-enabled controller (running grblHAL)
I have the new code running on a STM32F756 and the iMXRT1062 (Teensy4.1), I have not yet tested with the other non ESP32 network capable controllers. The ESP32 driver uses the ESP32 http daemon - the new code a daemon based on the lwIP supllied code.
Hi @terjeio I am unable to compile without a single change in source. See the log:
#################################################################
Executing task in folder grblHAL_Teensy4: platformio run <
Verbose mode can be enabled via -v, --verbose
option
CONFIGURATION: https://docs.platformio.org/page/boards/teensy/teensy41.html
PLATFORM: Teensy (4.13.1) > Teensy 4.1
HARDWARE: IMXRT1062 600MHz, 512KB RAM, 7.75MB Flash
DEBUG: Current (jlink) External (jlink)
PACKAGES:
Environment Status Duration
teensy41 FAILED 00:00:03.772 ========================= 1 failed, 0 succeeded in 00:00:03.772 ========================= The terminal process "platformio 'run'" terminated with exit code: 1.
Terminal will be reused by tasks, press any key to close it. ##################################################
Any clues to find lwip/altcp.h ? Further, it doesn't seem to be a directory named lwip anywhere in source tree. Please help.
Regards, Ravi
@karoria I see now that when networking and SD card is enabled in my_machine.h the http daemon get enabled as well - uncommenting this line helps?
With networking enabled you have to install the lwip library, and to enable the httpd dameon you have to patch it, see this link for how to install it for the Arduino IDE - the code has to be copied inside the grblHAL source to make it compile with PIO?
The patch for the lwip library (adds lwip/altcp.h and modifies some configurations) - info here.
I'll disable the http daemon in the next commit (unless the webui plugin is enabled)).
Hi @terjeio I am unable to compile without a single change in source. See the log:
#################################################################
Executing task in folder grblHAL_Teensy4: platformio run <
Processing teensy41 (board: teensy41; platform: teensy; framework: arduino)
Verbose mode can be enabled via
-v, --verbose
option CONFIGURATION: https://docs.platformio.org/page/boards/teensy/teensy41.html PLATFORM: Teensy (4.13.1) > Teensy 4.1 HARDWARE: IMXRT1062 600MHz, 512KB RAM, 7.75MB Flash DEBUG: Current (jlink) External (jlink) PACKAGES:
- framework-arduinoteensy 1.154.0 (1.54)
- tool-teensy 1.154.210805 (1.54)
- toolchain-gccarmnoneeabi 1.50401.190816 (5.4.1) LDF: Library Dependency Finder -> http://bit.ly/configure-pio-ldf LDF Modes: Finder ~ chain, Compatibility ~ soft Found 95 compatible libraries Scanning dependencies... Dependency Graph |-- 1.1.2+sha.52b0ae3 | |-- 1.0.0+sha.5a2e6f4 | | |--
0.1 |-- 1.0.0+sha.5a2e6f4 | |-- 0.1 |-- 2.0.2+sha.58c266f Building in release mode Compiling .pio/build/teensy41/src/bluetooth/hc_05.c.o Compiling .pio/build/teensy41/src/driver.c.o Compiling .pio/build/teensy41/src/eeprom/eeprom_24AAxxx.c.o Compiling .pio/build/teensy41/src/eeprom/eeprom_24LC16B.c.o In file included from src/driver.c:87:0: src/grbl/motor_pins.h:692:13: warning: 'motor_iterator' defined but not used [-Wunused-function] static void motor_iterator (motor_iterator_callback_ptr callback) ^ Compiling .pio/build/teensy41/src/encoder/encoder.c.o Compiling .pio/build/teensy41/src/enet.c.o Compiling .pio/build/teensy41/src/fans/fans.c.o In file included from src/networking/networking.h:82:0, from src/enet.c:39: src/networking/httpd.h:49:24: fatal error: lwip/altcp.h: No such file or directory compilation terminated. *** [.pio/build/teensy41/src/enet.c.o] Error 1 =============================== [FAILED] Took 3.77 seconds =============================== Environment Status Duration
teensy41 FAILED 00:00:03.772 ========================= 1 failed, 0 succeeded in 00:00:03.772 ========================= The terminal process "platformio 'run'" terminated with exit code: 1.
Terminal will be reused by tasks, press any key to close it. ##################################################
Any clues to find lwip/altcp.h ? Further, it doesn't seem to be a directory named lwip anywhere in source tree. Please help.
Regards, Ravi
Also, there is a problem with the version 4.13 of the Platform module. Force it to use version 4.12 or you will have errors anyways.
Many thanks for quick reply @terjeio @Tiktiki I will follow your suggestions and do it today.
@karoria I see now that when networking and SD card is enabled in my_machine.h the http daemon get enabled as well - uncommenting this line helps?
With networking enabled you have to install the lwip library, and to enable the httpd dameon you have to patch it, see this link for how to install it for the Arduino IDE - the code has to be copied inside the grblHAL source to make it compile with PIO?
The patch for the lwip library (adds lwip/altcp.h and modifies some configurations) - info here.
I'll disable the http daemon in the next commit (unless the webui plugin is enabled)).
No success till now.
Here is the issue and fix for the platform version:
Thanks @Tiktiki for being so fast. Trying that now.
I do not have PIO installed so I do not know where to copy the lwIP library or how to set it up for compilation. In the Arduino IDE it is imported via a menu selection and lives outside the grblHAL source code, can PIO do it in a similar way?
Here is my Arduino library folder structure with the lwIP library marked:
@Tiktiki, installed 4.12 but no luck. Last lines of terminal are as below:
src/networking/httpd.c:255:2: error: #error HTTP v0.9 support has been removed!
^ src/networking/httpd.c: In function 'get_http_content_length': src/networking/httpd.c:923:58: error: 'cont_len' undeclared (first use in this function) hs->response_hdr.string[hs->response_hdr.next] = cont_len; ^ src/networking/httpd.c:923:58: note: each undeclared identifier is reported only once for each function it appears in src/networking/httpd.c: At top level: src/networking/httpd.c:340:20: warning: 'conn_close' defined but not used [-Wunused-variable] static const char conn_close = "Connection: Close" CRLF CRLF; ^ src/networking/httpd.c:342:20: warning: 'conn_keep2' defined but not used [-Wunused-variable] static const char conn_keep2 = "Connection: keep-alive" CRLF "Content-Length: "; ^ *** [.pio/build/teensy41/src/networking/httpd.c.o] Error 1 ===================== [FAILED] Took 240.39 seconds =====================
Environment Status Duration
teensy41 FAILED 00:04:00.394 ================= 1 failed, 0 succeeded in 00:04:00.394 ================= The terminal process "platformio 'run'" terminated with exit code: 1.
Terminal will be reused by tasks, press any key to close it.
src/networking/httpd.c:255:2: error: #error HTTP v0.9 support has been removed!
Getting closer now, have you replaced lwipopts.h in the lwIP library folder with the one from the patch? Or are PIO messing up?
I do not have PIO installed so I do not know where to copy the lwIP library or how to set it up for compilation. In the Arduino IDE it is imported via a menu selection and lives outside the grblHAL source code, can PIO do it in a similar way?
Here is my Arduino library folder structure with the lwIP library marked:
Getting really closer:
Executing task in folder grblHAL_Teensy4: platformio run <
Verbose mode can be enabled via -v, --verbose
option
CONFIGURATION: https://docs.platformio.org/page/boards/teensy/teensy41.html
PLATFORM: Teensy (4.12.0) > Teensy 4.1
HARDWARE: IMXRT1062 600MHz, 512KB RAM, 7.75MB Flash
DEBUG: Current (jlink) External (jlink)
PACKAGES:
ftpd_init': /Users/karoria/Documents/GitHub/iMXRT1062/grblHAL_Teensy4/src/networking/libraries/lwip-ftpd-sd/src/lwip_ftpd-sd.cpp:1317: multiple definition of
ftpd_init'
.pio/build/teensy41/src/networking/ftpd.c.o:/Users/karoria/Documents/GitHub/iMXRT1062/grblHAL_Teensy4/src/networking/ftpd.c:1248: first defined here
/Users/karoria/.platformio/packages/toolchain-gccarmnoneeabi/bin/../lib/gcc/arm-none-eabi/5.4.1/../../../../arm-none-eabi/bin/ld: Disabling relaxation: it will not work with multiple definitions
.pio/build/teensy41/src/networking/src/apps/httpd/fs.c.o: In function fs_open': /Users/karoria/Documents/GitHub/iMXRT1062/grblHAL_Teensy4/src/networking/src/apps/httpd/fs.c:66: multiple definition of
fs_open'
.pio/build/teensy41/src/networking/fs.c.o:/Users/karoria/Documents/GitHub/iMXRT1062/grblHAL_Teensy4/src/networking/fs.c:136: first defined here
.pio/build/teensy41/src/networking/src/apps/httpd/fs.c.o: In function fs_open': /Users/karoria/Documents/GitHub/iMXRT1062/grblHAL_Teensy4/src/networking/src/apps/httpd/fs.c:66: multiple definition of
fs_close'
.pio/build/teensy41/src/networking/fs.c.o:/Users/karoria/Documents/GitHub/iMXRT1062/grblHAL_Teensy4/src/networking/fs.c:56: first defined here
.pio/build/teensy41/src/networking/src/apps/httpd/fs.c.o: In function fs_open': /Users/karoria/Documents/GitHub/iMXRT1062/grblHAL_Teensy4/src/networking/src/apps/httpd/fs.c:66: multiple definition of
fs_read'
.pio/build/teensy41/src/networking/fs.c.o:/Users/karoria/Documents/GitHub/iMXRT1062/grblHAL_Teensy4/src/networking/fs.c:56: first defined here
.pio/build/teensy41/src/networking/src/apps/httpd/fs.c.o: In function fs_open': /Users/karoria/Documents/GitHub/iMXRT1062/grblHAL_Teensy4/src/networking/src/apps/httpd/fs.c:66: multiple definition of
fs_bytes_left'
.pio/build/teensy41/src/networking/fs.c.o:/Users/karoria/Documents/GitHub/iMXRT1062/grblHAL_Teensy4/src/networking/fs.c:56: first defined here
.pio/build/teensy41/src/networking/src/apps/httpd/httpd.c.o: In function httpd_init': /Users/karoria/Documents/GitHub/iMXRT1062/grblHAL_Teensy4/src/networking/src/apps/httpd/httpd.c:2558: multiple definition of
httpd_init'
.pio/build/teensy41/src/networking/httpd.c.o:/Users/karoria/Documents/GitHub/iMXRT1062/grblHAL_Teensy4/src/networking/httpd.c:2065: first defined here
collect2: error: ld returned 1 exit status
*** [.pio/build/teensy41/firmware.elf] Error 1
============================== [FAILED] Took 56.49 seconds ==============================Environment Status Duration
teensy41 FAILED 00:00:56.492 ========================= 1 failed, 0 succeeded in 00:00:56.492 ========================= The terminal process "platformio 'run'" terminated with exit code: 1.
Terminal will be reused by tasks, press any key to close it.
@terjeio, I am also OK with Arduino IDE if it is little more easier.
For everybody's information, "Teensy41_ethernet-master" directory goes to "iMXRT1062/grblHAL_Teensy4/.pio/libdeps/teensy41/" path. I am using PIO with VS code in Mac.
"multiple definitions" errors is due to similar source beeing compiled? This is coming from where? PIO or conflicting Arduino libs?
_Compiling .pio/build/teensy41/src/networking/libraries/lwip-ftpd-sd/src/lwipftpd-sd.cpp.o
I am not sure. I have already messed up a lot of code. Will start clean, may be tomorrow, as I am leaving from work now. Or will try later tonight. Will update here.
What compiler are you using? I had troubles with Atom since it would refuse to load some libraries.
If you want the compiler to include a library you downloaded and placed somewhere, you have to go and modify the platformio.ini file, there is a section where it lists the includes. Change from a git command to a local directory and it will use that as include source.
And yeah, at that point I would go with a clean start/git pull.
@Tiktiki Where to find for compiler in PIO? As I mentioned earlier, I copied libraries in ".pio/libdeps" manually. I have not changed anything in platformio.ini
Error on compiling using VSCode and PlatformIO Cannot find file altpc.h
src\networking\httpd.c:104:24: fatal error: lwip/altcp.h: No such file or directory
Careful exploration of grblHAL folders and .pio/libdeps confirms the file does not exist.