Jan 082019
 

J’ai créé un service similaire à dweet.io
Je m’en sers pour logguer des infos (capteur de temperature, uptime,…)

J’ai des Raspberry, CHIP, Omega, Arduino (esp8266) qui ont besoin de remonter facilement ce genre d’infos. Comment?

Comme ceci dans un « crontab -e « :

* * * * * wget --user-agent=arduino "http://www.snakenet.be/dweet/?key=ONION&freemem=`grep "MemFree" /proc/meminfo | awk '{print $2}'`&uptime=`cat /proc/uptime |awk '{print $2}'`" -O /dev/null &

Faut aussi penser à activer crontab (sous Omega)

/etc/init.d/cron start
/etc/init.d/cron enable

et on visionne le résultat avec cette page :

Exemple d’analyse de la vitesse d’upload de ma connexion internet :

#!/bin/bash
upload=`./speedtest-cli --no-pre-allocate --no-download --simple | grep "Upload" | cut -f 2 -d ':' | cut -d ' ' -f 2`
wget --user-agent=arduino "http://www.snakenet.be/dweet/?key=VOO&upload=$upload" -O /dev/null

 

Mai 142018
 

Source : https://github.com/foosel/OctoPrint/wiki/Setup-on-a-Raspberry-Pi-running-Raspbian

apt-get install python2.7 git gcc python-pip python-dev python-setuptools python-virtualenv git libyaml-dev build-essential

# a ne PAS faire en root !!!
cd ~
git clone https://github.com/foosel/OctoPrint.git
cd OctoPrint
virtualenv venv
./venv/bin/pip install pip --upgrade
./venv/bin/python setup.py install
mkdir ~/.octoprint

Tester si ca démarre :

~/OctoPrint/venv/bin/octoprint

Si ça démarre sans problème, alors corriger la suite :

edit ~/OctoPrint/scripts/octoprint.init and ~/OctoPrint/scripts/octoprint.default and change DAEMON to this : 
DAEMON=/root/OctoPrint/venv/bin/octoprint

sudo cp ~/OctoPrint/scripts/octoprint.init /etc/init.d/octoprint
sudo chmod +x /etc/init.d/octoprint
sudo cp ~/OctoPrint/scripts/octoprint.default /etc/default/octoprint

sudo update-rc.d octoprint defaults

sudo service octoprint start

Et voilà, c’est finit…

Août 122016
 

Configurer le wifi en ligne de commande

nmtui

Mettre à jour et redémarrer l’engin

apt-get update -y && apt-get upgrade -y && init 6

Installer la gestion du point d’accès et la prise de contrôle a distance

apt-get install openssh-server

apt-get install dnsmasq hostapd
echo interface=wlan1 > /etc/dnsmasq.d/access_point.conf
echo except-interface=wlan0 >> /etc/dnsmasq.d/access_point.conf
echo dhcp-range=172.17.0.2,172.17.0.250,1h >> /etc/dnsmasq.d/access_point.conf
echo dhcp-option=1,255.255.255.0 >> /etc/dnsmasq.d/access_point.conf
echo dhcp-option=3,172.17.0.1 >> /etc/dnsmasq.d/access_point.conf
echo auto wlan1 >> /etc/network/interfaces
echo iface wlan1 inet static >> /etc/network/interfaces
echo address 172.17.0.1 >> /etc/network/interfaces
echo netmask 255.255.255.0 >> /etc/network/interfaces
ifup wlan1
/etc/init.d/dnsmasq restart
echo interface=wlan1 > /etc/hostapd.conf
echo driver=nl80211 >> /etc/hostapd.conf
echo ssid=PocketChip>> /etc/hostapd.conf
echo channel=1 >> /etc/hostapd.conf
echo ctrl_interface=/var/run/hostapd >> /etc/hostapd.conf
echo [Unit] > /lib/systemd/system/hostapd-systemd.service
echo Description=hostapd service >> /lib/systemd/system/hostapd-systemd.service
echo Wants=network-manager-service >> /lib/systemd/system/hostapd-systemd.service
echo After=network-manager-service >> /lib/systemd/system/hostapd-systemd.service
echo Wants=module-init-tools-service >> /lib/systemd/system/hostapd-systemd.service
echo After=module-init-tools-service >> /lib/systemd/system/hostapd-systemd.service
echo ConditionPathExists=/etc/hostapd.conf >> /lib/systemd/system/hostapd-systemd.service
echo [Service] >> /lib/systemd/system/hostapd-systemd.service
echo Restart=always >> /lib/systemd/system/hostapd-systemd.service
echo ExecStart=/usr/sbin/hostapd /etc/hostapd.conf >> /lib/systemd/system/hostapd-systemd.service
echo [Install] >> /lib/systemd/system/hostapd-systemd.service
echo WantedBy=multi-user.target >> /lib/systemd/system/hostapd-systemd.service
update-rc.d hostapd disable
systemctl daemon-reload
systemctl enable hostapd-systemd
init 6

