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

ERR GET IMAGE with WebCam #432

Open
cankurall opened this issue Nov 11, 2024 · 7 comments
Open

ERR GET IMAGE with WebCam #432

cankurall opened this issue Nov 11, 2024 · 7 comments

Comments

@cankurall
Copy link

Hello, I'm running Octo4a on a tablet. I’ve directed my computer's camera over IP using the Yawcam application. There’s no issue with live or snapshot images on Octoprint, and I can also view them in my browser. However, the Telegram bot is not transmitting any images and instead sends the message '[ERR GET IMAGE]'. Could you please help me with this?

chrome_45ggK06MvK
chrome_i5LbJ9AVFi
chrome_lAdjZ8ZmC7

Telegram:
Telegram_iwuiE2mHjL

@tsujovolsky
Copy link

I'm getting the same errors using octoprint for windows and yawcam. In addition to what @cankurall is getting, here are also the logs:

2024-11-21 10:00:07,429 - octoprint.settings - WARNING - DeprecationWarning: Detected access to deprecated settings path ['webcam', 'snapshot'], returned value is derived from compatibility overlay. Please use the webcam system introduced with 1.9.0, this compatibility layer will be removed in a future release.
2024-11-21 10:00:07,430 - octoprint.plugins.telegram - DEBUG - Snapshot URL: http://192.168.1.11:1111/api/frame.jpeg?src=webcam1
2024-11-21 10:00:07,560 - octoprint.plugins.telegram - DEBUG - Image transformations [H:None, V:None, R:None]
2024-11-21 10:00:07,561 - octoprint.plugins.telegram - DEBUG - message so far: [ERR GET IMAGE]

2024-11-21 10:00:07,561 - octoprint.plugins.telegram - DEBUG - Sending without image.. 605302509

It takes my snapshot url as http://192.168.1.11:1111/api/frame.jpeg?src=webcam1 whereas the actual one is http://192.168.1.11:8888/out.jpg?action=snapshot

@giloser
Copy link
Collaborator

giloser commented Jan 3, 2025

Hi ,

could you try this version please?
https://github.com/giloser/OctoPrint-Telegram/archive/refs/tags/1.6.9.zip

@gDanix
Copy link

gDanix commented Jan 16, 2025

Hi! I've installed Octoprint today and stumbled upon this problem today.

Nothing worked, and I thought to myself: "Heck, Octoprint is returning invalid URLs. This is too much to debug, let's hardcode the appropriate URL and call it the day"

The code (which is inserted in the place of this line that sets the URL):

self._logger.debug("get_webcam_configurations : " + str(config))
self._logger.debug("Camera URL hardcoded to http://10.100.100.5:8082/snapshot")
#url = config.snapshotDisplay
url = "http://10.100.100.5:8082/snapshot"
self._logger.debug("cam conf URL : " + str(url))

The resulting log messages:

2025-01-16 22:11:07,679 - octoprint.plugins.telegram - DEBUG - self.snap_new_method : True
2025-01-16 22:11:07,681 - octoprint.plugins.telegram - DEBUG - cameras {'classic': <octoprint.webcams.ProvidedWebcam object at 0xffff5c0279d0>}
2025-01-16 22:11:07,683 - octoprint.plugins.telegram - DEBUG - camera : classic
2025-01-16 22:11:07,686 - octoprint.plugins.telegram - DEBUG - get_webcam_configurations : name='classic' displayName='Classic Webcam' canSnapshot=True snapshotDisplay='http://10.100.100.1:1111/snapshot' flipH=False flipV=False rotate90=False extras={'stream': 'http://10.100.100.1:1111/stream', 'streamTimeout': 5, 'streamRatio': <RatioEnum.sixteen_nine: '11:1'>, 'streamWebrtcIceServers': ['stun:stun.l.google.com:19302'], 'cacheBuster': False} compat=WebcamCompatibility(streamTimeout=5, streamRatio='11:1', streamWebrtcIceServers=['stun:stun.l.google.com:19302'], cacheBuster=False, stream='http://10.100.100.1:1111/stream', snapshot='http://10.100.100.1:1111/snapshot', snapshotTimeout=5, snapshotSslValidation=True)
2025-01-16 22:11:07,689 - octoprint.plugins.telegram - DEBUG - Camera URL hardcoded to http://10.100.100.1:1111/snapshot
2025-01-16 22:11:07,692 - octoprint.plugins.telegram - DEBUG - cam conf URL : http://10.100.100.1:1111/snapshot
2025-01-16 22:11:07,695 - octoprint.plugins.telegram - DEBUG - will try to get the snapshot from the plugin for classic
2025-01-16 22:11:07,727 - octoprint.plugins.telegram - DEBUG - set the snapshot to data to try to continue

I don't how on earth can a hardcoded value be changed after an installation process, if someone is responsible for this and (if someone is) in what was thinking (if at all). I'm still trying (and failing) to process what I've just seen.

Good luck, @giloser trying to fix this. I'm SO done with Python and its JS-level bs...

@giloser
Copy link
Collaborator

giloser commented Jan 17, 2025

Hi,

for the URL of the camera I have similar change in my log but it doesn't seems to be a problem for me...

do you use the new camera stack?

what do you mean by nothing worked? you got message? but no image?

@gDanix
Copy link

gDanix commented Jan 17, 2025

Hi!

do you use the new camera stack?

To be precise, I checked out the code from the Pull Request #430, and then added the hardcoded URL. I think that Pull Request is your work moving the project over to the new camera stack, but I didn't investigate further.

what do you mean by nothing worked? you got message? but no image?
Yes, exactly, I got the message, but instead of the image, I got the [ERR GET IMAGE] text prepended to the message.

Just for your information, in my setup there exists a 10.100.100.1 host, but there's no software in it listening from port 1111. It seems like [the "something" that is magically changing hardcoded strings] is setting to 1 the last digit of the last number of the IP (this is probably why @tsujovolsky didn't reported any issues with the IP, since their IP already ends in 1), and changing the port to 1111.

I've not done experiments trying to obfuscate the hardcoded IP, to see if it's an installation thing that is statically checking the code, or a runtime thing that is constantly checking strings, I've just uninstalled the plugin, sorry.

I'm running OctoPrint 1.10.3 with Python 3.9.2.

@giloser
Copy link
Collaborator

giloser commented Jan 17, 2025

Ok thanks for the answer

I think that PR was a first try but was still not working that why I ask to try with the link to my full version. If people confirm it's working then I'll try to create a new PR and see if we can merge it to current version.
If not I'll just continue on my version for me.
here is a link to the version where the gif should work now.

https://github.com/giloser/OctoPrint-Telegram/archive/refs/tags/1.6.92.zip

So please if you want to use the plugin try this version and let me know.

@gDanix
Copy link

gDanix commented Jan 17, 2025

I'm sorry but I wasted too much hours yesterday and after setting everything my SBC and my instance is very slow. At this point I would look for rewrite parts of OctoPrint in a more appropriate language rather than spending more time with Python magic... Sorry

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants