Giter Club home page Giter Club logo

phenocam_installation_tool's People

Contributors

khufkens avatar patricktokeeffe avatar tmilliman avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

phenocam_installation_tool's Issues

Remove dependency on http server for install

Use a netcat pull from the busybox install (if netcat is available).

Copy desktop.jpg from the device to your pc with the netcat/nc method:

On your pc, disable temporarily (or reconfigure if possible) any firewall and run

netcat -l -p 10000 > desktop.jpg

and on the device

busybox nc A.B.C.D -p 10000 < desktop.jpg

where you need to replace A.B.C.D with the IP address of your pc. As soon as the transfer was successful, the netcat process on your pc should stop automatically. If not, something could have gone wrong and you can stop it with Ctrl+C (compare source and destination checksums to verify).

For the other direction, just exchange < and > on both sides. Make first a backup of the original desktop.jpg (cp desktop.jpg desktop_orig.jpg).

Script should provide more output to the user about what's happening

From Andrew:

It occurs to me… for the PIT, it would be very useful to spit back to the user a bit more information at the end. “Test image upload completed successfully. Camera set to upload between X am and Y pm at an interval of Z minutes, starting at A minutes past the hour. FTP set to active (passive) mode.”

Passive mode not set

I'm observing that despite having specified passive mode, the resulting .scr files do not contain the passive directive. Even during the installation process there are instances of 500 Illegal PORT command, which does not occur when passive mode is used.

Install log

lar@lar-asset394292 ~/Downloads/phenocam-installation-tool $ ./PIT.sh 192.168.13.50 admin redacted cafcookwestltar01 -8 PST 4 22 15 passive

#--------------------------------------------------------------------
#
# Uploading all settings to the NetCam camera!
# [Ignore all garbage on the command line]
#
#--------------------------------------------------------------------

telnet> Trying 192.168.13.50...
Connected to 192.168.13.50.
Escape character is '^]'.

NetCamSC-CookWest login: admin
Password: 


BusyBox v0.60.0 (2013.11.14-19:38+0000) Built-in shell (msh)
Enter 'help' for a list of built-in commands.

[~]# cd /etc/config
[~]# wget http://phenocam.sr.unh.edu/data/configs/phenocam_default_install.tar.gz
phenocam_default_ins   0% |                             |     0       --:-- ETAgunzip phenocam_default_install.tar.gz
phenocam_default_ins 100% |*****************************|  7842       00:00 ETA
[~]# gunzip phenocam_default_install.tar.gz
[~]# tar -xvf phenocam_default_install.tar
default_ftp.scr
default_IP_ftp.scr
default_IR_ftp.scr
default_ntp.server
default_overlay0.conf
default_sched0.conf
default_video0.conf
metadata.cgi
phenocam_install.sh
phenocam_ip_table.sh
phenocam_upload.sh
rgb.cgi
site_ip.html
[~]# rm phenocam_default_install.tar
[~]# sh phenocam_install.sh cafcookwestltar01 -8 PST 4 22 15 passive

#--------------------------------------------------------------------
#
# Backing up settings for cafcookwestltar01 !
#
#--------------------------------------------------------------------

Illegal PORT command.
ftp: bind: Address already in use
ln: /var/httpd/metadata.cgi: File exists
ln: /var/httpd/rgb.cgi: File exists

#--------------------------------------------------------------------
#
# Adjusting setting files !
#
#--------------------------------------------------------------------

# The camera clock is set to UTC-8
# validate this setting - set date/time shown below !!!
Fri May  5 21:45:54 UTC 2017
# We retain the old exposure_grid settings!
# We retain the old blue settings!
# We retain the old red settings!
# [do a factory reset if this an old camera but you prefer default settings]

#--------------------------------------------------------------------
#
# Uploading test images !
#
#--------------------------------------------------------------------

Uploading the first images as a test... (wait 2min)
Uploading RGB Image
ftp: bind: Address already in use
Uploading IR Image
ftp: bind: Address already in use
Uploading the ip table
uploading IP table
ftp: bind: Address already in use

#--------------------------------------------------------------------
#
# Setting a crontab for timed uploads to the PhenoCam network !
#
#--------------------------------------------------------------------

crontab intervals set to: 14,29,44,59
Saving configuration files...
flatfsd[7881]: flatfs write from console
flatfsd[7881]: flatwrite: 0xcafe3456 1467218602/1474637592/1494049682
flatfsd[7881]: atomic erase/write
flatfsd[7881]: configuration files saved
Configuration files saved.

