Skip to content
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

Devt #318

Merged
merged 18 commits into from
Feb 28, 2022
Merged

Devt #318

Show file tree
Hide file tree
Changes from 13 commits
Commits
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 modified FluidNC/data/index.html.gz
Binary file not shown.
2 changes: 1 addition & 1 deletion FluidNC/src/Kinematics/CoreXY.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,7 @@ namespace Kinematics {
}

if (cycle_mask != 0) {
if (bitnum_is_true(cycle_mask, X_AXIS) || bitnum_is_true(cycle_mask, X_AXIS)) {
if (bitnum_is_true(cycle_mask, X_AXIS) || bitnum_is_true(cycle_mask, Y_AXIS)) {
log_error("CoreXY cannot single axis home X or Y axes");
// TODO: Set some Kinematics error or alarm
return true;
Expand Down
5 changes: 3 additions & 2 deletions FluidNC/src/Main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -122,8 +122,9 @@ void setup() {
sys.state = State::ConfigAlarm;
}

WebUI::wifi_config.begin();
WebUI::bt_config.begin();
if (!WebUI::wifi_config.begin()) {
WebUI::bt_config.begin();
}
WebUI::inputBuffer.begin();
allChannels.deregistration(&startupLog);
}
Expand Down
2 changes: 1 addition & 1 deletion FluidNC/src/Pins/I2SOPinDetail.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ namespace Pins {
Assert(value.validateWith(this->_capabilities), "Requested attributes do not match the I2SO pin capabilities");
Assert(!_attributes.conflictsWith(value), "Attributes on this pin have been set before, and there's a conflict.");

_attributes = value;
_attributes = _attributes | value;

// I2S out pins cannot be configured, hence there
// is nothing to do here for them. We basically
Expand Down
32 changes: 19 additions & 13 deletions FluidNC/src/ProcessSettings.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -358,33 +358,39 @@ static Error home_c(const char* value, WebUI::AuthenticationLevel auth_level, Ch
static void write_limit_set(uint32_t mask, Channel& out) {
const char* motor0AxisName = "xyzabc";
for (int i = 0; i < MAX_N_AXIS; i++) {
out.write(bitnum_is_true(mask, i) ? char(motor0AxisName[i]) : ' ');
out << (bitnum_is_true(mask, i) ? char(motor0AxisName[i]) : ' ');
}
const char* motor1AxisName = "XYZABC";
for (int i = 0; i < MAX_N_AXIS; i++) {
out.write(bitnum_is_true(mask, i + 16) ? char(motor1AxisName[i]) : ' ');
out << (bitnum_is_true(mask, i + 16) ? char(motor1AxisName[i]) : ' ');
}
}
static Error show_limits(const char* value, WebUI::AuthenticationLevel auth_level, Channel& out) {
out.print("Send ! to exit\n");
out.print("Homing Axes: ");
write_limit_set(Machine::Axes::homingMask, out);
out.write('\n');
out.print("Limit Axes: ");
out << '\n';
out << "Limit Axes: ";
write_limit_set(Machine::Axes::limitMask, out);
out.write('\n');
out.print(" PosLimitPins NegLimitPins\n");
out << '\n';
out << " PosLimitPins NegLimitPins\n";
const TickType_t interval = 500;
TickType_t limit = xTaskGetTickCount();
do {
out.print(": "); // Prevents WebUI from suppressing an empty line
write_limit_set(Machine::Axes::posLimitMask, out);
out.write(' ');
write_limit_set(Machine::Axes::negLimitMask, out);
out.print("\r\n");
vTaskDelay(500); // Delay for a reasonable repeat rate
TickType_t thisTime = xTaskGetTickCount();
if (((long)(thisTime - limit)) > 0) {
out << ": "; // Prevents WebUI from suppressing an empty line
write_limit_set(Machine::Axes::posLimitMask, out);
out << ' ';
write_limit_set(Machine::Axes::negLimitMask, out);
out << '\n';
limit = thisTime + interval;
}
vTaskDelay(1);
pollChannels();
} while (!rtFeedHold);
rtFeedHold = false;
out.write('\n');
out << '\n';
return Error::Ok;
}
static Error go_to_sleep(const char* value, WebUI::AuthenticationLevel auth_level, Channel& out) {
Expand Down
1 change: 1 addition & 0 deletions FluidNC/src/Protocol.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,7 @@ bool can_park() {

void protocol_reset() {
probeState = ProbeState::Off;
soft_limit = false;
rtStatusReport = false;
rtCycleStart = false;
rtFeedHold = false;
Expand Down
2 changes: 1 addition & 1 deletion FluidNC/src/SDCard.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ SDCard::State SDCard::test_or_open(bool refresh) {
}

SDCard::State SDCard::begin(SDCard::State newState) {
if (newState != SDCard::State::Idle && _state > SDCard::State::Idle) {
if (_state >= SDCard::State::Busy) {
return _state;
}
SDCard::State oldState = test_or_open(true);
Expand Down
5 changes: 5 additions & 0 deletions fluidterm/README-FluidTerm.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,3 +30,8 @@ Changes
You can restart the ESP32 to see the boot messages with the FluidNC **$bye** command or you can toggle the DTR function to restart most ESP32 modules by doing Ctrl+T Ctrl+D twice.

<img src="https://github.com/bdring/fluidterm/blob/main/images/screenshot_01.png" width="800" >

### Source Code

The source code for fluidterm.py (the Python version) is in this directory. The source code for
fluidterm.exe (the Windows native version) is at https://github.com/MitchBradley/FluidTerm2 .
Binary file modified fluidterm/fluidterm.exe
Binary file not shown.
39 changes: 39 additions & 0 deletions install_scripts/win64/HOWTO-INSTALL.txt
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,20 @@ name as below).
To install the WiFi version: install-wifi.bat
To install the Bluetooth version: install-bt.bat
To replace the ESP32 local filesystem: install-fs.bat
To erase everything on the ESP32: erase.bat
To just run FluidTerm: fluidterm.bat

### Erasing the ESP32

If your ESP32 already has other software on it, installing FluidNC
on top of that other software might not work right. You can get
rid of that other software with:

erase.bat

Then you can install FluidNC with install-* commands mentioned above.

### Local Filesystem Considerations

Replacing the local filesystem is only useful for the wifi
version, since its default contents are only needed for
Expand All @@ -35,3 +49,28 @@ it via WebUI from wifi/index.html.gz herein.

A good approach is to use install-fs only on your first
FluidNC installation, or to start from a clean slate.

### Running FluidTerm

FluidTerm is a simple serial terminal emulator program with a few
features specific to FluidNC - it can upload files and reset the ESP32.

The FluidNC install scripts run FluidTerm automatically at the end,
but if you want to run it separately, you can type

fluidterm.bat

### Alternatives to FluidTerm

Most GCode sender programs have some way to send commands directly to
FluidNC, but it can sometimes be helpful to bypass the complexity of
a sender and use a more direct path. FluidTerm is one such direct
path, but there are others, typically called "serial terminals".

For Windows, there are many such programs, such as "PuTTY" and
"TeraTerm Pro". None are preinstalled by default, but you can
download one from the internet. Setting one up requires that
you know which COM port is for the ESP32, the baud rate (115200),
and some other settings - no hardware or software flow control,
accept linefeed as end-of-line on input, etc. FluidTerm tried
to make it easy for you by using all the correct defaults.