IndigoDomotics / Beacon

Plugin for Perceptive Automation Indigo to interface Geohopper/Geofancy/other third party geofencing and iBeacon apps
The Unlicense
2 stars 3 forks source link

Update to Python 3? #5

Closed jltnol closed 2 years ago

jltnol commented 2 years ago

Just curious if there are any plans to update this plugin to Python and future versions of Indigo? I actually rely on this plugin quite a bit, and I'm guessing lots of others do as well.

More curious than anything...

FlyingDiver commented 2 years ago

I did a quick and dirty conversion. Please test this version: https://github.com/FlyingDiver/Indigo-Beacon/releases/tag/2022.0.0

jltnol commented 2 years ago

Super! I've downloaded and have installed. will post over the next few days how things are going. This is one of the main plugs I use for Home/Away in Indigo, so several times a day I depend on this to work. Thanks again for working on this.

FlyingDiver commented 2 years ago

I have no way to test that plugin, so enable Debug logging and post the log info if you have any issues.

jltnol commented 2 years ago

So just FYI, I’ve installed the new version and now have a RED DOT in the Indigo Plugin Menu. Haven’t “tested” anything yet and suppose the Red just might indicate the “beta” status of this.. but just wanted to pass this info along.

Will run some tests later today and report back.

ALSO.. would you rather I post on GitHub?

Jeffrey

On Jul 28, 2022, at 9:56 AM, Jeffrey Talbot @.***> wrote:

Absolutely!

Thanks for your help on this.

Jeffrey

On Jul 28, 2022, at 9:50 AM, Joe Keenan @. @.>> wrote:

I have no way to test that plugin, so enable Debug logging and post the log info if you have any issues.

— Reply to this email directly, view it on GitHub https://github.com/IndigoDomotics/Beacon/issues/5#issuecomment-1198250479, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAMEY7WG333WRDTFONOEH6TVWKM3PANCNFSM543S5ZKQ. You are receiving this because you authored the thread.

FlyingDiver commented 2 years ago

Replying to the email does post on GitHub, but the formatting gets messed up. So better to post directly.

Red dot means an error of some kind. I need the log info.

jltnol commented 2 years ago

Here you go: Reloading plugin "Beacon 2022.0.0" using API v3.0 Starting plugin "Beacon 2022.0.0" (pid 52340) Beacon Error Error in plugin execution InitializeMain:

File "plugin.py", line 7, in type: cannot import name 'parse_qs' from 'cgi' (/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/cgi.py)

Stopping plugin "Beacon 2022.0.0" (pid 52340) Stopped plugin "Beacon 2022.0.0"

FlyingDiver commented 2 years ago

https://github.com/FlyingDiver/Indigo-Beacon/releases/tag/2022.0.1

FlyingDiver commented 2 years ago

I'm seeing more deprecated function calls in the docs, but I think it's still ok for Python 3.10. It'll need more work for 3.11.

jltnol commented 2 years ago

Updated to to 2022.0.1 version.. still have red dot: Reloading plugin "Beacon 2022.0.1" using API v3.0 Starting plugin "Beacon 2022.0.1" (pid 53620) Beacon Error Error in plugin execution InitializeMain:

File "plugin.py", line 9, in type: No module named 'simplejson'

Stopping plugin "Beacon 2022.0.1" (pid 53620) Stopped plugin "Beacon 2022.0.1"

FlyingDiver commented 2 years ago

That you need to install for Python3: pip3 install simplejson

jltnol commented 2 years ago

Ok.
got that done

Jul 28, 2022 at 11:21:05 AM Reloading plugin "Beacon 2022.0.1" using API v3.0 Starting plugin "Beacon 2022.0.1" (pid 54116) Beacon Error Error in plugin execution InitializeMain:

File "plugin.py", line 10, in type: No module named 'BaseHTTPServer'

Stopping plugin "Beacon 2022.0.1" (pid 54116) Stopped plugin "Beacon 2022.0.1"

And on a whim, tried pip3 install BaseHTTPServer to no avail.

FlyingDiver commented 2 years ago

https://github.com/FlyingDiver/Indigo-Beacon/releases/tag/2022.0.2

jltnol commented 2 years ago

Ok! Green Light. I've got a few things to do around the house right now, but will head out for a test very shortly. Again, thanks for your help on this.

jltnol commented 2 years ago

