Show Posts
Pages: [1] 2
1  International / Portugues / Re: Arduino Leonardo com assinatura inválida on: March 17, 2014, 06:32:55 pm
não tenho foto, posso tentar tirar amanhã, mas queria dizer/escrever pinos ISP (os seja a ficha com 6 pinos no extremo oposto à ficha usb.)
2  International / Portugues / Re: Arduino Leonardo com assinatura inválida on: March 17, 2014, 06:23:02 am
nos pinos spi
3  International / Portugues / Arduino Leonardo com assinatura inválida on: March 16, 2014, 06:47:49 pm
enviei o blink without delay através do IDE do Arduino para um Leonardo e deu erro durante o upload.
pesquisei na web e pensei que o problema fosse do bootloader.
Liguei um uspasp e através do ide do arduino, com os settings USBASP as programmer e board Leonardo tentei enviar o bootloader.
Também não funcionou.
Fui à linha de comandos e tentei assim:
Code:
cd "C:\Program Files (x86)\Arduino\hardware\tools\avr\etc"
..\bin\avrdude -b 19200 -c usbasp -p m328p -v -e -U efuse:w:0xcb:m -U hfuse:w:0xd8:m -U lfuse:w:0xff:m -C avrdude.conf -p m32u4 -F
dá erro na mesma e agora diz:
Code:
avrdude: Version 5.11, compiled on Sep  2 2011 at 19:38:36
         Copyright (c) 2000-2005 Brian Dean, http://www.bdmicro.com/
         Copyright (c) 2007-2009 Joerg Wunsch

         System wide configuration file is "avrdude.conf"

         Using Port                    : lpt1
         Using Programmer              : usbasp
         Overriding Baud Rate          : 19200
         AVR Part                      : ATmega32U4
         Chip Erase delay              : 9000 us
         PAGEL                         : PD7
         BS2                           : PA0
         RESET disposition             : dedicated
         RETRY pulse                   : SCK
         serial program mode           : yes
         parallel program mode         : yes
         Timeout                       : 200
         StabDelay                     : 100
         CmdexeDelay                   : 25
         SyncLoops                     : 32
         ByteDelay                     : 0
         PollIndex                     : 3
         PollValue                     : 0x53
         Memory Detail                 :

                                  Block Poll               Page
      Polled
           Memory Type Mode Delay Size  Indx Paged  Size   Size #Pages MinW  Max
W   ReadBack
           ----------- ---- ----- ----- ---- ------ ------ ---- ------ ----- ---
-- ---------
           eeprom        65    10     8    0 no       1024    8      0  9000  90
00 0x00 0x00
           flash         65     6   128    0 yes     32768  128    256  4500  45
00 0x00 0x00
           lfuse          0     0     0    0 no          1    0      0  9000  90
00 0x00 0x00
           hfuse          0     0     0    0 no          1    0      0  9000  90
00 0x00 0x00
           efuse          0     0     0    0 no          1    0      0  9000  90
00 0x00 0x00
           lock           0     0     0    0 no          1    0      0  9000  90
00 0x00 0x00
           calibration    0     0     0    0 no          1    0      0     0
 0 0x00 0x00
           signature      0     0     0    0 no          3    0      0     0
 0 0x00 0x00

         Programmer Type : usbasp
         Description     : USBasp, http://www.fischl.de/usbasp/

avrdude: auto set sck period (because given equals null)
avrdude: error: programm enable: target doesn't answer. 1
avrdude: initialization failed, rc=-1
avrdude: AVR device initialized and ready to accept instructions
avrdude: Device signature = 0x000000
avrdude: Yikes!  Invalid device signature.
avrdude: Expected signature for ATmega32U4 is 1E 95 87

avrdude done.  Thank you.

Há alguma forma de resolver este problema da assinatura inválida?

Agradeço antecipadamente,

Pedro
4  International / Portugues / Re: ajudem por favor on: June 28, 2013, 10:18:06 am
tenho um UNO que deixa de ser reconhecido de forma aleatória, quando isso acontece uso um USB-ASP para lhe meter o bootloader através dos pinos SPI e ele volta à vida mais uns tempos...
5  Using Arduino / Networking, Protocols, and Devices / Re: How to update database on wamp server using arduino ? on: June 27, 2013, 01:19:49 pm
i don't think you're using the right lib, Ethernet.h is used on the Wiznet shields, you should use something like this lib, although i don't think there's a "client mode" for the ENC28J60.
6  International / Español / Re: ETHERNET CLIENT a direccion URL on: June 26, 2013, 08:37:05 am
Este código envia 3 valores para um script php que corre numa Raspberry Pi e utiliza o server name em vez do endereço IP.
Code:
#include <SPI.h>
#include <Ethernet.h>
#include "DHT.h"
#define DHTPIN 2
#define DHTTYPE DHT22
#define SENSORID 1
EthernetClient client;
DHT dht(DHTPIN, DHTTYPE);
byte mac[] = {  
  0x00, 0xAA, 0xBB, 0xCC, 0xDE, 0x02 };
