Table des matières

Flasher l'OS

avec chromium browser: http://flash.getchip.com/

la première fois à faire sur la machine depuis laquelle on veut flasher: http://docs.getchip.com/chip.html#setup-ubuntu-for-flashing

sudo usermod -a -G dialout $LOGNAME
sudo usermod -a -G plugdev $LOGNAME
# Create udev rules 
echo -e 'SUBSYSTEM=="usb", ATTRS{idVendor}=="1f3a", ATTRS{idProduct}=="efe8", GROUP="plugdev", MODE="0660" SYMLINK+="usb-chip"
SUBSYSTEM=="usb", ATTRS{idVendor}=="18d1", ATTRS{idProduct}=="1010", GROUP="plugdev", MODE="0660" SYMLINK+="usb-chip-fastboot"
SUBSYSTEM=="usb", ATTRS{idVendor}=="1f3a", ATTRS{idProduct}=="1010", GROUP="plugdev", MODE="0660" SYMLINK+="usb-chip-fastboot"
SUBSYSTEM=="usb", ATTRS{idVendor}=="067b", ATTRS{idProduct}=="2303", GROUP="plugdev", MODE="0660" SYMLINK+="usb-serial-adapter"
' | sudo tee /etc/udev/rules.d/99-allwinner.rules
sudo udevadm control --reload-rules

Your CHIP details:

Serial #:
NAND:
1625424403819f65
Toshiba 4G MLC

je choisis la version Headless 4.4; Debian on C.H.I.P. with no GUI. Best for using C.H.I.P. as a server.

Serial #: 1625424403819f65
NAND: Toshiba 4G MLC
MD5 Hash: efcfa704c9b154c6d600420423c9b712

Connexion via console série avec le cable USB

http://docs.getchip.com/chip.html#power-up

Utilisation sans écran: http://docs.getchip.com/chip.html#sudden-shutdown-brown-out

Laisser le temps à l'OS de la chip de booter puis /dev/ttyACM0 apparait

http://docs.getchip.com/chip.html#headless-chip

Baud Rate (Data Rate): 115200
Data Bits: 8
Parity: none
Stop bits: 1
Flow control: none
screen /dev/ttyACM0 115200
login: chip
pass: chip

CHIP uses 3V3 digital logic on GPIOs.

Configuration du WIFI

http://docs.getchip.com/chip.html#wifi-connection

nmcli device wifi list
sudo nmcli device wifi connect '......' password '.......' ifname wlan0
nmcli device status
nmcli connection show --active

Pour connaître l'IP:

ip addr show dev wlan0

LES REGLAGES SONT CONSERVES pour les prochains boots

Documentation sur nmcli: https://access.redhat.com/documentation/en-US/Red_Hat_Enterprise_Linux/7/html/Networking_Guide/sec-Using_the_NetworkManager_Command_Line_Tool_nmcli.html

Configuration d'un bail dhcp statique sur la freebox:

38:A2:8C:5E:76:46   192.168.1.30

Outils de configuration du réseau

sudo nmtui

Accès via ssh

sur la chip:

ssh-keygen 
Generating public/private rsa key pair.
Enter file in which to save the key (/home/chip/.ssh/id_rsa): 
Enter passphrase (empty for no passphrase): 
Enter same passphrase again: 
Your identification has been saved in /home/chip/.ssh/id_rsa.
Your public key has been saved in /home/chip/.ssh/id_rsa.pub.

sur le pc host:

ssh -vvv chip@192.168.1.30
OpenSSH_7.2p2 Ubuntu-4ubuntu2.1, OpenSSL 1.0.2g  1 Mar 2016
debug1: Reading configuration data /etc/ssh/ssh_config
debug1: /etc/ssh/ssh_config line 19: Applying options for *
debug2: resolving "192.168.1.30" port 22
debug2: ssh_connect_direct: needpriv 0
debug1: Connecting to 192.168.1.30 [192.168.1.30] port 22.
debug1: Connection established.
debug1: identity file /home/bvandepo/.ssh/id_rsa type 1
debug1: key_load_public: No such file or directory
debug1: identity file /home/bvandepo/.ssh/id_rsa-cert type -1
debug1: key_load_public: No such file or directory
debug1: identity file /home/bvandepo/.ssh/id_dsa type -1
debug1: key_load_public: No such file or directory
debug1: identity file /home/bvandepo/.ssh/id_dsa-cert type -1
debug1: key_load_public: No such file or directory
debug1: identity file /home/bvandepo/.ssh/id_ecdsa type -1
debug1: key_load_public: No such file or directory
debug1: identity file /home/bvandepo/.ssh/id_ecdsa-cert type -1
debug1: key_load_public: No such file or directory
debug1: identity file /home/bvandepo/.ssh/id_ed25519 type -1
debug1: key_load_public: No such file or directory
debug1: identity file /home/bvandepo/.ssh/id_ed25519-cert type -1
debug1: Enabling compatibility mode for protocol 2.0
debug1: Local version string SSH-2.0-OpenSSH_7.2p2 Ubuntu-4ubuntu2.1
debug1: Remote protocol version 2.0, remote software version OpenSSH_6.7p1 Debian-5+deb8u3
debug1: match: OpenSSH_6.7p1 Debian-5+deb8u3 pat OpenSSH* compat 0x04000000
debug2: fd 3 setting O_NONBLOCK
debug1: Authenticating to 192.168.1.30:22 as 'chip'
debug3: hostkeys_foreach: reading file "/home/bvandepo/.ssh/known_hosts"
debug3: send packet: type 20
debug1: SSH2_MSG_KEXINIT sent
Connection reset by 192.168.1.30 port 22

