Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
49 commits
Select commit Hold shift + click to select a range
69225c4
tests raw sockets
Paciente8159 Aug 21, 2025
7f094ae
remimplemented base socket server
Paciente8159 Aug 21, 2025
0d7a21a
more modifications
Paciente8159 Aug 21, 2025
9227baa
migration from wifi to telnet
Paciente8159 Aug 22, 2025
cdf8cb4
implemented BSD Sockets on ESP8266
Paciente8159 Aug 23, 2025
81e1335
single socket dotask loop
Paciente8159 Aug 23, 2025
7f00ea0
Implemented BSD Socket for ESP32
Paciente8159 Aug 25, 2025
0600ae9
BSD Sockets for RP2040
Paciente8159 Aug 27, 2025
d98e81d
Squashed commit of the following:
Paciente8159 Sep 3, 2025
2918d41
working on file upload
Paciente8159 Sep 4, 2025
4eec84b
file uploading fixing
Paciente8159 Sep 4, 2025
6caf028
uploads working
Paciente8159 Sep 4, 2025
f780637
fix telnet broadcast
Paciente8159 Sep 4, 2025
271257a
ram usage optimizations and code cleaning
Paciente8159 Sep 5, 2025
47ece8a
some ESP8266 tests
Paciente8159 Sep 5, 2025
addc635
Update esp8266_wifi.c
Paciente8159 Sep 5, 2025
6c2200a
tests on ESP8266
Paciente8159 Sep 5, 2025
5f04f03
ESP8266 OTA route for testing
Paciente8159 Sep 5, 2025
480a63d
cleaning files
Paciente8159 Sep 5, 2025
0183a50
more code cleaning
Paciente8159 Sep 6, 2025
f3efc9b
fix compilation errors
Paciente8159 Sep 6, 2025
7fc4c81
macro simplifications
Paciente8159 Sep 6, 2025
ff81e45
Working on RP2040
Paciente8159 Sep 7, 2025
9fba04d
socket update spread
Paciente8159 Sep 8, 2025
fb151d2
Update esp8266_lwip.c
Paciente8159 Sep 8, 2025
687a81c
fix hex print bug
Paciente8159 Sep 8, 2025
3071472
tests with custom sockets
Paciente8159 Sep 9, 2025
ef85915
working on ESP32
Paciente8159 Sep 9, 2025
b24d839
some more changes
Paciente8159 Sep 10, 2025
4e3f0e5
clean configs
Paciente8159 Sep 10, 2025
1259123
http header buffer optimizations
Paciente8159 Sep 10, 2025
2fbc304
fixed data loss on ESP8266 bsd_recv
Paciente8159 Sep 10, 2025
01b5d7f
Update esp8266_lwip.c
Paciente8159 Sep 10, 2025
cce1d3f
Merge branch 'improved-thread-safety2' into networking
Paciente8159 Oct 10, 2025
3b0b1aa
compilation fixes
Paciente8159 Oct 10, 2025
88794bd
more compile fixes
Paciente8159 Oct 10, 2025
b8cfab5
Update rp2350.ini
Paciente8159 Oct 10, 2025
72ff5f8
Merge branch 'improved-thread-safety2' into networking
Paciente8159 Nov 28, 2025
79100c3
fixed virtual mcu stimuli
Paciente8159 Nov 30, 2025
32e1eec
Fixed ESP32 build error
Paciente8159 Nov 30, 2025
6268e71
Merge branch 'master' into networking
Paciente8159 Jan 20, 2026
5ac320a
updated from master
Paciente8159 Jan 20, 2026
f5324c9
fix build errors
Paciente8159 Jan 20, 2026
eaf19f4
modifications to OTA
Paciente8159 Jan 22, 2026
66ced39
applied OTA_URI macro
Paciente8159 Jan 23, 2026
dab4bdc
modifications for WiFi capable MCUs
Paciente8159 Jan 23, 2026
0621267
fix build warnings
Paciente8159 Jan 26, 2026
a640518
registerable net work devices
Paciente8159 Jan 27, 2026
4275efa
fix build errors
Paciente8159 Jan 27, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file added data/index.html.gz
Binary file not shown.
5 changes: 5 additions & 0 deletions makefiles/virtual/mcu_virtual.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1184,6 +1184,11 @@ extern "C"
return false;
}

