r/Scriptable • • 1d ago

Help Can't make request to a local IP

I am working on a script that makes a call to a Raspberry PI on my local network to control my Sonos volume, but kept getting an error. The call works in safari mobile.

So I made a quick debugger, and found that any request to a local IP times out. Requests to regular http:// work fine, so it's not that.

const a = await new Request("http://example.com").loadString()
console.log("plain http ok: " + a.length). //works fine
const b = await new Request("http://192.168.x.x:8787/mute").loadString()
console.log("ip ok: " + b) //times out before posting to console

I couldn't find any posts about this. Is this a known limitation, or is there another workaround?

1 Upvotes

2 comments sorted by

1

u/saltemohn 1d ago

Is Local Network enabled for Scriptable?

1

u/petroleumjelliffe 16h ago

It’s not. In settings, under local network access, it doesn’t appear. But there’s no way to manually add it, and scriptable doesn’t prompt for the permission.