Aller au contenu


Photo
- - - - -

arduino raspberry pi : ralentissement


  • Veuillez vous connecter pour répondre
37 réponses à ce sujet

#21 Path

Path

    Made By Humans

  • Modérateur
  • PipPipPipPipPip
  • 2 504 messages
  • Gender:Male
  • Location:Paris

Posté 21 mars 2016 - 01:00

Bizarre tu as quoi dans /usr/share/arduino/libraries sur le PI ?

 

Je viens de tester une compilation avec ce même #include <LiquidCrystal.h> et ça fonctionne.

 

Tu peux aussi envoyer ton Makefile stp ?

 

 

Sinon, USER_LIB_PATH, c'est pour contenir tes propre libs, pas celles fournies par arduino.

Si tu n'as pas écrit de lib à toi, tu ne dois rien avoir dans ce paramètre.

 

 

A tout les 2 on va bien y arriver.



#22 bypbop

bypbop

    Habitué

  • Membres
  • PipPip
  • 273 messages
  • Gender:Male
  • Location:Lille

Posté 21 mars 2016 - 08:41

ARDUINO_DIR = /usr/share/arduino
BOARD_TAG = mega
ARDUINO_PORT = /dev/ttyUSB0
ARDUINO_LIBS =
USER_LIB_PATH = /home/pi/SBR/arduino/libs
include /usr/share/arduino/Arduino.mk

bizarre j'ai bien la librairie :

 

j'ai ceci 

 
EEPROM    Firmata        SD     SoftwareSerial  Stepper
Ethernet  LiquidCrystal  Servo  SPI             Wire
 
 
Cordialement,
bypbop


#23 Path

Path

    Made By Humans

  • Modérateur
  • PipPipPipPipPip
  • 2 504 messages
  • Gender:Male
  • Location:Paris

Posté 21 mars 2016 - 09:29

Je sais pas si c'est important. Mais ce que tu as dans USER_LIB_PATH, c'est le chemin vers mes libs. (copier/collé trop rapide) ^^

"SBR" c'est Self Balancing Robot. :)

 

Si tu n'as pas écrit ta propre lib, retire cette ligne !! ou laisse la vide.



#24 bypbop

bypbop

    Habitué

  • Membres
  • PipPip
  • 273 messages
  • Gender:Male
  • Location:Lille

Posté 21 mars 2016 - 09:55

ok oui j'ai pas ecrit de Lib je vire ca !

 

mais j'ai tjrs la mm erreur :

fatal error: LiquidCrystal.h: No such file or directory
compilation terminated.
/usr/share/arduino/Arduino.mk:426: recipe for target 'build-cli/Karduino.o' failed
make: *** [build-cli/Karduino.o] Error 1

juste pour verfier

root@raspberrypi:/usr/share/arduino/libraries/LiquidCrystal# ls
examples  keywords.txt  LiquidCrystal.cpp  LiquidCrystal.h

Makefile

ARDUINO_DIR = /usr/share/arduino
BOARD_TAG = mega
ARDUINO_PORT = /dev/ttyUSB0
ARDUINO_LIBS =
include /usr/share/arduino/Arduino.mk


#25 Path

Path

    Made By Humans

  • Modérateur
  • PipPipPipPipPip
  • 2 504 messages
  • Gender:Male
  • Location:Paris

Posté 21 mars 2016 - 10:51