/**
* OTA emulation
*/
void ota_server_start(void);

/**
* Initialize the MCU
* **/
Expand Down
126 changes: 118 additions & 8 deletions makefiles/virtual/uCNC-emulator.dev
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@ Libs=C:\Users\jcmartins\Downloads\GitHub\uCNC\uCNC;C:\Users\JCEM\Documents\GitHu
PrivateResource=
ResourceIncludes=C:\Users\jcmartins\Downloads\GitHub\uCNC\uCNC;C:\Users\JCEM\Documents\GitHub\uCNC\uCNC
MakeIncludes=
Compiler=-DMCU=MCU_VIRTUAL_WIN_@@_
CppCompiler=-DMCU=MCU_VIRTUAL_WIN_@@_
Compiler=-DMCU=MCU_VIRTUAL_WIN_@@_-DBOARD=BOARD_CUSTOM_@@_
CppCompiler=-DMCU=MCU_VIRTUAL_WIN_@@_-DBOARD=BOARD_CUSTOM_@@_
Linker=-lws2_32_@@_
IsCpp=1
Icon=
Expand All @@ -29,7 +29,7 @@ IncludeVersionInfo=0
SupportXPThemes=0
CompilerSet=1
CompilerSettings=000000e0g0000000001000000
UnitCount=99
UnitCount=111

[VersionInfo]
Major=1
Expand Down Expand Up @@ -871,7 +871,7 @@ OverrideBuildCmd=0
BuildCmd=

[Unit96]
FileName=..\..\uCNC\src\hal\tools\tools\embroidery_stepper.c
FileName=..\..\uCNC\src\buffer.c
CompileCpp=1
Folder=
Compile=1
Expand Down Expand Up @@ -971,7 +971,7 @@ OverrideBuildCmd=0
BuildCmd=

[Unit97]
FileName=..\..\uCNC\src\buffer.c
FileName=..\..\uCNC\src\atomic.h
CompileCpp=1
Folder=
Compile=1
Expand All @@ -981,7 +981,7 @@ OverrideBuildCmd=0
BuildCmd=

[Unit98]
FileName=..\..\uCNC\src\atomic.h
FileName=..\..\uCNC\src\buffer.h
CompileCpp=1
Folder=
Compile=1
Expand All @@ -991,7 +991,7 @@ OverrideBuildCmd=0
BuildCmd=

[Unit99]
FileName=..\..\uCNC\src\buffer.h
FileName=..\..\uCNC\src\modules\net\http.c
CompileCpp=1
Folder=
Compile=1
Expand Down Expand Up @@ -1041,7 +1041,117 @@ OverrideBuildCmd=0
BuildCmd=

[Unit100]
FileName=..\..\uCNC\src\modules\atc\atc.c
FileName=..\..\uCNC\src\modules\net\http.h
CompileCpp=1
Folder=
Compile=1
Link=1
Priority=1000
OverrideBuildCmd=0
BuildCmd=

[Unit101]
FileName=..\..\uCNC\src\modules\net\socket.c
CompileCpp=1
Folder=
Compile=1
Link=1
Priority=1000
OverrideBuildCmd=0
BuildCmd=

[Unit102]
FileName=..\..\uCNC\src\modules\net\socket.h
CompileCpp=1
Folder=
Compile=1
Link=1
Priority=1000
OverrideBuildCmd=0
BuildCmd=

[Unit103]
FileName=..\..\uCNC\src\modules\net\telnet.c
CompileCpp=1
Folder=
Compile=1
Link=1
Priority=1000
OverrideBuildCmd=0
BuildCmd=

[Unit104]
FileName=..\..\uCNC\src\modules\net\telnet.h
CompileCpp=1
Folder=
Compile=1
Link=1
Priority=1000
OverrideBuildCmd=0
BuildCmd=

[Unit105]
FileName=..\..\uCNC\src\modules\net\websocket.c
CompileCpp=1
Folder=
Compile=1
Link=1
Priority=1000
OverrideBuildCmd=0
BuildCmd=

[Unit106]
FileName=..\..\uCNC\src\modules\net\websocket.h
CompileCpp=1
Folder=
Compile=1
Link=1
Priority=1000
OverrideBuildCmd=0
BuildCmd=

