Gigabit Ethernet driver

  1. Etherent camera driver
  2. Pi-camera driver library
  3. Tests of dirver and camera

1/ Etherent camera driver :

Driver uses library writtern by Robert Sulej, source code can be found here .
Imporant defines ( default values of parameters ) are the following :

// Camera states:
#define CAM_CONNECTION_OPEN  0x01
#define CAM_REFRESH_RUNNING  0x02
#define CAM_DATA_TAKING  0x04
                                                                               
// Defaults:
#define DEF_LOCAL_PORT 23100     // default driver UDP comm. port (refresh at p
#define DEF_REMOTE_PORT 1234  // default camera UDP port
#define DEF_REFRESH_TIME 5          // watchdog refresh interval [s]
                                                                               
#define DEF_COMMAND_TIMEOUT  100  // time to resend command [ms]
#define DEF_COMMAND_RETRIES    2  // retries w/o ack before give up
                                                                               
#define DEF_DATA_TIMEOUT  100  // max. time to wait for next RAW data packet [ms]
#define DEF_DATA_RETRIES  2    // 0x0A command (status check) retries
#define DEF_WAIT_TIME     3    // waiting time for the next packet [ms] (NOT A TIMEOUT!)
                                                                               

2/ Pi-camera driver library

Old usb driver library is used ( class Device2K2K - files Device2K2K.h/cpp ) and class dervied from Device2K2K was created.
It is used later in programs for communication with camera.
The following parameters were added to controll ethernet camera from pi programs :

PARAMETER NAME
DESCRIPTION
DEFALT VALUE NOTES
CCD_CAMERA_IP

100.100.100.102
CCD_CAMERA_PORT

1234
CCD_CAMERA_TIMEOUT_MILI_SEC
Data timeout in mili-seconds, timeout of packets of an image
DEF_DATA_TIMEOUT
CCD_ETHCAM_DATA_RETRIES
Number of retries of data transfer
DEF_DATA_RETRIES
UNCHANGABLE
CCD_ETHCAM_COMMAND_TIMEOUT
Data timeout in mili-seconds, timeout of packets of an image DEF_COMMAND_TIMEOUT

CCD_ETHCAM_COMMAND_RETRIES
Number of retries of command
DEF_COMMAND_RETRIES

CCD_ETH_CAM_LOGFILE name of  log file , empty value means that error logging is disabled
cam_driver.err
CCD_ETH_CAM_ERRFILE name of error log file , empty value means that error logging is disabled, DEFAULT is empty - allows fast working of camera



not yet imlemented in pi-drvier cfg
DEF_WAIT_TIME
UNCHANGALBE


Other parameters that must be set :

CCD_CAM_TYPE type of camera driver to be used
4

CCD_DEVICE_ID id of camera - ip address last number
102

CCD_BASE_FILE_NAME_FITS prefix of fits files saved on dist
k20


3/ Tests of dirver and camera are described here

Tests can be performed in :
    cd $RESDIR/EthTest/RealCAM
    test2K2K k20 -eth=100.100.100.102
    or
    nohup ccdsingle > out 2>&1 &

4/ Actions on problems