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

Mesh node assistance request #232

Open
Boushikage opened this issue Apr 15, 2023 · 5 comments
Open

Mesh node assistance request #232

Boushikage opened this issue Apr 15, 2023 · 5 comments

Comments

@Boushikage
Copy link

I'm an AI enthusiast, and have been for 20+ years now, but I never learned to code (to me it's a bunch of passwords hidden in clever google search terms that I'm not about to try and memorize all of... but do anyway, like 'sudo update-alternatives --config java'). I've worked with Syn AI and Braina before this one (and a few third party frameworks in between), but your framework is easily the best and most versatile. Better than mycroft by far. In fact, just based on the variability of Sepia, it's shaping up to be something I'll work with for the rest of my life (Virtual machine and rooted android phone to keep usability as things upgrade)... But I have an issue.
I've opened mesh on both windows and linux, jdk and ojdk 11 respectively, and get a "uuuh, I need to research..." with HelloPlugin. I've tried everything I could think of (not coder, tinkerer, script kiddie), to include pulling your prior runtime plugin (2020 mesh master folder), only to be met with my saved fail output... which is better than the uhh response...? I can ghostevent in linux, and I'm game to learn how to create batch files (just command line language learning) in windows, but I cannot make sepia reach out to anything outside of itself. Simple volume changes don't work on "client control" for the app, can't mesh, and I have absolutely no idea how to create android or windows intents, which, if I researched correctly, work on mesh nodes anyway, so... I'm so lost. If I could make it change one thing on one other platform, I could theoretically create an automation based on that change, but I cannot make it do it. I've scoured the nets for examples of mesh nodes (2020 runtimeplugin et al), but there's brutally little to find, pretty sure I did everything right, no firewall on mesh node host, and having taken that one intro Java class in college a decade ago does not help. Might I have an assist in making sepia create... something, on the tertiary server via mesh node? Even a new text document or alterations to a current one, just something I can make to be translated by a 'server (or windows) system automater' into a trigger for an event?... I just need it to happen once. Off of a clean install would be preferred. Sorry to ask.

@fquirin
Copy link
Contributor

fquirin commented Apr 19, 2023

...but your framework is easily the best and most versatile. Better than mycroft by far. In fact, just based on the variability of Sepia, it's shaping up to be something I'll work with for the rest of my life

thanks a lot, happy you like it 😃

I've tried everything I could think of (not coder, tinkerer, script kiddie), to include pulling your prior runtime plugin (2020 mesh master folder), only to be met with my saved fail output...

Can you explain a little bit more detailed what you've done here? What I understand is that you can't even run the 'HelloPlugin' test right now?

I cannot make sepia reach out to anything outside of itself

So you can't get contact to any of your Mesh-Node servers?

Simple volume changes don't work on "client control" for the app, can't mesh, and I have absolutely no idea how to create android or windows intents, which, if I researched correctly, work on mesh nodes anyway, so... I'm so lost.

There are a few examples for Android intents here: Teach-UI examples. Unfortunately with Android 11 (or 12) intents have become more complicated because Android now refuses all intents that are not explicitly added to the App manifest before sending it to the Google Store ... and usually Google is very restrictive what they will allow. Maybe I'll have to make another APK for side-loading with more permissions in the future 🤔.

To control Windows you'll indeed need the mesh-node server and a plugin that can run your windows commands (in the simplest case this is just a batch-file).

Unfortunately there is really not much documentation about the Mesh-Node server. In the last years I've hardy every used it because most of the devices I control can be handled via Smart Home HUBs like openHAB etc., but here is a new setup section I'm preparing for the Mesh-Node readme. Hope it helps:

  • Copy the sepia-mesh-nodes folder from your SEPIA installation/release package to make sure you have a compatible version.
  • Open the folder on your target machine and go to the Settings folder. Here you'll find 3 config files for 'test' (node.test.properties), 'live' (node.properties) and 'custom' (node.custom.properties) setups.
  • Have a quick look at node.custom.properties. You can use the config files to set a different server port and change the security settings etc..
  • Use bash run.sh (Linux) or double-click run.bat (Windows) to start the server in 'custom' mode (flag --custom or --my) or check the run command and change the type flag as needed (--live or --test)
  • User the 'Server Connections' page of your SEPIA Control-HUB app to check if you can reach the Mesh-Node server.
    Alternatively you can simply type this Mesh-Node server URL in your browser to see if it responds: http://[IP-or-domain]:20780/ping.
  • Use the 'Code-UI' page of your SEPIA Control-HUB to upload new plugins.
  • Check the sepia-mesh-nodes/log.out file for events and errors.

And here is some info about the Mesh-Node config:

server_port - Server port
enable_CORS - Allow cross-origin requests to the server
use_sandbox_security_policy - Restrict certain system calls and security critical methods in your plugins
use_plugins - Enable/disable plugins
plugins_require_authentication - Require proper authentication when using plugins
plugins_required_user_role - A role required by a user to use Mesh-Node plugins (Check 'User Management' page in your Control-HUB for user roles)
plugins_require_localhost - Restrict plugins to localhost requests (same machine as server)
plugins_require_pin - Use a security PIN for plugins?
host_files - Enable/disable file-server (Mesh-Node can act as very simple web-server for example)
privacy_policy - URL to your own privacy policy. Relevant if you host a public server.
mesh_id - A unique ID for the server.
allow_internal_calls - Allow API-to-API authentication via mesh_id
allow_global_dev_requests - Restrict certain developer-specific requests to private network
server_local_name - Name of the server
server_local_secret - Secret to validate server (/validate endpoint with challenge)
server_access_pin - Access pin for non-critical data e.g. to statistics
assist_endpoint_url - URL to main SEPIA assist-server (usually on port 20721 or via '.../sepia/assist' path)
module_authentication - Module used for authentication of requests

