Go to advanced search

by tqhien
Fri Aug 23, 2019 1:29 pm
Forum: General discussion
Topic: unplug anytime ?
Replies: 21
Views: 577

Re: unplug anytime ?

Well, SDCard or USBpendrives are the same and subject to wear levelling. Only USB HDD drive would be safe. But on an embedded computer as mine, HDD USB is not possible. Wear levelling is concerned for writing blocks. And when I create a partition, write to it, I only change a few block on it. And fo...
by tqhien
Fri Aug 23, 2019 11:40 am
Forum: General discussion
Topic: unplug anytime ?
Replies: 21
Views: 577

Re: unplug anytime ?

Hello, For one of my project (embedded rpi on motorbike), I used the following configuration on a single SDCard : - boot partition (fat) - root file system read-only (ext2 or ext4) - 2 btrfs partitions for user data, in raid mode, with 5 seconds cache (data are written to disk every 5 seconds, mirro...
by tqhien
Tue Jul 09, 2019 9:43 am
Forum: Français
Topic: erreur code python qui marche 2 fois : Segmentation fault
Replies: 10
Views: 411

Re: erreur code python qui marche 2 fois

Pour les écritures de fichier, je te conseille de passer plutôt sur la syntaxe suivante : try: with open("output", "a") as outfile: outfile.write('Hello World') except IOError: print ('oops!') Cela permet d'ouvrir, d'écrire et refermer le fichier tout de suite (with, pas besoin de close) tout en int...
by tqhien
Wed Jul 03, 2019 9:27 am
Forum: General discussion
Topic: Boot time on original Pi
Replies: 21
Views: 878

Re: Boot time on original Pi

About security, it is up to you to install (or not) some security packages, to make SD read only, or to setup an authentification server in your network. Debian and Ubuntu do that for you. With Buildroot, you have to select them yourself (but you know then how everything is tied together, so better ...
by tqhien
Tue Jul 02, 2019 3:44 pm
Forum: General discussion
Topic: Boot time on original Pi
Replies: 21
Views: 878

Re: Boot time on original Pi

Hi, For buildroot tutorial, I have a French one : https://www.blaess.fr/christophe/articles/creer-un-systeme-complet-avec-buildroot/ I think it is not too difficult to follow : first part is creating the toolchain () , second part is creating a basic system ("système complet"). "Installation et boot...
by tqhien
Mon Jul 01, 2019 1:14 pm
Forum: Français
Topic: [RESOLU] python : comment eviter les faux positifs sur add_event_detect
Replies: 5
Views: 358

Re: python : comment eviter les faux positifs sur add_event_detect

Salut,

Pour le processeur à 100%, c'est à cause du "pass" dans la boucle principale. Le programme ne fait rien, mais il le fait à fond ;) Normalement, je fais un time.sleep(.2) ou tout autre valeur à la place du pass pour réduire la charge processeur entre 2 affichages de mes infos.

Hien.
by tqhien
Mon Jul 01, 2019 1:03 pm
Forum: General discussion
Topic: Boot time on original Pi
Replies: 21
Views: 878

Re: Boot time on original Pi

Hello, I use "Buildroot" to custom build a kernel and boot to my python app, in something like 12 seconds with a RpiZero (6 seconds to boot, a few more for loading my python/pygame graphic app) so I can say that's quite optimized ! The basic buildroot recipe allows a simple boot to Busybox, and then...
by tqhien
Fri Jun 28, 2019 9:44 am
Forum: Python
Topic: Button press toggle
Replies: 6
Views: 390

Re: Button press toggle

Hi,

Did you try a simple

Code: Select all

if (test) :
    ingame = not ingame
That's how I toggle a boolean var.

Hien.
by tqhien
Fri Jun 28, 2019 9:30 am
Forum: Français
Topic: [RESOLU] python : comment eviter les faux positifs sur add_event_detect
Replies: 5
Views: 358

Re: python : comment eviter les faux positifs sur add_event_detect

Bonjour, Alors j'ai un peu répondu sur ton autre post, mais je remets ma réponse ici. Théoriquement un interrupteur, c'est ouvert ou fermé. Dans la réalité, entre le passage de l'un à l'autre, il y a une foule de micro coupures (de rebond). Selon l'interrupteur, ces rebonds durent plus ou moins long...
by tqhien
Fri Jun 28, 2019 9:18 am
Forum: Français
Topic: [ RESOLU ] question debutant sur code python
Replies: 8
Views: 643

Re: question debutant sur code python

Bonjour, Alors, voici quelques éléments pour t'aider dans ton projet. L'utilisation du callback, c'est de générer des interruptions et donc de s'affranchir de la boucle while (ou d'utiliser la boucles while pour faire autre chose, comme affichage de la température, etc). Lorsqu'il y a changement d'é...
by tqhien
Fri Jun 21, 2019 2:46 pm
Forum: Français
Topic: Rasberry Pi CM3
Replies: 3
Views: 413

Re: Rasberry Pi CM3

Bonjour, Sur le CM3, le boot par défaut est la mémoire eMMC intégrée. Pour remettre tout en ordre, je te conseille le lien suivant : https://www.blaess.fr/christophe/2019/02/01/un-raspberry-pi-en-production/#more-5473 qui pourra te guider dans le remise en route. Il y a notamment un jumper J4 à basc...
by tqhien
Fri Jun 14, 2019 10:34 am
Forum: Français
Topic: Camera Pi 5 MP image rosée
Replies: 1
Views: 236

Re: Camera Pi 5 MP image rosée

Bonjour, De ce que je comprends, ta camera est la version NoIR , c'est-à-dire la caméra infrarouge. Si c'est bien le cas, l'image rosée est normale, puisqu'elle retranscrit dans des tons "visibles" des couleurs "invisibles" pour l'oeil humain. Tu verras ici : https://raspi.tv/2016/new-and-old-raspbe...
by tqhien
Mon May 27, 2019 2:05 pm
Forum: Français
Topic: Erreur avev pygame et moviepy
Replies: 4
Views: 367

Re: Erreur avev pygame et moviepy

Bonjour,

L'erreur renvoit sur la ligne avec le nom de fichier. Sous linux, c'est le slash "/" qui indique le répertoire. Or tu as "\" dans les chemins.

Hien.
by tqhien
Fri May 10, 2019 3:35 pm
Forum: Python
Topic: Python GPIO add_event_detect
Replies: 8
Views: 6532

Re: Python GPIO add_event_detect

The "pin" parameter is simply the GPIO that called the callback function.

You could define the same callback to multiple pins and print(pin) inside the function to view which one was triggered.

Hien.
by tqhien
Fri May 10, 2019 3:18 pm
Forum: Advanced users
Topic: Running a pi 2b headless with pygame in a vehicle
Replies: 3
Views: 345

Re: Running a pi 2b headless with pygame in a vehicle

Hello. For a project of mine, I uses pygame with a simple tft screen for use with the framebuffer. I used a tutoril from Adafruit to test the framebuffer driver : https://learn.adafruit.com/pi-video-output-using-pygame/pointing-pygame-to-the-framebuffer You need to call the script with sudo as root ...
by tqhien
Tue Feb 12, 2019 12:27 pm
Forum: Advanced users
Topic: How to enable WIFI direct and run a dhcp server on pi zero w
Replies: 4
Views: 554

Re: How to enable WIFI direct and run a dhcp server on pi zero w

Well, I'd say that wifi p2p is not really necessary as your PiZero will be an access point with hostapd ! wfi p2p is mainly aimed for 2 client connexion. It is in the hostpad.conf that you set some parameters. For example : ssid="Your SSID Here" wpa=3 wpa_passphrase=YourPresharedKeyHere wpa_key_mgmt...
by tqhien
Mon Feb 11, 2019 2:14 pm
Forum: Advanced users
Topic: How to enable WIFI direct and run a dhcp server on pi zero w
Replies: 4
Views: 554

Re: How to enable WIFI direct and run a dhcp server on pi zero w

Hi,

Dhcpd (dnsmasq) assigns the IP adresses. It is hostapd that tells ssid and passphrase for the wifi connection. wpa_supplicant is on the client side : your PC or whatever needs to connect to your PiZero. No need for wpa_supplicant on the server (your PiZero).
by tqhien
Fri Dec 07, 2018 9:55 am
Forum: General discussion
Topic: RPI Zero g_usb_mass_storage
Replies: 10
Views: 711

Re: RPI Zero g_usb_mass_storage

Well, OP asked how he could implement MTP, so I thought the link I provided may be suitable for him...
by tqhien
Thu Dec 06, 2018 2:20 pm
Forum: General discussion
Topic: RPI Zero g_usb_mass_storage
Replies: 10
Views: 711

Re: RPI Zero g_usb_mass_storage

I found a link for what seems adequate :

https://github.com/viveris/uMTP-Responder

I'll try it on a project where for now I mount a file, stops Pi's activity while connected as USB and dismount/remount after disconnection.
by tqhien
Thu Dec 06, 2018 10:45 am
Forum: General discussion
Topic: RPI Zero g_usb_mass_storage
Replies: 10
Views: 711

Re: RPI Zero g_usb_mass_storage

Did you try to mount the file on your system file ?

With your g_mass_storage file being /home/rpi/piusb.bin

Code: Select all

sudo mount -t vfat /home/rpi/piusb.bin /mnt/piusb 
But it is not advised to have 2 writeable systems at the same time...
by tqhien
Thu Dec 06, 2018 10:39 am
Forum: General discussion
Topic: Tweaking Raspbian img
Replies: 11
Views: 653

Re: Tweaking Raspbian img

You can first boot the standard img, activate ssh, add/delete users. Then on your computer, you backup your sd card with the dd command :

Code: Select all

sudo dd bs=4M if=/dev/sdb of=raspbian.img 
Change /dev/sdb by your sd drive (mmblk0px for example)
by tqhien
Thu Nov 29, 2018 9:58 am
Forum: Français
Topic: Acces a mon bouquet ORange TV depuis Raspi 3
Replies: 14
Views: 4329

Re: Acces a mon bouquet ORange TV depuis Raspi 3

Il y a une solution : c'est d'installer un serveur VPN sur ta Livebox et de s'y connecter à partir de ton mobile/portable. Tu peux alors accéder à ton réseau comme si tu étais chez toi.
by tqhien
Wed Nov 28, 2018 11:29 am
Forum: General discussion
Topic: Automatic Cooling Fan on Pi
Replies: 3
Views: 655

Re: Automatic Cooling Fan on Pi

You can get cpu temperature with the device virtual filesystem, like this (python) : try: tfile = open('/sys/class/thermal/thermal_zone0/temp') t = tfile.read() temperature = float(t)/1000 tfile.close() except: pass then test temperature and trigger your fan (think about hysteresis so the fan does n...
by tqhien
Tue Nov 27, 2018 2:15 pm
Forum: Français
Topic: Raspberry pour remplacer un carpc sous Windows 10
Replies: 4
Views: 1243

Re: Raspberry pour remplacer un carpc sous Windows 10

C'est typiquement un projet de linux embarqué (embedded linux). Je suis aussi sur un projet embarqué, mais c'est pour mettre sur une moto (un dérouleur de roadbook numérique). Je peux te conseiller d'aller à l'adresse suivante : https://www.blaess.fr/christophe/2015/12/08/creation-dun-systeme-comple...
by tqhien
Mon Nov 26, 2018 11:48 am
Forum: Python
Topic: pnmea2 in python3
Replies: 7
Views: 1300

Re: pnmea2 in python3

Hi,

Just after reading data, can you print what it reads, just to see if the next test is good :

Code: Select all

data = ser.readline()
print(data)

Go to advanced search