Je sais pas. Ici (http://arduino.stackexchange.com/questions/9840/problem-importing-a-library-in-h-file), tu vois que le avr-gcc ne sais pas gérer les includes (même system) s'ils ne sont pas aussi ajoutés dans le .ino directement.

 

Ton #include <LiquidCrystal.h>, il est dans le .ino ?

 

 

Tu peux mettre toute le trace stp ?

à un moment, quand je rajoute le#include <LiquidCrystal.h>, le compilateur ajoute -I/usr/share/arduino/libraries/LiquidCrystal dans sa commande.

 

Chez moi, cela donne :

root@raspberrypi:/home/pi/SBR/arduino# make
-------------------------
Arduino.mk Configuration:
- [AUTODETECTED]       CURRENT_OS = LINUX 
- [COMPUTED]           ARDMK_DIR = /usr/share/arduino (relative to Common.mk)
- [AUTODETECTED]       ARDUINO_DIR = /usr/share/arduino 
- [AUTODETECTED]       ARDUINO_VERSION = 105 
- [DEFAULT]            ARDUINO_SKETCHBOOK = /root/sketchbook 
- [BUNDLED]            AVR_TOOLS_DIR = /usr/share/arduino/hardware/tools/avr (in Arduino distribution)
- [COMPUTED]           ARDUINO_LIB_PATH = /usr/share/arduino/libraries (from ARDUINO_DIR)
- [DEFAULT]            ARDUINO_CORE_PATH = /usr/share/arduino/hardware/arduino/cores/arduino 
- [COMPUTED]           ARDUINO_VAR_PATH = /usr/share/arduino/hardware/arduino/variants (from ARDUINO_DIR)
- [COMPUTED]           BOARDS_TXT = /usr/share/arduino/hardware/arduino/boards.txt (from ARDUINO_DIR)
- [USER]               USER_LIB_PATH = /home/pi/SBR/arduino/libs 
- [DEFAULT]            PRE_BUILD_HOOK = pre-build-hook.sh 
- [USER]               BOARD_TAG = uno 
- [COMPUTED]           OBJDIR = build-uno (from BOARD_TAG)
- [DETECTED]           MONITOR_BAUDRATE = 115200  (in sketch)
- [DEFAULT]            OPTIMIZATION_LEVEL = s 
- [DEFAULT]            MCU_FLAG_NAME = mmcu 
- [DEFAULT]            CFLAGS_STD = -std=gnu99 
- [COMPUTED]           DEVICE_PATH = /dev/ttyACM* (from MONITOR_PORT)
- [AUTODETECTED]       Size utility: AVR-aware for enhanced output
-
-                      ARDUINO_LIBS =
- [USER]                 Test
- [SYSTEM]               LiquidCrystal
- [COMPUTED]           BOOTLOADER_PARENT = /usr/share/arduino/hardware/arduino/bootloaders (from ARDUINO_DIR)
-------------------------
mkdir -p build-uno
/usr/share/arduino/hardware/tools/avr/bin/avr-g++ -x c++ -include Arduino.h -MMD -c -mmcu=atmega328p -DF_CPU=16000000L -DARDUINO=105 -D__PROG_TYPES_COMPAT__ -I. -I/usr/share/arduino/hardware/arduino/cores/arduino -I/usr/share/arduino/hardware/arduino/variants/standard -I/usr/share/arduino/libraries/LiquidCrystal -I/home/pi/SBR/arduino/libs/Test -Wall -ffunction-sections -fdata-sections -Os -fno-exceptions   sbr.ino -o build-uno/sbr.o
/usr/share/arduino/hardware/tools/avr/bin/avr-gcc -mmcu=atmega328p -Wl,--gc-sections -Os    -o build-uno/arduino.elf build-uno/sbr.o build-uno/libcore.a  -lc -lm
/usr/share/arduino/hardware/tools/avr/bin/avr-objcopy -j .eeprom --set-section-flags=.eeprom="alloc,load" \
	--change-section-lma .eeprom=0 -O ihex build-uno/arduino.elf build-uno/arduino.eep
/usr/share/arduino/hardware/tools/avr/bin/avr-objcopy: --change-section-lma .eeprom=0x00000000 jamais utilisé
/usr/share/arduino/hardware/tools/avr/bin/avr-objcopy -O ihex -R .eeprom build-uno/arduino.elf build-uno/arduino.hex

/usr/share/arduino/hardware/tools/avr/bin/avr-size --mcu=atmega328p -C --format=avr build-uno/arduino.elf
AVR Memory Usage
----------------
Device: atmega328p

Program:    4984 bytes (15.2% Full)
(.text + .data + .bootloader)

Data:        267 bytes (13.0% Full)
(.data + .bss + .noinit)


root@raspberrypi:/home/pi/SBR/arduino# 

Je l'ai même fait sous root pour faire comme toi. 



#26 bypbop

bypbop

    Habitué

  • Membres
  • PipPip
  • 273 messages
  • Gender:Male
  • Location:Lille

Posté 22 mars 2016 - 07:55

Re Path je viens de faire un test avec un fichier .inojuste avec la lib qui pose prb !

 

malheureusement tjrs pareil !

root@raspberrypi:/media/share/test# make
/usr/share/arduino/Arduino.mk:535: build-cli/depends.mk: No such file or directo                                                                                                             ry
mkdir build-cli
echo '#include <Arduino.h>' > build-cli/test.cpp
cat  test.ino >> build-cli/test.cpp
/usr/bin/avr-g++ -MM -mmcu=atmega1280 -DF_CPU=16000000L -DARDUINO=100 -I. -I/usr                                                                                                             /share/arduino/hardware/arduino/cores/arduino -I/usr/share/arduino/hardware/ardu                                                                                                             ino/variants/mega   -g -Os -w -Wall -ffunction-sections -fdata-sections -fno-exc                                                                                                             eptions build-cli/test.cpp -MF build-cli/test.d -MT build-cli/test.o
cat build-cli/test.d > build-cli/depends.mk
rm build-cli/test.cpp
echo '#include <Arduino.h>' > build-cli/test.cpp
cat  test.ino >> build-cli/test.cpp
/usr/bin/avr-g++ -MM -mmcu=atmega1280 -DF_CPU=16000000L -DARDUINO=100 -I. -I/usr                                                                                                             /share/arduino/hardware/arduino/cores/arduino -I/usr/share/arduino/hardware/ardu                                                                                                             ino/variants/mega   -g -Os -w -Wall -ffunction-sections -fdata-sections -fno-exc                                                                                                             eptions build-cli/test.cpp -MF build-cli/test.d -MT build-cli/test.o
cat build-cli/test.d > build-cli/depends.mk
/usr/bin/avr-g++ -c -mmcu=atmega1280 -DF_CPU=16000000L -DARDUINO=100 -I. -I/usr/                                                                                                             share/arduino/hardware/arduino/cores/arduino -I/usr/share/arduino/hardware/ardui                                                                                                             no/variants/mega   -g -Os -w -Wall -ffunction-sections -fdata-sections -fno-exce                                                                                                             ptions build-cli/test.cpp -o build-cli/test.o
build-cli/test.cpp:2:27: fatal error: LiquidCrystal.h: No such file or directory
compilation terminated.
/usr/share/arduino/Arduino.mk:426: recipe for target 'build-cli/test.o' failed
make: *** [build-cli/test.o] Error 1
root@raspberrypi:/media/share/test# 

j'ai tt copié à partir du make ...., j espere que cela t'iras ...


#27 Path

Path

    Made By Humans

  • Modérateur
  • PipPipPipPipPip
  • 2 504 messages
  • Gender:Male
  • Location:Paris

Posté 22 mars 2016 - 08:39

Mince alors ... On va trouver. Tu peux coller ton source de test stp :)

 