sur la chip:

tail -f /var/log/auth.log

Nov 25 21:05:36 chip sshd[575]: error: Could not load host key: /etc/ssh/ssh_host_dsa_key
Nov 25 21:05:36 chip sshd[575]: error: key_load_public: invalid format
Nov 25 21:05:36 chip sshd[575]: error: Could not load host key: /etc/ssh/ssh_host_ecdsa_key
Nov 25 21:05:36 chip sshd[575]: error: key_load_public: invalid format
Nov 25 21:05:36 chip sshd[575]: error: Could not load host key: /etc/ssh/ssh_host_ed25519_key
Nov 25 21:05:36 chip sshd[575]: fatal: No supported key exchange algorithms [preauth]
Nov 25 21:09:43 chip login[277]: pam_env(login:session): Unable to open env file: /etc/default/locale: No such file or directory
Nov 25 21:09:43 chip login[277]: pam_unix(login:session): session opened for user chip by LOGIN(uid=0)
Nov 25 21:09:43 chip systemd-logind[248]: New session c1 of user chip.
Nov 25 21:09:43 chip systemd: pam_unix(systemd-user:session): session opened for user chip by (uid=0)

refaire les clefs sur la chip:

sudo ssh-keygen -t ecdsa  -f /etc/ssh/ssh_host_ecdsa_key
sudo ssh-keygen -t dsa  -f /etc/ssh/ssh_host_dsa_key
sudo ssh-keygen -t rsa1 -f /etc/ssh/ssh_host_rsa_key
sudo ssh-keygen -t ed25519 -f /etc/ssh/ssh_host_ed25519

la connexion depuis le pc host fonctionne!

Annulation mot de passe pour les connexions via ssh: https://bvdp.inetdoc.net/wiki/doku.php?id=reseau&s[]=authorized#annulation_du_mot_de_passe_pour_la_connexion_depuis_sony_vers_pioupiou2

Streaming video

https://bbs.nextthing.co/t/camera-module-for-c-h-i-p/226/13

Streaming from USB Cam, CHIP rockz! Now with NEON support

Hi, this response is meant to motivate everyone to use graphic “intense” task on the CHIP. As I wrote above, I've used mjpg-streamer (precompiled package) on the chip to grab frames from my v4l2 USB webcam and save the frames to RAM .. well .. /dev/shm/mjpeg. This worked with the help of libjpeg-turbo which supports the NEON instructions of the CPU out of the box. I was able to run at 4fps@1280×720 with ~30% cpu utilization (i assume that the CPU contributes mostly for the USB to gpu transfer)…

Streaming from USB Cam, CHIP rockz! Now with NEON support

Hi, this response is meant to motivate everyone to use graphic “intense” task on the CHIP. As I wrote above, I've used mjpg-streamer (precompiled package) on the chip to grab frames from my v4l2 USB webcam and save the frames to RAM .. well .. /dev/shm/mjpeg. This worked with the help of libjpeg-turbo which supports the NEON instructions of the CPU out of the box. I was able to run at 4fps@1280×720 with ~30% cpu utilization (i assume that the CPU contributes mostly for the USB to gpu transfer)…

https://bbs.nextthing.co/t/streaming-from-usb-cam-chip-rockz-now-with-neon-support/1706

Installation pilote ueye

