Git Product home page Git Product logo

Comments (9)

roryaronson avatar roryaronson commented on July 18, 2024

This would be super useful for prototype bots that get rebooted all the time. @TimEvWw, do you know how to do this? If not, I think @RickCarlino or maybe @m3talsmith can help out?

from farmbot_os.

TimEvWw avatar TimEvWw commented on July 18, 2024

Normally this should be with the init.d but I haven't tried it yet. I'll
put in on my to-do list if nobody else wants to try.

On Fri, Nov 21, 2014 at 6:02 AM, Rory Aronson [email protected]
wrote:

This would be super useful for prototype bots that get rebooted all the
time. @TimEvWw https://github.com/TimEvWw, do you know how to do this?
If not, I think @RickCarlino https://github.com/rickcarlino or maybe
@m3talsmith https://github.com/m3talsmith can help out?


Reply to this email directly or view it on GitHub
#10 (comment)
.

from farmbot_os.

roryaronson avatar roryaronson commented on July 18, 2024

I actually tried it a few days ago with these instructions that Rick sent
me: https://gist.github.com/naholyr/4275302 but the controller would not
fire up properly.

Rick said it's because of the way some of the require statements are
written.

Maybe you will have better luck? I can also copy in my init.d file if you
want to take a look.

Here are the error messages: Hey Rick, thanks for the support. I followed
the install instructions in that gist but am running into some issues. I
kept getting permission denied for accessing the farmbot.rb, farmbot.log,
and farmbot.pid files until I set the user as root, added a sudo in front
of the 'command', and also a sudo in front of the 'service farmbot start'.
Even then, when it fires up, I get the following errors. It starts up fine
if I run it normally as the user 'pi'. You can login at [email protected]:22
if you want to poke around. password: farmbot. Errors:/\ --------- FarmBot
--------- / database /usr/lib/ruby/1.9.1/rubygems/custom_require.rb:36:in
require': cannot load such file -- ./app/models/command.rb (LoadError) from /usr/lib/ruby/1.9.1/rubygems/custom_require.rb:36:inrequire' from
/home/pi/farmbot-raspberry-pi-controller/lib/database/dbaccess.rb:5:in
<top (required)>' from /home/pi/farmbot-raspberry-pi-controller/farmbot.rb:23:in require_relative' from
/home/pi/farmbot-raspberry-pi-controller/farmbot.rb:23:in `

' Starting
service… Service startedpi@farmbot ~ $
On Nov 21, 2014 1:58 AM, "Tim Evers" [email protected] wrote:

Normally this should be with the init.d but I haven't tried it yet. I'll
put in on my to-do list if nobody else wants to try.

On Fri, Nov 21, 2014 at 6:02 AM, Rory Aronson [email protected]
wrote:

This would be super useful for prototype bots that get rebooted all the
time. @TimEvWw https://github.com/TimEvWw, do you know how to do
this?
If not, I think @RickCarlino https://github.com/rickcarlino or maybe
@m3talsmith https://github.com/m3talsmith can help out?


Reply to this email directly or view it on GitHub
<
https://github.com/FarmBot/farmbot-raspberry-pi-controller/issues/10#issuecomment-63924902>

.


Reply to this email directly or view it on GitHub
#10 (comment)
.

from farmbot_os.

RickCarlino avatar RickCarlino commented on July 18, 2024

Hi guys!

So the issue was that we have a require_relative statement somewhere that was written like this:

require_relative "./some/path/somewhere"

Should be a pretty quick fix. On that note, I really need to give a second attempt at getting my bot up and running so I can test this kind of stuff locally.

Let me know if you guys need any help with the Daemon stuff.

from farmbot_os.

TimEvWw avatar TimEvWw commented on July 18, 2024

That worked for the require_relative but not for the yml file load. So I
now fixed it with a simple shell script. I also had to modify the service
script to get it working on the RPI. There were some security issues also.
It works now for starting in the background and at boot time. Stopping or
restarting doesn't work. I've put it at

https://github.com/TimEvWw/farmbot-raspberry-pi-controller/tree/master/service

The farmbot script had to be copied to init.d with "sudo cp
/home/pi/farmbot-raspberry-pi-controller/service/farmbot /etc/init.d" After
that you can do "service farmbot start" to start it in the background
and "update-rc.d
farmbot defaults" to automatically start at boot time.

It might be possible that you have to fiddle a bit with security settings
for the file with "chmod +x /etc/init.d/farmbot"

On Fri, Nov 21, 2014 at 11:39 PM, Rick Carlino [email protected]
wrote:

Hi guys!

So the issue was that we have a require_relative statement somewhere that
was written like this:

require_relative "./some/path/somewhere"

Should be a pretty quick fix. On that note, I really need to give a second
attempt at getting my bot up and running so I can test this kind of stuff
locally.

Let me know if you guys need any help with the Daemon stuff.


Reply to this email directly or view it on GitHub
#10 (comment)
.

from farmbot_os.

RickCarlino avatar RickCarlino commented on July 18, 2024

We probably will need to store the process id in a PID file if we want to add the ability to stop/restart.

from farmbot_os.

roryaronson avatar roryaronson commented on July 18, 2024

Is this a temporary solution or should we look into daemonizing it?

I'm going to start creating image files of 'FarmBot OS' and hosting them on the wiki so that it is easy to get up to speed with a fresh install (already has farmbot and arduino code on it, everything is bundled, farmbot is a service, etc...)

from farmbot_os.

RickCarlino avatar RickCarlino commented on July 18, 2024

If we started adding status and restart commands, it could definitely be reused or loaded into a disk image for distribution.

from farmbot_os.

roryaronson avatar roryaronson commented on July 18, 2024

I got it working this way:

  1. sudo nano /home/pi/farmbot-raspberry-pi-controller/service/farmbot
    I had to change SCRIPT to '/home/pi/farmbot-raspberry-pi-controller/service/start'

  2. sudo cp /home/pi/farmbot-raspberry-pi-controller/service/farmbot /etc/init.d

  3. chmod +x /etc/init.d/farmbot

  4. sudo chmod -R 777 /var/run

  5. sudo update-rc.d farmbot defaults

from farmbot_os.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.