Closed gts1117 closed 11 months ago
Looks like you need an API key. Maybe you do and you redacted it?
And are you running the software locally at 127.0.0.1? That's localhost and not what I would expect for setup.
Yes, I redacted the API key for privacy.
As for 127.0.0.1, that's the address that OctoPrint gives me when I go into the settings for snapshots, so that's what I put into the plugin. Does it need to be something else?
I'd have expected it to be the LAN IP address of your printer. More like the script defaults:
But I do not have a printer so I am only going on what the code seems to do (remote control the printer using the same interface as OctoPrint, not control OctoPrint).
I had tried that at first, but it was still throwing errors at me. I'g going to try setting a static IP when I get back into work next week and see if that helps at all.
There is no guess work or trying involved. You just need to find the printer IP.
There's apparently some guesswork and trying involved, giving the Pi a static IP and entering that IP into the plugin file still gives me an ENDPOINT error.
Let's see if we can figure this out using logic. Happy to help troubleshoot.
Please copy and paste error messages here.
All that the menubar error says is "please edit this file and change ENDPOINT."
Within the plugin file, I have it set to:
APIKEY="myapikey" ENDPOINT="http://http://192.168.5.15/:5000" SNAPSHOTURL="http://http://192.168.5.15/:8080/?action=snapshot" IMAGEWIDTH=300x
Within OctoPrint, the snapshot url it gives me is "http://127.0.0.1:8080/?action=snapshot"
The IP address of my Pi has been set to a static IP of 192.168.5.15
Is there any other info that would be useful?
OK, so there are two http:// in each URL, and extraneous forward slash /
127.0.0.1 is local to your computer, which makes sense for the software running on it to refer to itself. But not to point to your printer, for that the 192.168 is LAN address which makes sense as the address of something else on your network like your printer.
What happens changing the below two lines?
ENDPOINT="http://192.168.5.15:5000"
SNAPSHOTURL="http://192.168.5.15:8080/?action=snapshot"
..........Let's pretend that never happened. Jeez myself.
So that totally fixed the ENDPOINT error, now it's throwing "parse error: Invalid numeric literal at line 1, column 10" at me over and over.
assuming the error is about the script itself (it may not be you'd need to check the full error message) then line 1, column 10 is the end of line 1?
what line endings does the file have? how dod you initially create the file?
The only think on line 1 is
!/bin/bash
If I understand what you mean by line endings, some of them end in curly brackets {} some in square [] some in semicolons, some with nothing special.
All I did to create the file was download the plugin script from the BitBar repository.
So line endings in my meaning are whether the hidden character signalling the end of a line is of Windows or Unix (macOS) format. You'd only see this by using an editor that support showing you that information, like BBEdit.
First line error must be something else. Very odd.
What I will do is prepare you a file as I would do it and see if it works for you. octoprint.1m.sh.zip
Let me know if this is any different.
I've been using Visual Studio Code to view and edit the plugin file.
Except for the API key, your file is the exact same as what I have and throws the same errors at me.
Also thank you very much for helping troubleshoot this with me.
OK, we need to get the error in more detail.
Can you run the plugin script from Terminal?
Yep, here's what I get running from Terminal
myComputer:~ myUsername$ /Users/myUsername/Documents/BitBar\ Plugins/octoprint.1m.sh
parse error: Invalid numeric literal at line 1, column 10
parse error: Invalid numeric literal at line 1, column 10
parse error: Invalid numeric literal at line 1, column 10
| color=black
---
parse error: Invalid numeric literal at line 1, column 10
parse error: Invalid numeric literal at line 1, column 10
hotend:?C bed:?C | color=black
parse error: Invalid numeric literal at line 1, column 10
parse error: Invalid numeric literal at line 1, column 10
octoprint: api: | color=green href=http://192.168.5.15/:5000
convert: no decode delegate for this image format `' @ error/constitute.c/ReadImage/556.
convert: no images defined `-' @ error/convert.c/ConvertImageCommand/3273.
| image= refresh=true
---
parse error: Invalid numeric literal at line 1, column 10
In hindsight, that's not useful as it's not running through BitBar. Will need to have a think.
No rush, and thank you again for your assistance.
Closing due to age.
FAO: (@m0a)
I keep getting an ENDPOINT error, this is what I have in the file.
please setup
APIKEY="myapikey" ENDPOINT="http://127.0.0.1:5000" SNAPSHOTURL="http://127.0.0.1:8080/?action=snapshot" IMAGEWIDTH=300x
Any and all suggestions are greatly appreciated.