HowTo Add A New Infill Pattern To PrusaSlicer

The Dev-Team at Prusa has done a nice job of cleaning up the Slic3r sources with their “PrusaSlicer” fork. Also setting up a build is so much easier now. Playing with infills is always fun. The following shows were you need to touch the sources to add a new infill pattern to libslic3r and the GUI.

“src/libslic3r/Fill/”

create “NewFill.hpp” and “NewFill.cpp

“src/libslic3r/CMakeLists.txt”

Add “NewFill.hpp” and “NewFill.cpp” to the “addLibrary” call.

“src/libslic3r/Fill/FillBase.cpp”

Include “NewFill.hpp” and add “case ipNewfill: return new FillSinusoidal();” to the “Fill::new_from_type” function.

“/src/libslic3r/PrintConfig.cpp”

Add to the “fill_pattern” enum at around line 830

def->enum_values.push_back(“newfill”);

def->enum_labels.push_back(L(“New Fill”));

“src/libslic3r/PrintConfig.hpp”

Extend “enum InfillPattern” with “ipNewfill” and the “get_enum_values()” function with “keys_map[“newfill”] = ipNewfill;”

How To Write Micropython Firmware to the Wemos D1 Mini

All Wemos D1 Minis I tested required a different flash mode than shown in the official documentation to successfully write the Micropython firmware to the module.

The following commands resulted in a succesfull write.

esptool.py –port [usbdevice] –baud 115200 erase_flash

esptool.py –port [usbdevice] –baud 115200 write_flash -fm dio –flash_size=detect 0 [firmware.bin]

HowTo Build MicroPython for ESP32 on OSX

A prebuild toolchain for the ESP32 is available from Espressif: https://dl.espressif.com/dl/xtensa-esp32-elf-osx-1.22.0-80-g6c4433a-5.2.0.tar.gz

If you’re interested in building from scratch check the docs for IDF v.3.3 https://docs.espressif.com/projects/esp-idf/en/v3.3/get-started/macos-setup.html

Get MicroPython and initialise its dependencies
git clone https://github.com/micropython/micropython.git
git submodule update --init
Get the correct version of the IDF and its dependencies

As of 09/2019 the MicroPython build needs v3.3 of the IDF. Later versions use cmake instead of make.

git clone https://github.com/espressif/esp-idf.git
git checkout 6ccb4cf5b7d1fdddb8c2492f9cbc926abaf230df
git submodule update --init --recursive
Unpack the toolchain and add IT to the PATH
tar -zxf xtensa-esp32-elf-osx-1.22.0-80-g6c4433a-5.2.0.tar.gz
export PATH=$PATH:<replace with absolute path to toolchain>/bin
Virtual Environment

Some of the build tools and dependencies require Python 3. Lets create a virtual environment and activate it to keep things separated.

virtualenv --python=python3 esp32buildEnv
source esp32buildEnv/bin/activate
Install the python dependencies required by the IDF
pip install -r esp-idf/requirements.txt
Build the crosscompiler
cd mpy-cross
make
Build the ESP32 port
cd ports/esp32
ESPIDF=<path to IDF root> PYTHON2=/usr/bin/python make  

The resulting “firmware.bin” can be uploaded to your ESP32 with the “esptool” as usual.

How To change a MAC address on OSX

List all interfaces by running the command ‘ifconfig’ in a terminal. Pick the interface you want to change e.g “en0

To set a different MAC on the interface run:

sudo ifconfig [interface] lladdr [MAC]

e.g: sudo ifconfig en0 lladdr dc:03:be:a0:a5:ab

You can generate a random MAC by running:
openssl rand -hex 6 | sed ‘s/\(..\)/\1:/g; s/.$//’