Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

17a fresh installation, and the start of a user installation manual.

when something works out of the box, you rarely look any further.... for me, I'm never that lucky.

on a fresh install with 17a using an USB mounted as /dev/www I get the following when running as user 'pi' :-</div>

Traceback (most recent call last):

  File "./yieldbuddy.py", line 743, in <module>

    ser.write("\n") #Send blank line to initiate serial communications

NameError: name 'ser' is not defined


If I run as root (and I have no problem doing this), then i get this:


Key: LZvzEYls0RGAhRwcG1CLIxawhs1xThF3zahiybZ6pmhS0uJRNN9KLLHupvfP1oA4

Traceback (most recent call last):

  File "./yieldbuddy.py", line 784, in <module>

    email_column = fetch_sql("SELECT * FROM Email")

  File "./yieldbuddy.py", line 43, in fetch_sql

    cursor.execute(query)















sqlite3.OperationalError: no such table: Email

Any pointed?


YieldBuddy - I'm happy to pull together a 17a user installation guide unless this is already in progress by anyone? I have a good amount of linux/os installations & integrations and modifying scripts, although by no means a coder to debug. PM me if this is something you want to formalise, as I would need your input.

Comments

  • edited February 2016
    I have the system up and running, although not populated with any of my own data to test. Hoping the following instructions may be useful to others.... I need to review once more, but in the interim, here you go.







    Using a Pi & with a SD Card and USB PEN Drive [Fresh Install]

    There are too many variations to cover particular instances…. sorry!


    Boot your Pi using NOOBS, as per downloaded here and follow the instructions.

    https://www.raspberrypi.org/help/noobs-setup/


    Insert the USB Pen drive as we will use this for the /var partition. This is because the /var/www location will have lots of read/writes, and rumour has it that SD”s don’t cope that well. For me, this is really a level of redundancy should something go wrong with your setup and should add life to the SD card.


    I find getting your PI connected to your network and SSH’ing in is the easiest to get setup, and I do this from a mac -although you can use putty for a PC.


    From a  Mac


    ssh 192.168.0.14 -l pi 


    PARTITION SYSTEM 

    sudo su -

    umount /dev/sda1

    mkfs.ext4 /dev/sda1 -L USB_DRV

    mkdir /mnt/usb_drv

    mount /dev/sda /media/pi/USB_DRV

    ln -s /media/pi/USB_DRV /var/www

    ln -s /media/pi/USB_DRV /home/pi/www


    edit the /etc/rc.local file and append the following line to the end, which ensures the USB drive is mounted everytime.

    mount /dev/sda /media/pi/USB_DRV

    sudo python /var/www/yieldbuddy/yieldbuddy.py


    INSTALL SQLITE3 (just in case :-)

    sudo apt-get -y install sqlite3



    YIELDBUDDY INSTALL

    download yield buddy by copying the download link to your clipboard, and paste below


    cd /tmp

    wget http://downloads.sourceforge.net/project/envirocontrol/yieldbuddy_v1_17a.zip?r=http://sourceforge.net/projects/envirocontrol/&amp;ts=1450628588&amp;use_mirror=netix

    unzip yield*

    sudo apt-get install dos2unix

    cd Raspberry\ Pi/

    find . -type f \! -path \*/\.svn/\* -exec dos2unix {} \;

    cd yieldbuddy/install/

    ./install.sh

    (answer y to all queries)



    POST INSTALL


    cd/tmp/

    sudo cp -R ./config/nginx/* /etc/nginx

    sudo cp -R ./config/php5/www.conf /etc/php5/fpm/pool.d/www.conf

    sudo cp -R ./config/motion.conf /etc/motion/motion.conf

    sudo cp -R ./SQLiteManager /var/www/SQLiteManager

    chmod 755 /media/pi

    chown www-data:www-data /media/pi/USB_DRV

    append ‘index.html’ to the ;index.php’ line in ‘/etc/nginx/sites-available/default’



    chnage PID to pid        /run/nginx.pid;


    MODIFY OWNERSHIP ON www

    vi /etc/php5/fpm/pool.d/www.conf (I use vi, but nano or whatever you’re used to)

    and change 

    user = www-data

    group = www-data

    to be

    user = pi

    group = pi

  • Thanks Pablo! this is great, i'll run though the steps today :)
  • any feedback let me know.... I'm still trying to get the front end to work, and how to connect devices - and will add that in due course to installers.

    Cheers,

    Pablo.
  • ok, i got a lot further then i did before. I moved the root FS to an external HDD  Then started at installing sqlite3.

    Yieldbuddy Install portion went well, but the install script still needs tweaking to complete with out errors.  (mkdir at the beginning. change, or remove sqlite3 install, not sure if accepting all of the prompts is the best process yet??). 

    After the YB install i tried to complete the post install tasks but there were no directories that matched /tmp/config so the 3 copy commands didnt work. i applied the 755 permissions to /var/www/yieldbuddy and adjusted /etc/nginx/sites-available/default in nano to enable the php processing hand off.

    Change root /var/www/home (or whatever it it) i set it to /var/www 

     Un-comment location ~ \.php$ { line
    Un-comment include snippets line
    un-comment fastcgi_pass unix:/var/run/php5-fpm.sock; line

    make sure to close brace :)

    Change /var/www/yieldbuddy/www/index.php to comment out the mysql section.

    After all that i got the site to load and login. still showing the php code on the relay status screen but thats for another day. now to see if i can get the arduino to talk with the pi :) I'm keeping notes in a deployment doc. once i can get a repeatable process i'll post it up :)

    -Mal

  • HI Mal,

    the relay status code was a } from memory on a PHP section.
    If you use Coda (mac only), its easy to find... not that I'm a coder by any means!
    I didn't comment on the code, as I'm sure there will be a .b /.c shortly. 

    One thing I want to look at is how to associate the code blocks with the devices, so they can be adjusted or otherwise. At present none of the toggle options work, but as I have no hardware connected - this may be why!

    Best,
    Pablo.
  • Hey Fellow YB Enthusiasts,

    I've assembled bits and pieces of raspi/YB Info into this deployment doc. Feel free to view and copy. I've tried to included sources but if you see anything that should be changed or added please let me know. I'll be updating it as i figure out more of the install process and best practices. If you don't feel like moving the file system to an external drive just skip that section.


    -Mal
  • edited February 2016
    Hi Malaria12 and pablomole,

    Thank you for both of your contributions.  This is very helpful to the community as a whole.

    Cheers.
  • Hi all-

    when trying to partition the system I get the following error a few steps in:
     

    root@raspberrypi:~# mount /dev/sda /media/pi/USB_DRV

    mount: mount point /media/pi/USB_DRV does not exist


    any ideas?


    thx

    rev

  • Hi rev,

    looks like you need to make that directory prior to trying to mount to it.

    as root, try:  mkdir /media/pi/USB_DRV    prior to trying the mount command.
Sign In or Register to comment.