@Boushikage
Copy link
Author

I've tried everything I could think of (not coder, tinkerer, script kiddie), to include pulling your prior runtime plugin (2020 mesh master folder), only to be met with my saved fail output...

Can you explain a little bit more detailed what you've done here? What I understand is that you can't even run the 'HelloPlugin' test right now?

I'd attempted helloplugin, and your depreciated 2020 plugin (can't remember the name), as a mesh net search opens forums for using the prior plugin.

So you can't get contact to any of your Mesh-Node servers?

I reconfigured the mesh node to 123456 (the pin sepia auto-starts with), and it can contact any mesh (tried on windows and debian), but when I try to make hello plugin work, it just doesn't. It doesn't even display the fail statement I put in place. Just "uhh, I need to do research" or something similar. The 2020 plugin you made does show my fail statements though... so I thought I was getting closer... but I still can't make that plugin work either. Connections within Control Hub see's the servers fine, no issues with pin or connection, but my code (exact copy of your hello plugin), just doesn't work. I learned Java years ago, kinda, and can understand the theory of the code, but if I can't implement it, I can't change it to learn it.

I use HAOS for phillips lighting and smart home control, as it would have worked with mycroft, were mycroft less call-home-y. But HAOS is a pain, as my only working server (blade takes too much power) doesn't have efi boot options. I didn't want to use external programs with sepia, as I was more concerned with framework to learn and write into, rather than bundling multiple applications. But as HAOS is KAPUT, I think I'll try your OpenHab solution first, and squirrel around with the connection to that, as it still does the same thing. And figure out why Minecraft is on it's list of smart control applications next to phillips hue... weird.

Sorry for the belated replies, I'm really crunched over here, and probably had no business messing with sepia, let alone contacting it's author. Unrelated-ly, since I have your attention anyway, I love the mood and repetition variables. If mood reads as intended, it will be nice to add familiarity and/or contempt based on responses and time passed.

Thanks again for a great program.

@fquirin
Copy link
Contributor

fquirin commented Apr 21, 2023

The 2020 plugin you made does show my fail statements though... so I thought I was getting closer... but I still can't make that plugin work either

If your modified HelloPlugin shows the message you've entered I'd say you "made it work" ^^. Or was it supposed to do anything else that didn't happen?
Did you check the log.out file I mentioned earlier? It should be in your Mesh-Node folder. Maybe you see some error messages.
If you like you can post your code here as well. Maybe I can spot the issue.

I didn't want to use external programs with sepia, as I was more concerned with framework to learn and write into, rather than bundling multiple applications.

The Mesh-Node server is a nice tool to integrate stuff that has no other connections yet, but if you want to control smart home devices I'd recommend to use one of the supported big, open-source smart home HUBs (openHAB, HA, FHEM, ioBroker, maybe even Node-Red), they really make life easier. Personally I prefer openHAB, because it has the best API for integration into SEPIA. The UI can be a bit confusing sometimes, but documentation is ok and the whole server runs on Java as well so you can just drop it next to SEPIA and it will run :-).

And figure out why Minecraft is on it's list of smart control applications next to phillips hue... weird

🤣 I have no idea

Sorry for the belated replies, I'm really crunched over here

Don't worry I know the feeling ;-). Since I do all this in my spare time it can take me a while to respond as well, but I will eventually 😅.

I love the mood and repetition variables. If mood reads as intended, it will be nice to add familiarity and/or contempt based on responses and time passed.

Yeah it was one of the first things I've implemented, actually SEPIA inherited the idea from it's "ancestor" ILA 🙂. I always wanted to extend the mood system and even add different personalities, but there always was something more important to extend or fix first 🙈. You can control the mood though by saying things like "I hate you" or "I like you" and if there are answers defined for multiple moods (like "how are you?") you should see the difference ^^.

@Boushikage
Copy link
Author

no joy on openHAB. Doesn't cover my lighting solution, go figure. Got HA working on same machine on vm alongside sepia, yay, but can't connect (invalid authorization). I'd been hoping to directly control computers, and use programs like linux's ghostevent, or a phone's tasker to automate processes, but haos doesn't like connecting to sepia, and I don't think haos can reach out to pc that way anyway (no addons seem sufficient). Bust after bust. One day... Some day...

@fquirin
Copy link
Contributor

fquirin commented Apr 24, 2023

no joy on openHAB. Doesn't cover my lighting solution, go figure

Ah crap, I thought all lighting systems were solved these days :-/.

Got HA working on same machine on vm alongside sepia, yay, but can't connect (invalid authorization)

Did you follow the steps from the SEPIA Wiki and used the long-lived auth. token in HA?
HA integration is not as elegant as openHAB but should still work.

I'd been hoping to directly control computers, and use programs like linux's ghostevent, or a phone's tasker to automate processes

I've thought about adding "Tasker" and "Automate" to the white-list of apps in the Android manifest so the SEPIA app can talk to them directly (required since Android 11 unfortunately), although I don't now enough about these apps yet to understand whats the range of intents they can accept and handle.
Do you have a link to "ghostevent"? I couldn't find anything online that looked like a fit, just an old version of EventGhost for Windows with a lot of broken links. In general I think what you want to do is possible with e.g. the Mesh-Node server, depending on the program itself of cause. Many programs don't really have any interfaces for external control.

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

2 participants