char serverName[] = "<endereço web do servidor>"; //xyz.no-ip.org, por exemplo

long previousMillis = 0;
long interval = 5000;

double dewPointFast(double celsius, double humidity)
{
  double a = 17.271;
  double b = 237.7;
  double temp = (a * celsius) / (b + celsius) + log(humidity/100);
  double Td = (b * temp) / (a - temp);
  return Td;
}

void setup() {
  Serial.begin(9600);
  if (Ethernet.begin(mac) != 1)
  {
    Serial.println("Erro no DHCP");
    while(true);
  }
  else
  {
    Serial.println("DHCP OK");
    dht.begin();
  }
}

void loop()
{
  unsigned long currentMillis = millis();
  if(currentMillis - previousMillis > interval)
  {
    previousMillis = currentMillis;  
    float h = dht.readHumidity();
    float t = dht.readTemperature();
    double d=dewPointFast(t,h);
    if (isnan(t) || isnan(h))
    {
      Serial.println("Failed to read from DHT");
    }
    else
    {
      Serial.println("Connecting");
      if (client.connect(serverName, 80))
      {
        client.print("GET /registar.php?temp=");
        client.print(t,DEC);
        client.print("&hum=");
        client.print(h,DEC);
        client.print("&dew=");
        client.print(d,DEC);
        client.print("&sensor=");
        client.print(SENSORID);
        client.println(" HTTP/1.0");
        client.print(" Host: ");
        client.println(SENSORID);
        client.println();
      }
    }
  }
}
7  International / Portugues / Re: Programa não esta respondendo on: March 27, 2013, 07:45:42 pm
Se o device se chama /dev/ttyACM0 presumo que estejas a usar linux.
Verifica se tens acesso de escrita ao device, no Ubuntu quando o arduino IDE arranca a 1ª vez pergunta se queres adicionar o teu user ao grupo dialout, tens de confirmar e depois fazer logout e login outra vez.
8  Using Arduino / Sensors / Re: Interfacing a Temperature sensor DHT22 with a Raspberry and I2C on: March 27, 2013, 09:03:39 am
I use this code on my arduino (i'm using the Adafruit Lib), i'm sending the data to my raspberry, which stores the data on an mysql db.
Code:
#include <SPI.h>
#include <Ethernet.h>
#include "DHT.h"
#define DHTPIN 2
#define DHTTYPE DHT22
#define SENSORID 1
EthernetClient client;
DHT dht(DHTPIN, DHTTYPE);
byte mac[] = {here your intended Mac Address};
char serverName[] = "Here your server address";
long previousMillis = 0;
long interval = 5000;
double dewPointFast(double celsius, double humidity)
{
  double a = 17.271;
  double b = 237.7;
  double temp = (a * celsius) / (b + celsius) + log(humidity/100);
  double Td = (b * temp) / (a - temp);
  return Td;
}
void setup()
{
  Serial.begin(9600);
  if (Ethernet.begin(mac) != 1)
  {
    Serial.println("Erro no DHCP");
    while(true);
  }
  else
  {
    Serial.println("DHCP OK");
    dht.begin();
  }
}

void loop()
{
  unsigned long currentMillis = millis();
  if(currentMillis - previousMillis > interval)
  {
    previousMillis = currentMillis;  
    float h = dht.readHumidity();
    float t = dht.readTemperature();
    double d=dewPointFast(t,h);
    if (isnan(t) || isnan(h))
    {
      Serial.println("Failed to read from DHT");
    }
    else
    {
      Serial.println("Connecting");
      if (client.connect(serverName, 80))
      {
        client.print("GET /registar.php?temp=");
        client.print(t,DEC);
        client.print("&hum=");
        client.print(h,DEC);
        client.print("&dew=");
        client.print(d,DEC);
        client.print("&sensor=");
        client.print(SENSORID);
        client.println(" HTTP/1.0");
        client.print(" Host: ");
        client.println(SENSORID);
        client.println();
      }
    }
  }
}
And here's my PHP script:
Code:
<?php
error_reporting
(0);
    
$fields explode("&"$_SERVER['QUERY_STRING']);
    
$values = array();
    foreach (
$fields as $field)
    {
        
$keyval explode("="$field);
        
$values[$keyval[0]] = $keyval[1];
    }
$t=round($values['temp'],2);
$h=round($values['hum'],2);
$po=round($values['dew'],2);
$sensor=($values['sensor']);
//Put your own values below
$user="";
$password="";
$database="";
$host="localhost";
mysql_connect($host,$user,$password);
@
mysql_select_db($database) or die( "Unable to select database");
$query="INSERT INTO `TABLE`(`Temperatura`, `Humidade`, `Ponto_Orvalho`, `Sensor`) VALUES ($t,$h,$po,$sensor);";
mysql_query($query);
mysql_close();
?>

9  International / Portugues / Re: Arduino + ENC28J60 + Website - Problemas on: March 12, 2013, 07:18:06 am
Não conheço nenhuma lib para a ENC28J60 que lhe permita funcionar como cliente.
Por isso sugiro-lhe que pense essa situação ao contrário, ou seja, o arduino com a ENC28J60 disponibiliza os dados e o outro computador vai fazendo o polling desses dados.
10  International / Français / Re: PHP et arduino ethernet shield on: December 22, 2012, 04:38:46 am
See if this fits you.
11  Community / Bar Sport / Re: Raspberry Pi launch farce on: August 18, 2012, 07:15:42 pm
Don't judge linux by your experience with the Pi, GM.  Besides the realtime issue, which isn't really an issue once you accept its a multitasking OS (although putting GPIO on it lends itself to needing realtime), Linux on the Pi and Linux on half decent hardware are two entirely unrelated animals.  I use it full time, although my distro of choice is Ubuntu, Debian is close enough so the differences on the Pi aren't great. The Pi sucks because of the severe compromises made to get the price down in my opinion.  You're right, it is stone soup.  The choice of power supply is the root of a lot of the problems.  Charging a smart phone battery is a whole different animal to running a desktop computer, factor in the polyfuses (needed to stop it overloading said PSU and wiring) and the poor USB/ethernet implementation and the whole thing becomes a pain.  Its lack of grunt is sometimes a problem but I'll leave that bit alone.

I have now a rock solid Pi, (attacking said polyfuses with a soldering iron and feeding it power via the GPIO pins got rid of many of the problems I was having) , but I still can't get it to play nicely with any of my webcams (all of which are plug and play on my PC and Ubuntu) and using workarounds for talking to an Arduino is a pain.  I've just ordered a 'works out of the box' webcam as a last ditch attempt to get it to do what I want, we'll see on that front.

I'd take Linux over OSX anyday but I haven't really used a Mac in earnest since Tiger. 



You could try vgrabbj, probably you'll need to diagnose your webcam to get it's details.
I managed to get my QuickCam Messenger Plus working on my raspberry pi.
12  Using Arduino / Installation & Troubleshooting / Re: Can I use my Uno on both my Linux PC and my XP PC? on: August 17, 2012, 05:17:37 pm
yes, you can use it your all the supported OS's
13  International / Portugues / Re: Arduino + PHP on: August 16, 2012, 12:42:16 pm
tens razão... retirei o delay e "adaptei" o código do blinknodelay
14  International / Portugues / Re: Arduino + PHP on: August 15, 2012, 05:17:06 pm
Obrigado, já resolvi... Ficou assim:
Code:
#include <SPI.h>
#include <Ethernet.h>
#include <dht11.h>
dht11 DHT11;
#define DHT11PIN 2
byte mac[] = { 
  0xDE, 0xAD, 0xBE, 0xEF, 0xFE, 0xED };
IPAddress server(192,168,10,203);
EthernetClient client;

void setup()
{
  Serial.begin(9600);
  if (Ethernet.begin(mac) == 0) {
    Serial.println("Failed to configure Ethernet using DHCP");
    for(;;)
      ;
  }
  delay(1000);
  Serial.println("connecting...");
}

void loop()
{
  if (client.connect(server, 80))
  {
    Serial.println("connected");
    int chk = DHT11.read(DHT11PIN);
    Serial.print("Read sensor: ");
    switch (chk)
    {
    case 0:
      Serial.println("OK");
      break;
    case -1:
      Serial.println("Checksum error");
      break;
    case -2:
      Serial.println("Time out error");
      break;
    default:
      Serial.println("Unknown error");
      break;
    }
    int hum=DHT11.humidity;
    int temp=DHT11.temperature;
    float dew=DHT11.dewPoint();
    if (client.connected())
    {
      Serial.println("Sending Data...");
      client.print("GET /registar.php?hum=");
      client.print(hum,DEC);
      client.print("&temp=");
      client.print(temp,DEC);
      client.print("&dew=");
      client.print(dew,DEC);
      client.println(" HTTP/1.1");
      client.println("Host: arduino1");
      client.println();
      client.stop();
    }
    Serial.println("Data Sent..."); 
    Serial.print("Humidade: ");
    Serial.print(hum);
    Serial.println("%");
    Serial.print("Temperatura: ");
    Serial.print(temp);
    Serial.println("*C");
    Serial.print("Ponto de Orvalho: ");
    Serial.print(dew);
    Serial.println("*C");
    while(client.available())
    {
      char c = client.read();
      Serial.print(c);
    }
    delay(5000);
    client.stop();
    delay(5000);
  }
  else
  {
    Serial.println("connection failed");
  }
}
Quanto ao delay, este sensor não é muito rápido e chega-me perfeitamente um sample de 10 em 10 segundos.
Obrigado pela ajuda.
15  Using Arduino / Project Guidance / Re: Arduino to Raspberry Pi communication options on: August 15, 2012, 08:52:35 am
you could try apache2 and PHP on the raspberry and the arduinos in client mode, perhaps...
you can take a look to an example of what i'm talking at here
Pages: [1] 2