I have been trying to add some simple control buttons to the Octoprint display for my MakerGear M3-ID printer. I have installed the 'Custom Controls' plugin, but it seems very difficult to use, and I cannot for the life of me get the parameterization to work
So, I was thinking of editing the config.yaml file directly using notepad++ on my Windows PC, using 'Custom Controls' and the YAML primer as guides.
However, I am not sure how to even get started with the editing process. I can't seem to access (or even find) 'config.yaml' from the Octoprint web interface, but I'm pretty sure the 'Custom Controls' plugin is accessing it, so it must be possible.
What I would like to be able to do is first upload the existing, un-edited config.yaml file to my Windows 10 Pro box and make about 10 copies so I can recover from my inevitable screwups. Then carefully edit the file on my PC using notepad++, basically one or two lines at a time to confirm that I know what I'm doing, and download the result back to Octoprint. Restart Octoprint using the web interface, test, repeat.
Any pointers on how to get started here? It will be a major PITA to have to physically access the SD card, due to the way that the MakerGear M3-ID printer has the Octoprint module buried under the print bed.
TIA,
Frank
Use SSH to retrieve the file. It's located under ~/.octoprint/config.yaml
. Might want to use WinSCP to copy it across?
Thanks for the quick reply. Unfortunately I'm unable to connect to Octoprint using ftp or sftp (ssh). I tried Filezilla and Windows command line and got the same behavior with both.
I confirmed that Octoprint was active by connecting to it using the normal web browser, and I confirmed I could 'ping' 192.168.1.90 from Windows (the IP address was taken from the Octoprint connection status readout)
Then from windows command line I executed
C:\Users\Frank>sftp 192.168.1.90
ssh: connect to host 192.168.1.90 port 22: Connection refused
C:\Users\Frank>
Using FileZilla:
Command: |
open "anonymous@192.168.1.90" 22 |
Error: |
FATAL ERROR: Network error: Connection refused |
Error: |
Could not connect to server |
ommand: |
open "printer@192.168.1.90" 22 |
Error: |
FATAL ERROR: Network error: Connection refused |
Error: |
Could not connect to server |
Status: |
Waiting to retry... |
Status: |
Connecting to 192.168.1.90... |
Response: |
fzSftp started, protocol_version=9 |
Command: |
open "printer@192.168.1.90" 22 |
Error: |
FATAL ERROR: Network error: Connection refused |
Error: |
Could not connect to server |
Any idea what I'm doing wrong here?
TIA,
Frank
Is it OctoPi? It might not have SSH enabled. Current versions do this automatically, but you mention yours is in the MakerGear printer.
Yeah, I use filezilla with the below settings on a default octopi install.
Hmm, how to tell if it is 'octoprint' or 'octopi'?
TIA,
Frank
octoprint is the application, octopi is the underlying OS. if you just flashed an SD card with an img file that you downloaded then you are using octopi and it should just work. If you manually setup the raspbian or other OS and then installed octoprint then you are not using octopi.
OK, thanks for the info; I'm using whatever MakerGear supplied with the printer. Is there a way I can tell what I'm running? If it helps, here's a screenshot of my SD card's root directory.
TIA,
Frank
that definitely looks like an octopi image, but an older generation maybe 0.16. I think if you just add a black file in that sd card root named ssh (no file extension) and then boot that on the pi, it will automatically enable SSH to allow you to get to config.yaml. Otherwise, you'll need to use keyboard and monitor/tv to log in local and run sudo raspi-config
and enable SSH that way.
Thanks - I can do that, but what do you mean by 'black file'. Is that jargon for a particular permissions configuration or something?
TIA,
Frank
sorry, typo. meant blank
file, ie an empty txt file with no file extension.
Ah, thanks - I ran Linux boxen (mostly RedHat) for years in a previous lifetime, and never heard that term, so I was a bit flummoxed
I installed the file and I'm trying it now...
Frank
OK, I was able to connect to the octoprint module using sftp and FileZilla. I found and viewed config.yaml as described, but it didn't contain anything like I expected. Here's the entire contents of config.yaml:
api:
key: test
serial:
timeout:
detection: 1.0
connection: "5"
additionalPorts:
- /dev/portA
- /dev/portB
server:
port: 8080
devel:
virtualPrinter:
enabled: true
I expected to find a 'controls' section for the controls shown on the web interface. What am I missing?
TIA,
Frank
you will only see something in there that has been configured, or changed from the default settings. The controls listed in the docs is for additional controls outside of the provided default ones on the page. So there is no correlation between the home button so to say with custom controls.
Thanks, but this confuses me even more. I have at least two custom controls that I implemented using the 'Custom Control Editor' plugin, as shown in the screenshot below
So I would have expected the code for them to show up in config.yaml. Is there something else that gets automatically appended to config.yaml?
TIA,
Frank
That's interesting, that plugin does have open issues of wiping out settings in config.yaml when mixed with a couple of other plugins because of the way it handles its settings load. Of course we also have no idea what the print manufacturer did behind the scenes to your install to know for sure if that path is the true base directory that you're loading the file from.
Wonderful! I love this - I just wanted a couple of very simple custom controls, and now I'm reverse-engineering MakerGear
I have a message into MakerGear support - I guess I'll have to wait to see what they say.
Thanks for the education so far!
Frank
You could try running find / -name "config.yaml"
using an SSH session to the pi to see where the system sees the files at.
Thanks - that worked! It took me a while to figure out how to connect to the octoprint server via ssh (Win boxes don't offer a lot of help), but once I did your find command did the trick. Turns out FileZilla wasn't searching .folders, so I missed them when using that facility.
Now I can see the 'normal' controls and my one 'custom' control blocks in the config.yaml file.
Thanks again for your help - now I can get in MUCH more trouble than before!
Frank
1 Like
OK, I have been able to modify the config.yaml file and see the results on the server display. However, I am having trouble getting one of my modifications to work - when I upload my latest mods, the server won't reload; I have to replace it with the original config.yaml file to get it working again.
Here's the latest version that actually works:
accessControl:
salt: CLHzxX44voE8dCsbF9JSox3hWBgsJcNP
api:
allowCrossOrigin: true
key: 845E22FE2A774F18A64C8E084DD9EED2
appearance:
name:
- MakerGear M3Printer74M98
components:
order:
tab:
- temperature
- control
- gcodeviewer
- terminal
- timelapse
controls:
- children:
- commands:
- M201 X500 Y500
- M205 X8 Y8
- M220 S20
name: High Quality
- commands:
- M201 X900 Y900
- M205 X20 Y20
- M220 S50
name: Medium Quality
- commands:
- M201 X2000 Y2000
- M205 X60 Y60
- M220 S150
name: Turbo
- commands:
- M220 S100
- M205 X30 Y30
- M201 X1000 Y1200
name: Restore Normal Settings
collapsed: true
layout: horizontal
name: Quality and speed overrides
- children:
- commands:
- T0
- M109 S215
- G1 E15 F80
- G1 E-120 F80
- M104 S0
- ''
- ''
- ''
- ''
- ''
input:
- default: '215'
name: PLA
parameter: temp
slider: false
name: Load Left
layout: vertical
name: Load Filament
feature: {}
gcodeViewer: {}
plugins:
ScreenSquish:
octoprint_max_version: ''
_disabled:
- slicer
- printhistory
- touchui
announcements:
_config_version: 1
channels:
_blog:
read_until: 1500983100
_important:
read_until: 1521370800
_octopi:
read_until: 1499253000
_plugins:
read_until: 1506297600
_releases:
read_until: 1508162400
enabled_channels:
- _important
cura:
cura_engine: /usr/local/bin/cura_engine
discovery:
publicPort: 80
upnpUuid: a5a7ec43-d6c7-4dbe-bbc8-9e6d741af2e7
mgsetup:
activated: true
currentPrintElapsedTime: 1609563460.0
currentPrintStartTime: 1609557303.0
currentProjectMachineFailTimeFriendly: 0:00:00
currentProjectPrintFailTime: 247540.0
currentProjectPrintFailTimeFriendly: 2 days, 20:45:40
currentProjectPrintSuccessTime: 1117370.997247219
currentProjectPrintSuccessTimeFriendly: 12 days, 22:22:50
localFirmwareVersion: '"1.1.6.1.1"'
nextReminder: 1570107810.0
printing: true
registered: true
serialNumber: MV674M98
totalMachineFailTimeFriendly: 0:00:00
totalPrintFailTime: 247540.0
totalPrintFailTimeFriendly: 2 days, 20:45:40
totalPrintSuccessTime: 1117370.997247219
totalPrintSuccessTimeFriendly: 12 days, 22:22:50
softwareupdate:
_config_version: 6
check_providers:
autoscroll: autoscroll
autoselect: autoselect
customcontrol: customControl
ipOnConnect: ipOnConnect
octoprint_mgsetup: mgsetup
octoprint_nautilus: mgsetup
printhistory: printhistory
slicer: slicer
touchui: touchui
checks:
octoprint:
checkout_folder: /home/pi/OctoPrintMG
prerelease: false
prerelease_channel: null
user: MakerGear
printerParameters: {}
printerProfiles:
default: _default
serial:
additionalPorts:
- /dev/ttyS0
autoconnect: true
baudrate: 115200
disconnectOnErrors: false
log: true
port: /dev/ttyS0
timeout:
communication: 60.0
connection: 30.0
sdStatus: 10.0
server:
commands:
serverRestartCommand: /home/pi/.octoprint/scripts/resetOctoprint.sh
systemRestartCommand: /home/pi/.octoprint/scripts/resetRpi.sh
systemShutdownCommand: /home/pi/.octoprint/scripts/shutdownRpi.sh
firstRun: false
onlineCheck:
enabled: true
pluginBlacklist:
enabled: true
secretKey: jROTHQkiJoH6u5wLeLs2YiRU0wIrv8Fb
seenWizards:
cura: null
slicing:
defaultProfiles:
cura: pla-no-support
system:
actions:
- action: reset_rambo
command: /home/pi/.octoprint/scripts/resetRambo.sh
confirm: You are about to reset the rambo.
name: Reset RAMBo
temperature:
cutoff: 5
profiles:
- bed: '115'
extruder: '265'
name: ABS
- bed: '70'
extruder: '215'
name: PLA
terminalFilters:
- name: Suppress temperature messages
regex: '(Send: (N\d+\s+)?M105)|(Recv: ok (B|T\d*):)'
- name: Suppress SD status messages
regex: '(Send: (N\d+\s+)?M27)|(Recv: SD printing byte)'
- name: Suppress wait responses
regex: 'Recv: wait'
- name: Suppress busy:processing
regex: 'Recv: echo:busy: processing'
webcam:
ffmpeg: /usr/bin/avconv
snapshot: http://127.0.0.1:8080/?action=snapshot
stream: ''
And here's the version I'm trying to upload now. The difference is the addition of a parameterized control for setting the extruder temperature with 'M109 S(temp)'.
accessControl:
salt: CLHzxX44voE8dCsbF9JSox3hWBgsJcNP
api:
allowCrossOrigin: true
key: 845E22FE2A774F18A64C8E084DD9EED2
appearance:
name:
- MakerGear M3Printer74M98
components:
order:
tab:
- temperature
- control
- gcodeviewer
- terminal
- timelapse
controls:
- children:
- commands:
- M201 X500 Y500
- M205 X8 Y8
- M220 S20
name: High Quality
- commands:
- M201 X900 Y900
- M205 X20 Y20
- M220 S50
name: Medium Quality
- commands:
- M201 X2000 Y2000
- M205 X60 Y60
- M220 S150
name: Turbo
- commands:
- M220 S100
- M205 X30 Y30
- M201 X1000 Y1200
name: Restore Normal Settings
collapsed: true
layout: horizontal
name: Quality and speed overrides
- children:
- command: M106 S%(speed)s
input:
- default: 255
name: Speed (0-255)
parameter: speed
slider:
max: 255
min: 0
name: Enable Fan
- command: M107
name: Disable Fan
layout: horizontal
name: Fan
- children:
- commands:
- M109 S%(temp)
input:
- default: 200
name: Temp (200-300)
parameter: temp
slider:
max: 300
min: 200
name: Set Temperature
feature: {}
gcodeViewer: {}
plugins:
ScreenSquish:
octoprint_max_version: ''
_disabled:
- slicer
- printhistory
- touchui
announcements:
_config_version: 1
channels:
_blog:
read_until: 1500983100
_important:
read_until: 1521370800
_octopi:
read_until: 1499253000
_plugins:
read_until: 1506297600
_releases:
read_until: 1508162400
enabled_channels:
- _important
cura:
cura_engine: /usr/local/bin/cura_engine
discovery:
publicPort: 80
upnpUuid: a5a7ec43-d6c7-4dbe-bbc8-9e6d741af2e7
mgsetup:
activated: true
currentPrintElapsedTime: 1609563460.0
currentPrintStartTime: 1609557303.0
currentProjectMachineFailTimeFriendly: 0:00:00
currentProjectPrintFailTime: 247540.0
currentProjectPrintFailTimeFriendly: 2 days, 20:45:40
currentProjectPrintSuccessTime: 1117370.997247219
currentProjectPrintSuccessTimeFriendly: 12 days, 22:22:50
localFirmwareVersion: '"1.1.6.1.1"'
nextReminder: 1570107810.0
printing: true
registered: true
serialNumber: MV674M98
totalMachineFailTimeFriendly: 0:00:00
totalPrintFailTime: 247540.0
totalPrintFailTimeFriendly: 2 days, 20:45:40
totalPrintSuccessTime: 1117370.997247219
totalPrintSuccessTimeFriendly: 12 days, 22:22:50
softwareupdate:
_config_version: 6
check_providers:
autoscroll: autoscroll
autoselect: autoselect
customcontrol: customControl
ipOnConnect: ipOnConnect
octoprint_mgsetup: mgsetup
octoprint_nautilus: mgsetup
printhistory: printhistory
slicer: slicer
touchui: touchui
checks:
octoprint:
checkout_folder: /home/pi/OctoPrintMG
prerelease: false
prerelease_channel: null
user: MakerGear
printerParameters: {}
printerProfiles:
default: _default
serial:
additionalPorts:
- /dev/ttyS0
autoconnect: true
baudrate: 115200
disconnectOnErrors: false
log: true
port: /dev/ttyS0
timeout:
communication: 60.0
connection: 30.0
sdStatus: 10.0
server:
commands:
serverRestartCommand: /home/pi/.octoprint/scripts/resetOctoprint.sh
systemRestartCommand: /home/pi/.octoprint/scripts/resetRpi.sh
systemShutdownCommand: /home/pi/.octoprint/scripts/shutdownRpi.sh
firstRun: false
onlineCheck:
enabled: true
pluginBlacklist:
enabled: true
secretKey: jROTHQkiJoH6u5wLeLs2YiRU0wIrv8Fb
seenWizards:
cura: null
slicing:
defaultProfiles:
cura: pla-no-support
system:
actions:
- action: reset_rambo
command: /home/pi/.octoprint/scripts/resetRambo.sh
confirm: You are about to reset the rambo.
name: Reset RAMBo
temperature:
cutoff: 5
profiles:
- bed: '115'
extruder: '265'
name: ABS
- bed: '70'
extruder: '215'
name: PLA
terminalFilters:
- name: Suppress temperature messages
regex: '(Send: (N\d+\s+)?M105)|(Recv: ok (B|T\d*):)'
- name: Suppress SD status messages
regex: '(Send: (N\d+\s+)?M27)|(Recv: SD printing byte)'
- name: Suppress wait responses
regex: 'Recv: wait'
- name: Suppress busy:processing
regex: 'Recv: echo:busy: processing'
webcam:
ffmpeg: /usr/bin/avconv
snapshot: http://127.0.0.1:8080/?action=snapshot
stream: ''
I have run it through an online YAML validator, so I know it's valid YAML, but apparently the server has other ideas. Any help would be appreciated.
TIA,
Frank