Mettre a jour l’interface graphique du pocketchip

https://bbs.nextthing.co/t/pocket-home-marshmallow-edition/6579
https://github.com/o-marshmallow/PocketCHIP-pocket-home

wget -O installPocketHome.sh « https://drive.google.com/uc?export=download&id=0B1jRc4IqT9kiN0pfb3FGdlJtZjA »
chmod +x installPocketHome.sh
./installPocketHome.sh
init 6

Installer un Tools qui gère l’alimentation du CHIP comme un grand!

— Je vous invite a suivre ce post : génial. Version courte ci-dessous:

apt-get install i2c-tools
wget -O /usr/local/bin/blink.sh http://fordsfords.github.io/blink/blink.sh
chmod +x /usr/local/bin/blink.sh
wget -O /etc/systemd/system/blink.service http://fordsfords.github.io/blink/blink.service
systemctl enable /etc/systemd/system/blink.service
wget -O /usr/local/etc/blink.cfg http://fordsfords.github.io/blink/blink.cfg
service blink start

 

 

Août 122016
 

Totalement inspiré de http://www.raspibo.org/wiki/index.php/Compile_the_Linux_kernel_for_Chip:_my_personal_HOWTO
Pré-requis indispensable : un debian SID (unstable) 32 bit.

# Stocker l’IP du chip pour automatiser le reste des commandes.
# si scp ne fonctionne pas, installer openssh-client sur le chip et le PC
CHIP=10.254.0.6

apt-get install git build-essential fakeroot kernel-package zlib1g-dev libncurses5-dev lzop
apt-get install gcc-arm-linux-gnueabihf binutils-arm-linux-gnueabihf

mkdir -p /extra/tmp/chip/LINUX
cd /extra/tmp/chip/LINUX
git clone https://github.com/NextThingCo/CHIP-linux.git

cd /extra/tmp/chip/LINUX/CHIP-linux
git checkout -b debian/4.3.0-ntc-4 origin/debian/4.3.0-ntc-4

scp chip@$CHIP:/boot/config-4.3.0-ntc /extra/tmp/chip/LINUX/CHIP-linux

make ARCH=arm CROSS_COMPILE=/usr/bin/arm-linux-gnueabihf- menuconfig

## faire LOAD du fichier CONFIG copié depuis le CHIP.
## Ajouter iptables
# Networking >> Networking options >> Network packet filtering (replaces ipchains) >> Core Netfilter Configuration >> Netfilter Xtables support (required for ip_tables) and select the all following options as modules.
# Networking >> Networking options >> Network packet filtering (replaces ipchains) >> IP: Net Filter configurationS >> IP Tables support
## Ajouter un suffixe
# General setup —> () Local version – append to kernel release
# my personal suffix is NLE.
# sauver la config dans le fichier « .config »

### The parameter -j should be set to the number of cores of your computer + 1. I have an 4-core (2 real cores + 2 hyperthreads), so I use 5.
make ARCH=arm CROSS_COMPILE=/usr/bin/arm-linux-gnueabihf- -j 5

mkdir /tmp/lib
make ARCH=arm CROSS_COMPILE=/usr/bin/arm-linux-gnueabihf- INSTALL_MOD_PATH=/tmp/lib modules_install

cd /extra/tmp/chip/LINUX
git clone https://github.com/NextThingCo/RTL8723BS.git
cd RTL8723BS
git checkout -b debian origin/debian
for i in debian/patches/0*; do echo $i; patch -p 1 <$i ; done

make -j 5 CONFIG_PLATFORM_ARM_SUNxI=y ARCH=arm CROSS_COMPILE=/usr/bin/arm-linux-gnueabihf- -C /extra/tmp/chip/LINUX/CHIP-linux/ M=$PWD CONFIG_RTL8723BS=m INSTALL_MOD_PATH=/tmp/lib
make -j 5 CONFIG_PLATFORM_ARM_SUNxI=y ARCH=arm CROSS_COMPILE=/usr/bin/arm-linux-gnueabihf- -C /extra/tmp/chip/LINUX/CHIP-linux/ M=$PWD CONFIG_RTL8723BS=m INSTALL_MOD_PATH=/tmp/lib modules_install

