Using the Cohesion3D Remix
This is a really nice board but as usual the documentation is sketchy. So,… getting started.
Connecting to the ReMix
Depending on your computer ->
Connect via USB in Windows
I started by connecting it to a USB port on my desktop. This works well in Windows.
When you connect it creates a pseudo-serial port you can use putty with and it also mounts the SD card as a drive on the desktop. This card contains two files:
- config.txt — this is the configuration file for the Smoothieware implementation
- FIRMWARE.CUR — this is the renamed firmware.bin binary firmware.
The serial port runs at whatever speed you connect to it at (I used 115Kbaud). When you connect to it if you hit the Enter key it should say “ok” back. The port doesn’t echo so you won’t see what you type.
Connect via USB using a Raspberry PI
The board is similarly easy to connect to on a Raspberry Pi. When you connect there will be two relevant /dev entries added.
/dev/ttyACM0 — this is the serial device that connects using a terminal app.
/dev/sda1 — the SD card main partition
The SD card can be mounted on the Pi via:
# once create a mnt/sd mount destination
sudo mkdir /mnt
sudo mkdir /mnt/sd
# mount the partition
sudo mount /dev/sda1 /mnt/sd
Once you write to the SD card, remember to unmount it before restarting the ReMix board. Otherwise it will move to sdb1 then sdc1 and so on.
sudo umount /mnt/sd
To communicate using a terminal program I used Minicom (sudo apt-get install minicom). Minicom lets you manually echo and always exits when you ask it to.
sudo minicom -D /dev/ttyACM0
Note that because we’re talking to /dev you must run as root.
Connect via Wi-Fi using the ESP-Link on the ReMix
The ReMix has a very under-documented feature in the ESP8266 Wi-Fi board on it. The ESP-Link software is reasonably cool, actually. It can run in both AP mode (acting like a Wi-Fi router) and STA mode (connecting to your Wi-Fi router as a client).
To start, connect to the ESP-Link using a phone or Android tablet. Click your Wi-Fi connection icon and you should see the ESP-xxx network in the router list. Connect to it.
Browse to the ESP-Link web site. On my connection my phone became 192.168.4.2 and sure enough the link was http://192.168.4.1.
Once there, you can set a password for the wireless network of your preference and the ESP-Link will connect to that network (while retaining your connection!).
Now you can browse straight to the ESP-Link using the Wi-Fi supplied address (which it tells you once connected).
Enable the WiFi communication path
Once Wi-Fi is enabled and working, add two jumpers to the board (with power off). This connects the ESP8266 serial pins to the serial pins of the main processor.
Now you can use the ESP-Link uC Console to talk straight to the processor. You can also use any telnet application (such as Putty) to communicate via the acquired IP address.
Cool Feature: once the Wi-Fi is connected I don’t know a way to transfer to/from the SD card using it, but the USB connections still work so you can do config and firmware maintenance using USB without rejumpering.
How to Update the Configuration
The Smoothieware configuration is saved in a text file named config.txt that is stored on the SD card. When the Smoothie boots it reads this file and that sets up the configuration.
For editing the file I edit it locally and FTP it to the USB-connected Raspberry Pi. The Pi then mounts, saves, and unmounts. Here’s my script:
sudo mount /dev/sda1 /mnt/sd
sudo cp config.txt /mnt/sd
sudo umount /mnt/sd
After that type reset in a telnet console to restart the processor — or push the restart button.
How to Update the Firmware
To update the firmware just place a file named firmware.bin in the root of the SD card (just like config.txt above). On reset the ReMix will update the firmware using that file and then it will rename the file to FIRMWARE.CUR.
How to Build New Firmware
If you want to build your own version of the firmware, start by forking (cloning) the Cohesion3d fork of Smoothieware. Unfortunately the main Smoothieware fork stopped working in December 2016 with this commit: d79254323f4bb951426c6add29a4451130eaa018.
I build in Ubuntu on Windows 10. Building on any other system is similar.
The Smoothieware standard linux_install script doesn’t actually work because it gets a multi-year-old version of the arm cross-compiler. So, you’ll need to do this manually (or update the script).
- Run linux_install as described in the documentation. This will fail and get the wrong version but the BuildShell script it creates is necessary. Delete the created folder.
rm -rf gcc-arm-none-eabi
- Browse to https://developer.arm.com/open-source/gnu-toolchain/gnu-rm and find the latest build. Currently, for 64 bit Linux that is gcc-arm-none-eabi-7–2017-q4-major-linux.tar.bz2. Download that file to your home folder.
#decompress the files
tar xf gcc-arm-none-eabi-7–2017-q4-major-linux.tar.bz2
# move the result folder
mv gcc-arm-none-eabi-7–2017-q4-major-linux gcc-arm-none-eabi
- copy the build to your sd card (assumed mounted locally here)
sudo cp LPC1768/main.bin /mnt/sd/firmware.bin
- reset the Remix to have it update the firmware from SD card