[Unit107]
FileName=..\..\uCNC\src\modules\net\utils\base64.h
CompileCpp=1
Folder=
Compile=1
Link=1
Priority=1000
OverrideBuildCmd=0
BuildCmd=

[Unit108]
FileName=..\..\uCNC\src\modules\net\utils\bsd_socket.h
CompileCpp=1
Folder=
Compile=1
Link=1
Priority=1000
OverrideBuildCmd=0
BuildCmd=

[Unit109]
FileName=..\..\uCNC\src\modules\net\utils\http_request.c
CompileCpp=1
Folder=
Compile=1
Link=1
Priority=1000
OverrideBuildCmd=0
BuildCmd=

[Unit110]
FileName=..\..\uCNC\src\modules\net\utils\http_request.h
CompileCpp=1
Folder=
Compile=1
Link=1
Priority=1000
OverrideBuildCmd=0
BuildCmd=

[Unit111]
FileName=..\..\uCNC\src\modules\net\utils\sha1.h
CompileCpp=1
Folder=
Compile=1
Expand Down
4 changes: 2 additions & 2 deletions uCNC/cnc_config.h
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,8 @@ extern "C"
#define BAUDRATE 115200
#endif

#ifndef ENABLE_WIFI
// #define ENABLE_WIFI
#ifndef ENABLE_SOCKETS
// #define ENABLE_SOCKETS
#endif

#ifndef ENABLE_BLUETOOTH
Expand Down
4 changes: 4 additions & 0 deletions uCNC/src/cnc.c
Original file line number Diff line number Diff line change
Expand Up @@ -1119,6 +1119,10 @@ static void cnc_io_dotasks(void)
}
}
#endif

#if defined(ENABLE_SOCKETS) && !defined(MCU_HAS_RTOS)
socket_server_dotasks();
#endif
}

#ifdef ENABLE_MULTILINE_STARTUP_BLOCKS
Expand Down
4 changes: 4 additions & 0 deletions uCNC/src/cnc.h
Original file line number Diff line number Diff line change
Expand Up @@ -149,6 +149,10 @@ extern "C"
#include "core/planner.h"
#include "core/interpolator.h"
#include "modules/encoder.h"
#ifdef ENABLE_SOCKETS
#include "modules/net/socket.h"
#include "modules/net/telnet.h"
#endif

