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

Error with new version #4

Closed
derletztename opened this issue Jun 27, 2018 · 18 comments
Closed

Error with new version #4

derletztename opened this issue Jun 27, 2018 · 18 comments

Comments

@derletztename
Copy link

Hi Eugene,
thanks for updating your great MLH. For reasons I don't understand it does not run.
I switched from the online server to a local version as I am very offgrid with my farmbot and there always was an issue with the roaming data amount.
So it's the first time I try your new farmware and your farmware on my new server. But I guess the server should not be a problem? I tried to reconnect as suggested, it does not help.

mlh_error

@etcipnja
Copy link
Owner

Hello, this means the API_TOKEN that your raspberry pi gave to firmware is not good for your server

Did you try other Farmware? The problem shall be universal

Eugene

@derletztename
Copy link
Author

Thank you for the comment.
I only tried the "first-party", the original farmware like "take photo". This one worked fine. Is this a hint that farmware works in general or do you suggest to test another "selfmade" farmware?

@derletztename
Copy link
Author

After talking to a coder friend and looking here: [(https://developer.farm.bot/docs/farmware)]:
Do I have to do something on a local server to get non first party farmwares to run? Maybe set the API token somehow myself?

@AscendFB
Copy link

AscendFB commented Jul 1, 2018

Looks like the MLH farmware sends the token request directly to "my.farmbot.io".
@derletztename Sadly I don't have a local server running. You would need to test out some fixes for us.

@etcipnja I forked your MLH repository. If it works I'll open a pull request :)

@derletztename
Copy link
Author

derletztename commented Jul 1, 2018

Hi again,
I had some other issues while trying to update my local server as recommended by RickCarlino, which failed at first because of github merging issues. Now it's up to date, but still the same error for MLH. I also tested the selfie farmware and got the same error.
I'd love to try out your suggestions, I just hope it doesn't kill the farmbot. I mostly can't repair it myself softwarewise ;)
@etcipnja so you don't use your own server local either?

@Klimbim1
Copy link

Klimbim1 commented Jul 1, 2018

Hoi gents, having similar issues with MLH, see FB forums as well...

@etcipnja
Copy link
Owner

etcipnja commented Jul 2, 2018

@AscendFB you right. I send it directly to "my.farmbot.io". I am currently on vacation and don't have access to my dev platform.
Try to see where I assign ""my.farmbot.io" to a variable. Somewhere around this code I decode this URL from API_TOKEN, but I am not using it, instead I assign the hardcoded value.
This is not compatible with the local server.

@etcipnja
Copy link
Owner

etcipnja commented Jul 2, 2018

@derletztename I am not using local server.

@derletztename
Copy link
Author

I hope you have a great vacation and also be back soon ;) :D

@derletztename
Copy link
Author

So is it just line 98 self.api_url='https://my.farmbot.io/api/' in Farmware.py, that has to be changed and it would run on a local machine?

@etcipnja
Copy link
Owner

@derletztename Hi, I am back home!
I don't have a local server but if I understand the issue correctly you just need to uncomment the
first line and comment the second.
'''
#self.api_url = 'https:'+token['iss']+'/api/'
self.api_url='https://my.farmbot.io/api/'
'''
probably you already figured it out. I am still catching up with my staff and will post the official update after more testing.

Thank you,
Eugene

@etcipnja
Copy link
Owner

etcipnja commented Aug 6, 2018

2.4.13 shall fix this issue. I am unable to verify it because I do not run the local server. However I am getting the URL from the API_KEY now and it shall fix it.

@etcipnja etcipnja closed this as completed Aug 6, 2018
@derletztename
Copy link
Author

derletztename commented Aug 6, 2018

Thx so much Eugene.
I will try this out and give feedback. Right now my farmbot server is at home because I can't figure out why it keeps crashing, something with the both services running and losing contact to each other maybe (https://forum.farmbot.org/t/local-webserver-failure/3689/14).
But it will be back on the field soon

@derletztename
Copy link
Author

I tried it out today and got this error. But also the server crashed again shortly after, so I am not 100% sure what is the reason for the farmware error.
mlh_error

Do you know what the error message means, what caused that error? That would be helpful anyways

@etcipnja
Copy link
Owner

etcipnja commented Aug 8, 2018

@derletztename I am puzzled. Never saw this error before. Looks like very basic problem - this exception happened before Farmware was able to print anything.

@derletztename
Copy link
Author

derletztename commented Aug 9, 2018

Tried it again and am certain, that the server has not crashed this time.
Same error. Though I guess, the Homebrew Server work with http instead of https and therefore there is the SSL error coming up. Maybe exchaning https with http in the code migth do the trick?

mlh_error_2

I have forked a version and changed it and will head of the the field to test it now

@derletztename
Copy link
Author

Yes, exchanging https with http makes it working for self hosted servers :)

@etcipnja
Copy link
Owner

@derletztename I tried to drop https in the farmware - it doesn't work for the hosted solution.
So if you want to use MLH with your private server (and probably other farmwares) you have 2 options:

  • fork MLH and patch it replacing https with http. You probably need to do the same for other farmware you plan to use
  • install certificate on your private server

The later is the right way to go, but it will be not piece of cake. On the positive note - you'll get a lot of new knowledge.
Heads-up: self signed certificate would require to install root certificate on all devices you plan to use as a client (otherwise security exception will be generated). Probably the most straightforward way would be to spend some money in order to get the certificate from a trusted source.

Thank you,
Eugene

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