Déjà, on voit que ton compilateur n'ajoute pas -I/usr/share/arduino/libraries/LiquidCrystal

Peu de chance qu'il le trouve. (Mais ça n'aide pas directement)

 

La trace est très différente de la mienne ...

Tu as installé apt-get install arduino-core arduino-mk ? et uniquement ça ? Ou tu utilise un autre compilateur ?

 

Tu es sur la rasbian ?



#28 bypbop

bypbop

    Habitué

  • Membres
  • PipPip
  • 273 messages
  • Gender:Male
  • Location:Lille

Posté 22 mars 2016 - 10:06

#include <LiquidCrystal.h>

void setup() {
  // put your setup code here, to run once:

}

void loop() {
  // put your main code here, to run repeatedly:

}

j'ai fait un test avec ce fichier vierge !

 

oui j'ai suivi exactement le tuto !

login as: root
root@192.168.1.27's password:
Linux raspberrypi 4.1.7+ #817 PREEMPT Sat Sep 19 15:25:36 BST 2015 armv6l

The programs included with the Debian GNU/Linux system are free software;
the exact distribution terms for each program are described in the
individual files in /usr/share/doc/*/copyright.

Voila pour les infos



#29 Path

Path

    Made By Humans

  • Modérateur
  • PipPipPipPipPip
  • 2 504 messages
  • Gender:Male
  • Location:Paris

Posté 22 mars 2016 - 11:26

Ok merci, je vais avoir du mal à reproduire, on a pas le même raspberry. Moi c'est un PI 2 B

uname -a

Linux raspberrypi 4.1.17-v7+ #838 SMP Tue Feb 9 13:15:09 GMT 2016 armv7l GNU/Linux

En attendant, je vais préciser le tuto.

 

(Si tu l'as pas déjà fais) Tu fais un apt-get update et apt-get upgrade voire un apt-get dist-upgrade.

Et comme on est sur un petit stockage, un dernier apt-get autoremove

 

Après, tu peux peut-être mettre à jour les binaires arduino. apt-get install arduino-core arduino-mk

 

Peut-être cela va régler le pb. Dis-moi.



#30 bypbop

bypbop

    Habitué

  • Membres
  • PipPip
  • 273 messages
  • Gender:Male
  • Location:Lille

Posté 23 mars 2016 - 08:33

ok je test ca tt à l'heure je te tiens au jus ...



#31 bypbop

bypbop

    Habitué

  • Membres
  • PipPip
  • 273 messages
  • Gender:Male
  • Location:Lille

Posté 23 mars 2016 - 09:42

Bon y a du changement ;-)

 

 

j'ai fait un update et apres un upgrade et j'ai ceci maintenant !

root@raspberrypi:/media/share/test# make
make: Nothing to be done for 'all'.
root@raspberrypi:/media/share/test# make upload
for STTYF in 'stty -F' 'stty --file' 'stty -f' 'stty <' ; \
          do $STTYF /dev/tty >/dev/null 2>&1 && break ; \
        done ; \
        $STTYF   hupcl ; \
        (sleep 0.1 2>/dev/null || sleep 1) ; \
        $STTYF  -hupcl
stty: hupcl: No such file or directory
stty: -hupcl: No such file or directory
/usr/share/arduino/Arduino.mk:503: recipe for target 'reset' failed
make: *** [reset] Error 1
root@raspberrypi:/media/share/test#

apparement le make sur le fichier test.ino se passe bien !

 

mais apres le make upload ....



#32 Path

Path

    Made By Humans

  • Modérateur
  • PipPipPipPipPip
  • 2 504 messages
  • Gender:Male
  • Location:Paris

Posté 23 mars 2016 - 10:01

Ok ;) On touche au but.

 

Dans la doc (https://github.com/s...rduino-Makefile), on voit que cette commande reset est faite avec python-serial.

 

Il manque donc un pré-requis. Je l'avais déjà, je ne l'ai pas vu en pré-requis. Grace à toi, le tuto est amélioré ^^

 

Ajoute un apt-get install python-serial et dis-moi :)



#33 bypbop

bypbop

    Habitué

  • Membres
  • PipPip
  • 273 messages
  • Gender:Male
  • Location:Lille

Posté 23 mars 2016 - 10:08

;-) il est déjà installé !

login as: root
root@192.168.1.27's password:
Linux raspberrypi 4.1.7+ #817 PREEMPT Sat Sep 19 15:25:36 BST 2015 armv6l

The programs included with the Debian GNU/Linux system are free software;
the exact distribution terms for each program are described in the
individual files in /usr/share/doc/*/copyright.