/**
*
Expand Down
3 changes: 0 additions & 3 deletions uCNC/src/hal/boards/esp8266/boardmap_wemos_d1.h
Original file line number Diff line number Diff line change
Expand Up @@ -32,9 +32,6 @@ extern "C"
#define BOARD_NAME "WEMOS D1"
#endif

#undef ENABLE_WIFI
#define ENABLE_WIFI

// SAME AS GRBL for test purposes
// Setup step pins
#define STEP2_BIT 4 // assigns STEP2 pin
Expand Down
20 changes: 11 additions & 9 deletions uCNC/src/hal/boards/esp8266/esp8266.ini
Original file line number Diff line number Diff line change
Expand Up @@ -7,17 +7,19 @@ platform = espressif8266
board = d1
lib_deps =
${env.lib_deps}
SPI
EEPROM
; https://github.com/littlefs-project/littlefs/archive/refs/tags/v2.11.1.zip
; SPI
; EEPROM
ESP8266WiFi
ESP8266WebServer
ESP8266HTTPUpdateServer
; ESP8266WebServer
; ESP8266HTTPUpdateServer
LittleFS
Hash
https://github.com/Links2004/arduinoWebSockets/archive/refs/heads/master.zip
build_flags = ${env.build_flags} -D BOARDMAP=\"src/hal/boards/esp8266/boardmap_wemos_d1.h\" -D ENABLE_WIFI
;build_type=debug
;monitor_filters = esp8266_exception_decoder
; Hash
; https://github.com/Links2004/arduinoWebSockets/archive/refs/heads/master.zip

build_flags = ${env.build_flags} -D BOARDMAP=\"src/hal/boards/esp8266/boardmap_wemos_d1.h\" -D ENABLE_SOCKETS
; build_type=debug
; monitor_filters = esp8266_exception_decoder
upload_speed = 256000
board_build.f_flash = 80000000L
board_build.f_cpu = 160000000L
Expand Down
34 changes: 13 additions & 21 deletions uCNC/src/hal/boards/rp2040/rp2040.ini
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,15 @@ board_build.f_cpu = 133000000L
build_flags = ${env.build_flags} -std=gnu99 -Wall -fdata-sections -ffunction-sections -fno-exceptions -Wl,--gc-sections
debug_tool = cmsis-dap
lib_deps =
${env.lib_deps}
${env.lib_deps}
SPI
Wire
EEPROM

[common_rp2040w]
extends = common_rp2040
lib_deps =
${common_rp2040.lib_deps}
Wifi
WebServer
HTTPUpdatedServer
Expand All @@ -28,39 +34,25 @@ lib_deps =
DNSServer
SerialBT
LittleFS
EEPROM
https://github.com/Links2004/arduinoWebSockets/archive/refs/heads/master.zip

[env:RP2040-PICO]
extends = common_rp2040
board = rpipico
build_flags = ${common_rp2040.build_flags} -D BOARDMAP=\"src/hal/boards/rp2040/boardmap_rpi_pico.h\"
lib_deps =
${env.lib_deps}
SPI
Wire
EEPROM
lib_ignore =
HTTPUpdateServer
LittleFS
WiFi
WebServer
SerialBT
DNSServer
Hash
BluetoothSerial
lib_ignore = SerialBT

[env:RP2040-PICO-W]
extends = common_rp2040
extends = common_rp2040w
board = rpipicow
build_flags = -D BOARDMAP=\"src/hal/boards/rp2040/boardmap_rpi_pico_w.h\" -D ENABLE_WIFI -D ENABLE_BLUETOOTH -D PIO_FRAMEWORK_ARDUINO_ENABLE_BLUETOOTH

[env:RP2040-PICO-W-MULTICORE]
extends = common_rp2040
extends = common_rp2040w
board = rpipicow
build_flags = -D BOARDMAP=\"src/hal/boards/rp2040/boardmap_rpi_pico_w.h\" -D ENABLE_WIFI -D ENABLE_BLUETOOTH -D PIO_FRAMEWORK_ARDUINO_ENABLE_BLUETOOTH -DRP2040_RUN_MULTICORE

[env:RP2040-CUSTOM]
extends = common_rp2040
build_flags = ${common_rp2040.build_flags} -DMCU=MCU_CUSTOM
extends = common_rp2040w
build_flags = ${common_rp2040w.build_flags} -DMCU=MCU_CUSTOM
board = ${env.board}
1 change: 0 additions & 1 deletion uCNC/src/hal/boards/rp2350/rp2350.ini
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@ lib_deps =
EEPROM
lib_ignore =
HTTPUpdateServer
LittleFS
WiFi
WebServer
SerialBT
Expand Down
16 changes: 8 additions & 8 deletions uCNC/src/hal/mcus/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -926,14 +926,14 @@ Before creating a custom HAL for a custom board/microcontroller the microcontrol
#endif
#endif

#ifdef MCU_HAS_WIFI
uint8_t mcu_wifi_getc(void);
uint8_t mcu_wifi_available(void);
void mcu_wifi_clear(void);
void mcu_wifi_putc(uint8_t c);
void mcu_wifi_flush(void);
#ifdef DETACH_WIFI_FROM_MAIN_PROTOCOL
MCU_RX_CALLBACK void mcu_wifi_rx_cb(uint8_t c);
#ifdef ENABLE_SOCKETS
uint8_t mcu_telnet_getc(void);
uint8_t mcu_telnet_available(void);
void mcu_telnet_clear(void);
void mcu_telnet_putc(uint8_t c);
void mcu_telnet_flush(void);
#ifdef DETACH_TELNET_FROM_MAIN_PROTOCOL
MCU_RX_CALLBACK void mcu_telnet_rx_cb(uint8_t c);
#endif
#endif

Expand Down
4 changes: 4 additions & 0 deletions uCNC/src/hal/mcus/esp32/esp32_bt.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,11 @@
*/

#include "../../../../cnc_config.h"

#ifdef ESP32
#include <Arduino.h>
#endif

#if CONFIG_IDF_TARGET_ESP32 && defined(ENABLE_BLUETOOTH)
#include "esp_task_wdt.h"
#include <stdint.h>
Expand Down
Loading