So not sure if I'm going to do a good job of explaining, but I have 2 different apps on my phone, one is Geofency and the other is Locative. With the new version of the plugin, I'm getting error messages from the apps on my phone that they could not connect with the server. If I replace the new version of the plug with the old, and reload it, that error goes away, and everything works again. At first I thought this may be some kind of plumbing issue, but swapping out the versions of the plugs tells me that isn't the case. Of course, there is no info in the Indigo Log, since the iPhone apps can't connect to the server.

FlyingDiver commented 2 years ago

Ok, tis is getting more complicated than I hoped. I'll try to find time to dive into this, but no promises. A couple questions - is anything else needed for this, other than the phone apps? And why two apps? What do they do differently?

jltnol commented 2 years ago

So I understand the complication issue. I'm really hoping this kind of location data can be cooked into the Indigo iOS app sooner or late, as I'm sure a lot of people use location data to have Indigo do stuff for them.

AFAIK, nothing else is needed... the app sends out a message to Indigo when a boundary is crossed, the plugin gets the message and responds accordingly. Nothing else on my phone, nothing else in Indigo. I just have port forwarding setup on my router for port 6192 to send incoming data to the Indigo Server.

I started with Geofency, but ran into some issues a few years back so switched over to Locative. In practice, I only use Locative these days. Since both apps are on my phone, I decided to test both, assuming others may use one or the other ...and thought testing both would clear up any issues with either one.

The two apps have a slightly different UI, but basically work the same. I'm way over my head, but both seem to use POST JSON to work. Without knowing much about the tech behind all this, it would seem that the plugin either isn't "listening" at all, or isn't listening on port 6192....but could easily be a much deeper issue. As always, thanks for your time looking into this, and don't hesitate to ask for more info if/when necessary.

FlyingDiver commented 2 years ago

When I get time I'll install Locative and try it myself.

FlyingDiver commented 2 years ago

Can you post a screenshot of your Locative Geofence?

FlyingDiver commented 2 years ago

Also, I'm seriously considering changing this to use the Indigo Reflector and not require the port forwarding. That would make it a lot simpler.

jltnol commented 2 years ago

So this is a screen shot of Locative... basically a list of the boundaries I've set up.

IMG_9568

And this is a screen shot of the setting for one of the boundaries. Note the URL I use to send data back to the Indigo Server

IMG_9569

GeoFency works basically the same. Moving to the Reflector sounds like a good idea to me. I don't use it now, but no reason why I can't!

FlyingDiver commented 2 years ago

Got it working with reflector using Locative. I'd like to test some other apps but I can't seem to find them on the store. If you want to try it, grab the latest commit at https://github.com/FlyingDiver/Indigo-Beacon

You need to an a reflector API key to the plugin config in place of the port number. And then change the URL in the mobile apps to what's printed in the Indigo log on startup.

jltnol commented 2 years ago

So I am far from being knowledgeable about GitHub... I've clicked on the link in the previous email but am not sure where to go from there. I've click on the Green CODE button but it downloads 2022.0.2... am not sure that's the latest version.

I've managed to get my Reflector setup and can use it via the Touch app to log into my Indigo sever, and have authorized and have generated the REST API key, and have entered it into the Plugin Config. I have my new URL in my apps on my phone where my previous URL went, but does the Reflector still use POST JSON to work? Aside from the API key, what else do I need to add/change to the configuration for this to work?

FlyingDiver commented 2 years ago

I didn't update the version number, so it would still be 2022.0.2. If the config dialog shows API key instead of Port, then you have the right version.

The reflector passes through whatever you had before, so POST is still correct. On the Locative Settings screen there's a "Send Test-Request" button. If you press that you should see output from the plugin in the log (in debug mode).

FlyingDiver commented 2 years ago

Closing issue, as the replacement is nowavailable for users to test. Continue discussion here:

https://forums.indigodomo.com/viewtopic.php?f=216&t=26416&p=212606

jltnol commented 1 year ago

Absolutely!

Thanks for your help on this.

Jeffrey

On Jul 28, 2022, at 9:50 AM, Joe Keenan @.***> wrote:

I have no way to test that plugin, so enable Debug logging and post the log info if you have any issues.

— Reply to this email directly, view it on GitHub https://github.com/IndigoDomotics/Beacon/issues/5#issuecomment-1198250479, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAMEY7WG333WRDTFONOEH6TVWKM3PANCNFSM543S5ZKQ. You are receiving this because you authored the thread.