Difference between revisions of "10393 manual"

From ElphelWiki
Jump to: navigation, search
(Boot)
(Boot)
Line 36: Line 36:
 
devicetree has "chosen = ...root=/dev/mmcblk0p2..." - rootfs is on the micro SD card second partition. Thus, the μSD card must be inserted.
 
devicetree has "chosen = ...root=/dev/mmcblk0p2..." - rootfs is on the micro SD card second partition. Thus, the μSD card must be inserted.
 
* boot from μSD card only options:
 
* boot from μSD card only options:
** A modified card that doesn't lock the mechanical CD pin in the slot - it's done by carefully rubbing down the corner (see Fig.2) - most cards have circuitry there and get damaged.
+
** A modified card that doesn't lock the mechanical CD pin in the slot - it's done by carefully filing off the corner (see Fig.2) - most cards have circuitry there and get damaged.
 
** μUSB-to-USB cable: in Linux compile [https://sourceforge.net/p/elphel/cp210x_gpio/ci/master/tree/ this driver], connect camera to PC, reload the driver then type:
 
** μUSB-to-USB cable: in Linux compile [https://sourceforge.net/p/elphel/cp210x_gpio/ci/master/tree/ this driver], connect camera to PC, reload the driver then type:
 
  ./cp210x_gpio.py 0x6;
 
  ./cp210x_gpio.py 0x6;

Revision as of 09:07, 10 August 2016

Connections

NC393-CS marked ports.jpeg

Defaults

IP addr: 192.168.0.9 (old: 192.168.0.8)

user / pwd: root / <empty>

  • (current) The address is set in the /etc/init_elphel393.sh in rootfs.
  • (old) The address is set in the init_elphel393.sh script on the card's FAT32 partition.

init_elphel393.sh

  • /etc/init_elphel393.sh
  • Change SENSOR_TYPE (boots but no images if incorrectly set):
    • SENSOR_TYPE=5 - for 5MPix sensors
    • SENSOR_TYPE=14 - for 14MPix

NOTE: 5 & 14 MPix sensors cannot be mixed - require different bitstreams.

  • Change the default IP address

Boot

Normally camera boots from the internal NAND flash memory, and it is always possible to boot it from the micro SD card, so even corruption of files on the internal flash will not "brick" the system. There are no buttons or switches on the camera and the camera should be instructed to change the boot source. Always booting from micro SD is not practical - in that case it would not be possible to leave a non-bootable card (intended just for image/video storage) in the camera slot.

There are two ways to switch camera to the micro SD boot mode. One requires camera to be connected to the host computer with the USB cable (micro USB socket under the network jack - marked "console" on the picture). There is an internal USB-to-serial converter in the camera (CP2103) that offers 4 additional GPIO signals in addition to just the serial connection. One of these signals selects the boot source (GPIO0 - 0 - MMC, 1 - NAND), another (GPIO3 - 0 reset, 1 - normal operation). Unfortunately GPIO control of the CP2103 is not in a mainline cp210x Linux driver so this functionality requires a mudified version (see instructions below).

Another way to "tell" the camera to boot from the μSD card instead of the internal NAND flash is to use a mechanically modified card or card adapter (such cards are provided with the camera). Standard specifies two alternative ways for detection of the card presence - one is a mechanical switch (closed when the card is inserted), another is a pull-up resistor on a data line. Camera uses both signals at boot time to determine the boot source:

  • Switch not closed, pull-up resistor not detected -> no card present, boot from the internal NAND flash
  • Switch closed -> data (non-bootable) card present, boot from the internal NAND flash
  • Switch not closed, pull-up resistor is detected -> bootable card present, boot from the MMC card
  • [default behavior] on power-on the camera boots from NAND flash: u-boot, device tree and kernel.

devicetree has "chosen = ...root=/dev/mmcblk0p2..." - rootfs is on the micro SD card second partition. Thus, the μSD card must be inserted.

  • boot from μSD card only options:
    • A modified card that doesn't lock the mechanical CD pin in the slot - it's done by carefully filing off the corner (see Fig.2) - most cards have circuitry there and get damaged.
    • μUSB-to-USB cable: in Linux compile this driver, connect camera to PC, reload the driver then type:
./cp210x_gpio.py 0x6;
./cp210x_gpio.py 0xe;
Fig.2 Recovery μSD card ('cut' corner) - enforces the system board to boot from it

Command line access

ssh root@192.168.0.9

Serial console access

  • Use a microUSB-USB cable to connect to PC - the cable's end should be thin enough otherwise interferes with the micro SD card.
  • Linux: minicom -c on
    • likely device: /dev/ttyUSB0
    • settings: 115200 8N1, no for hardware/software flow control

Get images

channel 1: http://192.168.0.9:2323/img

channel 2: http://192.168.0.9:2324/img

channel 3: http://192.168.0.9:2325/img

channel 4: http://192.168.0.9:2326/img

Video

Display

Multipart JPEG stream

http://192.168.0.9:2323/mimg
http://192.168.0.9:2324/mimg
http://192.168.0.9:2325/mimg
http://192.168.0.9:2326/mimg

GStreamer

gst-launch-1.0 souphttpsrc is-live=true location=http://192.168.0.9:2323/mimg ! jpegdec ! xvimagesink

Record

  • More info
  • If the prefix parameter, which is absolute path + prefix, for a channel is not set the file will be written somewhere to rootfs (likely /usr/local/verilog/)

browser

Example 1: (provide a correct media mount point)

Example 2:

  • channel 0, /dev/sda1, w/o a file name prefix
    • setup:
http://192.168.0.9/camogm.php?chn=0&cmd=prefix=/mnt/sda1/;
    • start:
http://192.168.0.9/camogm.php?chn=0&cmd=start;
    • stop:
http://192.168.0.9/camogm.php?chn=0&cmd=stop;

command line

Example:

  • channel 2, /home/root, file prefix=test_, 1GB or 10min files whichever occurs first
    • setup and start (in one line):
echo "format=mov;status=/var/tmp/camogm2.status;prefix=/home/root/test_;duration=600;length=1073741824;start" > /var/volatile/camogm_cmd2
    • stop recording:
echo "stop" > /var/volatile/camogm_cmd2
sync

Change parameters

  • http://192.168.0.9/controls.html - previews and basic parameters:
    • Exposure - the values are in the sensor lines. Currently conversion to seconds is not correct.
    • WB - r,g,b gains
    • Quality - compression quality - individual for compressor but common for the buffer driver - it's better to have the same value for all channels.
  • For 5MPix the startup settings are defined int the /usr/local/verilog/startup5 on the micro SD card, FAT32 partition:
...
-c write_sensor_i2c  all 1 0 0x9009001e (exposure)
-c write_sensor_i2c  all 1 0 0x9035000a (set all gains to 0xa)
-c write_sensor_i2c  all 1 0 0x902c000e (blue gain to 0xe)
-c write_sensor_i2c  all 1 0 0x9009001d (red gain to 0xd)
...
10393 controls.jpeg

Temperature monitor

10393 hwmon.jpeg

Proper shutdown

  • if not properly shutdown - μSD might get corrupted (run sync at least)
shutdown -hP now

Firmware image

  • 20160804 (new)
    • root/pass
    • overlayfs enabled if rootfs is on flash - lower: /tmp/rootfs.ro, upper: /tmp/rootfs.rw - changes to the filesystem are made on:
reboot -f

or

shutdown -Hp now

or (most likely will work but correct work is not guaranteed)

overlay_sync 

Known problems

  • [solved] Vertical artifacts in jpegs. Images are ok at 100% quality. Fixed, testing.
  • http://192.168.0.9:232x/noexif/mimg - multipart jpeg displays corrupted frames from time to time. Reason: network bandwidth?
  • [solved] Sometimes on power-on (NAND flash boot) cannot mount the card's rootfs partition. Kernel Panics. Power off/on. Soft "reboot -f" works ok.
...
Kernel panic - not syncing: VFS: Unable to mount root fs on unknown-block(179,2)
...

More info

  • Changing exposure/quality/gains - can corrupt images - needs testing.
  • After rewriting rootfs to μSD card - some of the cards get a corrupted partition - re-partitioning (reformatting?) solves the problem.
On the camera the rootfs is mounted as RW and some of the files are changed (also links created) -
most of the changes are now moved to tmpfs but something might have been missed.


Notes

  • In case rootfs is on flash, it might make sense (or maybe not as the history is updated only once on session exit) to disable bash sessions command history - disable bash history