bluegreen-labs / phenocam_installation_tool

An installation script and instructions for installing PhenoCam cameras.
https://bluegreen-labs.github.io/phenocam_installation_tool/
GNU Affero General Public License v3.0
9 stars 7 forks source link

Passive mode not set #3

Closed patricktokeeffe closed 7 years ago

patricktokeeffe commented 7 years ago

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.