(Ne fonctionne pas

sudo su -
cd /home/chip
tar xvf uEyeSDK-4.80.00-ARM-LINUX-IDS-GNUEABI-HF.tgz  -C /

aussi essayé:

tar xvf uEyeSDK-4.80.00-ARM-LINUX-IDS-GNUEABI-SF.tgz  -C /
/usr/local/share/ueye/bin/ueyesdk-setup.sh
/etc/init.d/ueyeusbdrc start

Pour avoir les applis de démo en graphique (pas testé sur CHIP):

sudo apt-get install libqtgui4 libqt4-network libqt4-qt3support libjpeg62 libpng12-0
chip@chip:~$   /etc/init.d/ueyeusbdrc start
  Starting ueyeusbd... /etc/init.d/ueyeusbdrc: line 121: /usr/local/share/ueye/ueyeusbd/ueyeusbd: cannot execute binary file: Exec format error
  ueyeusbd is not running.

Pour effacer le driver installé, le script suivant ne fonctionne pas:

/usr/local/share/ueye/bin/ueyesdk-uninstall.sh

Donc effacer à la main:

removeueye.sh
rm -rf /etc/init.d/ueyeusbdrc
rm -rf /etc/init.d/ueyeethdrc
rm -rf /etc/udev/rules.d/zz-ueyeusb.rules
rm -rf /etc/network/if-post-up.d/ueyeethdnotify
rm -rf /etc/network/if-pre-down.d/ueyeethdnotify
rm -rf /usr/lib/libueye_api.so.4.80
rm -rf /usr/lib/libueye_api.so.1
rm -rf /usr/lib/libueye_api.so
rm -rf /usr/bin/ueyecameramanager
rm -rf /usr/bin/ueyesetid
rm -rf /usr/bin/idscameramanager
rm -rf /usr/bin/ueyedemo
rm -rf /usr/bin/ueyelive
rm -rf /usr/bin/ueyesetip
rm -rf /usr/bin/ueyefreeze
rm -rf /usr/include/ueye.h
rm -rf /usr/include/ueye_deprecated.h
rm -rf /usr/include/uEye.h
rm -rf /usr/local/share/ueye/

Alimentation

Controleur: http://dl.linux-sunxi.org/AXP/AXP209_Datasheet_v1.0en.pdf

Module caméra

https://bbs.nextthing.co/t/camera-module-for-c-h-i-p/226/14

http://lxr.free-electrons.com/source/drivers/media/i2c/soc_camera/ov2640.c

http://elinux.org/images/5/50/Supporting_the_Camera_Interface.pdf

https://fr.linkedin.com/in/mripard

librairie Eagle pour faire des shields: https://github.com/hackbama/hardware/tree/master/CHIP_Eagle_Lib

Soc Allwiner R8

http://linux-sunxi.org/R8

https://github.com/NextThingCo/CHIP_Pro-Hardware/blob/master/Datasheets/GR8_Datasheet_v1.0.pdf

https://events.linuxfoundation.org/sites/events/files/slides/ripard-mainlining-out-of-tree-socs.pdf

Compilateur

sudo apt update
sudo apt install build-essential
  perl: warning: Setting locale failed.
  perl: warning: Please check that your locale settings:
  	LANGUAGE = (unset),
  	LC_ALL = (unset),
  	LANG = "fr_FR.UTF-8"
      are supported and installed on your system.
  perl: warning: Falling back to the standard locale ("C").
  locale: Cannot set LC_CTYPE to default locale: No such file or directory
  locale: Cannot set LC_MESSAGES to default locale: No such file or directory
  locale: Cannot set LC_ALL to default locale: No such file or directory
apt list --upgradable
sudo apt upgrade

Cross compilation

pas testé: https://bbs.nextthing.co/t/lessons-learned-compiling-a-c-program/1638

Ethernet through USB

http://www.chip-community.org/index.php/Chip:_USB_On_The_Go_Ethernet_Connection

Je souhaite configurer:

pc host:192.168.2.1/24  sert de passerelle
chip   :192.168.2.2/24

configurer sur le pc hote via network manager: NON NE FONCTIONNE PAS BIEN!!!!!

modifier les connexions
brancher le chip
ajout d'une interface: enp0s20u3u2 (16:7D:0F:FA:90:F5)
Ajouter: nom "Connexion Ethernet USB CHIP"
Paramètres IPV4: Adresse: 192.168.2.1/24

configurer sur le pc hote à la main

sudo ifconfig enp0s20u3u2 192.168.2.1/24 

sur CHIP

/usr/lib/klibc/bin/ipconfig  

commenter g_serial et ajouter g_ether à /etc/modules

sudo sed -i 's,g_serial,#g_serial\ng_ether,g'  /etc/modules

sudo nmcli con add type ethernet con-name usbnet ifname usb0 ip4 192.168.2.2/24 gw4 192.168.2.1
sudo nmcli con mod usbnet ipv4.dns "8.8.8.8 8.8.4.4"
sudo nmcli con up usbnet

sudo reboot sur le chip vérifier que l'interface a été créée:

ip addr

Now on the host add a suitable address to the new interface:

sudo ip addr add 192.168.2.1/24 dev enp0s20u3u2 
sudo ip link set enp0s20u3u2 up

Connexion au chip via ssh:

ssh chip@192.168.2.2

ajout de règles de routages sur le pc hote:

sudo modprobe iptable_nat
echo "1" | sudo tee /proc/sys/net/ipv4/ip_forward
sudo iptables -t nat -A POSTROUTING -o enp0s25  -j MASQUERADE

ou

sudo iptables -t nat -A POSTROUTING -o wlo0 -j MASQUERADE

autres?

https://bbs.nextthing.co/t/connecting-chip-to-your-network-over-usb/8935