#--------------------------------------------------------------------
#
# Done !!! - close the terminal if it remains open !
#
#--------------------------------------------------------------------

[~]# 

Here is IR_ftp.scr after installation. Note the blank line where passive should be.

timeout 200^M
open SERVER^M
user anonymous anonymous^M
^M
ascii^M
put /etc/config/metadata.txt data/cafcookwestltar01/cafcookwestltar01_IR_DATETIMEST
binary^M
put /dev/video/jpeg0 data/cafcookwestltar01/cafcookwestltar01_IR_DATETIMESTRING.jpg
quit^M
~
~
~
~
- IR_ftp.scr 1/9 11%

And likewise ftp.scr does not contain the passive line:

timeout 200^M
open SERVER^M
user anonymous anonymous^M
^M
ascii^M
put /etc/config/metadata.txt data/cafcookwestltar01/cafcookwestltar01_DATETIMESTRIN
binary^M
put /dev/video/jpeg0 data/cafcookwestltar01/cafcookwestltar01_DATETIMESTRING.jpg^M
quit^M
~
~
~
~
~
- ftp.scr 1/9 11%

In this state, the FTP transfer fails:

220 (vsFTPd 3.0.2)
331 Please specify the password.
230 Login successful.
200 Switching to ASCII mode.
500 Illegal PORT command.
200 Switching to Binary mode.
500 Illegal PORT command.
221 Goodbye.
220 (vsFTPd 3.0.2)
331 Please specify the password.
230 Login successful.
200 Switching to ASCII mode.
500 Illegal PORT command.
200 Switching to Binary mode.
500 Illegal PORT command.
221 Goodbye.
~
~
~
- /var/tmp/IR_upload.log 1/16 6%

After manually editing both files to add passive things work OK.

Upload to personal ftp server

Hello. I used the PIT tool to configure my phenocam. I was wondering how can I upload the images to my personal ftp server? Where do I configure the server, port, username, and password? In the settings camera's available in the browser? Or I have to edit some config file manually?

Thanks.

Auto clone repo to sync versions

@tmilliman could there be a routine on the server to clone the repo on a regular basis and create the tarball needed during installation?

Basically a cron job doing this:

git clone https://github.com/khufkens/phenocam-installation-tool.git
cd phenocam-installation-tool/files
tar -czf /file/location/phenocam_config.tar.gz *

Server mismatch

Installation occurs via a recursive mechanism, but the name of the server hosting the source code archive (phenocam.sr.unh.edu) is not the same as the server the installed scripts point to (klima.sr.unh.edu). This prevents users from re-running the installation script on the device itself, which impairs development.

Relevant stdout excerpt:

#--------------------------------------------------------------------
#
# Downloading settings from klima.sr.unh.edu !
#
#--------------------------------------------------------------------

wget: not an http or ftp url: klima.sr.unh.edu/data/configs/phenocam_default_install.tar.gz
gunzip: phenocam_default_install.tar.gz: Invalid argument
tar: Error opening 'phenocam_default_install.tar': No such file or directory
rm: cannot remove `phenocam_default_install.tar': No such file or directory
cat: default_overlay0.conf: Invalid argument
cat: default_ftp.scr: Invalid argument
cat: default_IR_ftp.scr: Invalid argument
cat: default_IP_ftp.scr: Invalid argument
cat: default_video0.conf: Invalid argument
cat: default_ntp.server: Invalid argument
cat: default_sched0.conf: Invalid argument
rm: cannot remove `default_*': No such file or directory
ln: /var/httpd/metadata.cgi: File exists
ln: /var/httpd/rgb.cgi: File exists

Perhaps the source code archive host should be hard-coded instead of using $HOST (the image storage server) [line ref]:

# remove previous install files
if [ -f phenocam_default_install.tar* ]; then
	rm phenocam_default_install.tar*
fi

# download the installation files from the PhenoCam servers
wget $HOST/data/configs/phenocam_default_install.tar.gz

gunzip phenocam_default_install.tar.gz
tar -xvf phenocam_default_install.tar
rm phenocam_default_install.tar

fi

Cron ends 1 hour late

The cron ending hour setting appears to have an off-by-one error. If I install using

./PIT.sh 123.456.78.xx admin admin testcam3 -8 PST 4 22 15 passive

then images continue to be scheduled through hour 22. This is the schedule I programmed into our latest camera and it's last report each day is 22:45.

NTP server configuration

The choice of time.nist.gov may not work well outside of the US. I'm wondering if using pool.ntp.org might be a better choice. There is much discussion of this issue on the net and my sense is that for the accuracy we require using pool.ntp.org would be a better choice.

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.