Debian GNU/Linux comes with ABSOLUTELY NO WARRANTY, to the extent
permitted by applicable law.
Last login: Wed Mar 23 19:34:46 2016 from ktab.local
root@raspberrypi:~# apt-get install python-serial
Reading package lists... Done
Building dependency tree
Reading state information... Done
python-serial is already the newest version.
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
root@raspberrypi:~#



#34 Path

Path

    Made By Humans

  • Modérateur
  • PipPipPipPipPip
  • 2 504 messages
  • Gender:Male
  • Location:Paris

Posté 23 mars 2016 - 10:18

Là je suis sec. 39.gif

 

Ton Makefile qui fonctionne, tu peux le passer stp



#35 bypbop

bypbop

    Habitué

  • Membres
  • PipPip
  • 273 messages
  • Gender:Male
  • Location:Lille

Posté 23 mars 2016 - 10:25

c kler ;-) c pas trop grave Path ! c'est un peu gênant de débrancher rebrancher mais bon pas insurmontable pour l'instant ! :thank_you:  



#36 Path

Path

    Made By Humans

  • Modérateur
  • PipPipPipPipPip
  • 2 504 messages
  • Gender:Male
  • Location:Paris

Posté 23 mars 2016 - 10:31

Et pis j'ai bien fait dériver le sujet ...



#37 bypbop

bypbop

    Habitué

  • Membres
  • PipPip
  • 273 messages
  • Gender:Male
  • Location:Lille

Posté 29 mars 2016 - 03:54

Salut Path,

 

Ca va mieux le flux vidéo en réseau sur la rasPi que tu as ? 

 

Cordialement,

bypbop



#38 Path

Path

    Made By Humans

  • Modérateur
  • PipPipPipPipPip
  • 2 504 messages
  • Gender:Male
  • Location:Paris

Posté 29 mars 2016 - 10:20

Salut Bypbop

J'ai fait un test de flux video avec un webcam usb, motion sur le PI2 et vlc pour l'affichage.

J'ai aussi affiché le flux dans une page de chrome sur mon smartphone.

Je ne me suis pas penché sur la chose plus que ça.






0 utilisateur(s) li(sen)t ce sujet

0 members, 0 guests, 0 anonymous users