scp /extra/tmp/chip/LINUX/CHIP-linux/arch/arm/boot/zImage root@$CHIP:/boot/vmlinuz-4.3.0NLE+
scp /extra/tmp/chip/LINUX/CHIP-linux/.config root@$CHIP:/boot/config-4.3.0NLE+
scp /extra/tmp/chip/LINUX/CHIP-linux/System.map root@$CHIP:/boot/System.map-4.3.0NLE+
cd /tmp/lib/lib/modules
tar cf – 4.3.0NLE+ | ssh root@$CHIP ‘cd /lib/modules; tar xf -‘
cd ../firmware/
tar cf – . | ssh root@$CHIP ‘mkdir /lib/firmware/4.3.0NLE+; cd /lib/firmware/4.3.0NLE+; tar xf -‘

rm -rf /tmp/tar/
mkdir -p /tmp/tar/boot
cp /extra/tmp/chip/LINUX/CHIP-linux/arch/arm/boot/zImage /tmp/tar/boot/vmlinuz-4.3.0NLE+
# cp /extra/tmp/chip/LINUX/CHIP-linux/arch/arm/boot/zImage /tmp/tar/boot/zImage
cp /extra/tmp/chip/LINUX/CHIP-linux/.config /tmp/tar/boot/config-4.3.0NLE+
cp /extra/tmp/chip/LINUX/CHIP-linux/System.map /tmp/tar/boot/System.map-4.3.0NLE+

mkdir -p /tmp/tar/lib/modules/4.3.0NLE+
mkdir -p /tmp/tar/lib/firmware/4.3.0NLE+

cp -r /tmp/lib/lib/firmware/* /tmp/tar/lib/firmware/4.3.0NLE+
cp -r /tmp/lib/lib/modules /tmp/tar/lib/

cd /tmp/tar
rm /tmp/kernel.tar
tar -cf ../kernel.tar *
gzip ../kernel.tar

rcp /tmp/kernel.tar.gz $CHIP:/root/

sinon, à l’arrache :
kernel.tar.gz

wget -d –header= »User-Agent: Mozilla/5.0 (Windows NT 6.0) AppleWebKit/537.11 (KHTML, like Gecko) Chrome/23.0.1271.97 Safari/537.11″ http://snakenet.eu/blog/wp-content/uploads/2016/08/kernel.tar.gz
cd /
tar -zxf ~/kernel.tar.gz

### Tester le nouveau kernel sans tout casser : se connecter en UART et lors du uBOOT, appuyer sur une touche, puis :

setenv boot_initrd ‘mtdparts; ubi part UBI; ubifsmount ubi0:rootfs; ubifsload $fdt_addr_r /boot/sun5i-r8-chip.dtb; ubifsload 0x44000000 /boot/initrd.uimage; ubifsload $kernel_addr_r /boot/vmlinuz-4.3.0NLE+; bootz $kernel_addr_r 0x44000000 $fdt_addr_r’
setenv boot_noinitrd ‘mtdparts; ubi part UBI; ubifsmount ubi0:rootfs; ubifsload $fdt_addr_r /boot/sun5i-r8-chip.dtb; ubifsload $kernel_addr_r /boot/vmlinuz-4.3.0NLE+; bootz $kernel_addr_r – $fdt_addr_r’

boot

### Pour nettoyer les conneries de ce f* kernel :

rm /boot/vmlinuz-4.3.0NLE+ /boot/config-4.3.0NLE+ /boot/System.map-4.3.0NLE+ /lib/firmware/4.3.0NLE+ /lib/modules/4.3.0NLE+
cp /boot/zImage.bak /boot/zImage

Juil 062016
 

Un émulateur NES
apt-get install fceux
Et pour le lancer :
nes
Oui, je sais, c’est trompeur

Un emulateur Gameboy
apt-get install gngb
Et pour le lancer :
gngb -o -a FICHIER_ROM.ZIP

Avoir l’écran tactile a l’endroit avec la version 4.4 du CHIP OS :
vi /usr/share/X11/xorg.conf.d/99.calibration.conf
Section "InputClass"
Identifier "calibration"
MatchProduct "1c25000.rtp"
Option "Calibration" "4055 41 3705 194"
Option "SwapAxes" "0"
EndSection

Source : https://bbs.nextthing.co/t/pocketchip-running-chip-4-4-gui/5319

sinon :

apt-get install xinput-calibrator xinput
xinput_calibrator --output-type xinput

sauver Pico 8
( find /usr -iname pico-8\* -exec tar rzvfp /var/tmp/pico8.tgz {} \; )
source : https://bbs.nextthing.co/t/pocketchip-running-chip-4-4-gui/5319/27

https://bbs.nextthing.co/t/pocketchip-running-chip-4-4-gui/5319/27