Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ConfigurableFirmata with Ethernet #92

Open
tfriedrich85 opened this issue Feb 3, 2020 · 1 comment
Open

ConfigurableFirmata with Ethernet #92

tfriedrich85 opened this issue Feb 3, 2020 · 1 comment

Comments

@tfriedrich85
Copy link

tfriedrich85 commented Feb 3, 2020

Hello,

I try to use ConfigurableFirmata with Ethernet I had it running with USB before, with out any compiling problems.

Now I followed the instructions to setup the Ethernet with the Arduino Nano and the Arduino Nano Ethernet Shield v.1.0
The only lines I changed are bold.
`/*
Firmata is a generic protocol for communicating with microcontrollers
from software on a host computer. It is intended to work with
any host computer software package.
To download a host software package, please clink on the following link
to open the download page in your default browser.
https://github.com/firmata/ConfigurableFirmata#firmata-client-libraries
Copyright (C) 2006-2008 Hans-Christoph Steiner. All rights reserved.
Copyright (C) 2010-2011 Paul Stoffregen. All rights reserved.
Copyright (C) 2009 Shigeru Kobayashi. All rights reserved.
Copyright (C) 2013 Norbert Truchsess. All rights reserved.
Copyright (C) 2014 Nicolas Panel. All rights reserved.
Copyright (C) 2009-2017 Jeff Hoefs. All rights reserved.
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2.1 of the License, or (at your option) any later version.
See file LICENSE.txt for further informations on licensing terms.
Last updated: September 16th, 2017
*/

/*
README
This is an example use of ConfigurableFirmata. The easiest way to create a configuration is to
use http://firmatabuilder.com and select the communication transport and the firmata features
to include and an Arduino sketch (.ino) file will be generated and downloaded automatically.
To manually configure a sketch, copy this file and follow the instructions in the
ETHERNET CONFIGURATION OPTION (if you want to use Ethernet instead of Serial/USB) and
FIRMATA FEATURE CONFIGURATION sections in this file.
*/

#include "ConfigurableFirmata.h"

/*==============================================================================

  • ETHERNET CONFIGURATION OPTION
  • By default Firmata uses the Serial-port (over USB) of the Arduino. ConfigurableFirmata may also
  • comunicate over ethernet using tcp/ip. To configure this sketch to use Ethernet instead of
  • Serial, uncomment the approprate includes for your particular hardware. See STEPS 1 - 5 below.
  • If you want to use Serial (over USB) then skip ahead to the FIRMATA FEATURE CONFIGURATION
  • section further down in this file.
  • If you enable Ethernet, you will need a Firmata client library with a network transport that can
  • act as a server in order to establish a connection between ConfigurableFirmataEthernet and the
  • Firmata host application (your application).
  • To use ConfigurableFirmata with Ethernet you will need to have one of the following
  • boards or shields:
    • Arduino Ethernet shield (or clone)
    • Arduino Ethernet board (or clone)
    • Arduino Yun
  • If you are using an Arduino Ethernet shield you cannot use the following pins on
  • the following boards. Firmata will ignore any requests to use these pins:
    • Arduino Uno or other ATMega328 boards: (D4, D10, D11, D12, D13)
    • Arduino Mega: (D4, D10, D50, D51, D52, D53)
    • Arduino Leonardo: (D4, D10)
    • Arduino Due: (D4, D10)
    • Arduino Zero: (D4, D10)
  • If you are using an ArduinoEthernet board, the following pins cannot be used (same as Uno):
    • D4, D10, D11, D12, D13
      ============================================================================/

// STEP 1 [REQUIRED]
// Uncomment / comment the appropriate set of includes for your hardware (OPTION A, B or C)

/*

  • OPTION A: Configure for Arduino Ethernet board or Arduino Ethernet shield (or clone)
  • To configure ConfigurableFirmata to use the an Arduino Ethernet Shield or Arduino Ethernet
  • Board (both use the same WIZ5100-based Ethernet controller), uncomment the SPI and Ethernet
  • includes below.
    */
    #include <SPI.h>
    #include <Ethernet.h>

/*

  • OPTION B: Configure for a board or shield using an ENC28J60-based Ethernet controller,
  • uncomment out the UIPEthernet include below.
  • The UIPEthernet-library can be downloaded
  • from: https://github.com/ntruchsess/arduino_uip
    */
    //#include <UIPEthernet.h>

/*

  • OPTION C: Configure for Arduino Yun
  • The Ethernet port on the Arduino Yun board can be used with Firmata in this configuration.
  • To execute StandardFirmataEthernet on Yun uncomment the Bridge and YunClient includes below.
  • NOTE: in order to compile for the Yun you will also need to comment out some of the includes
  • and declarations in the FIRMATA FEATURE CONFIGURATION section later in this file. Including all
  • features exceeds the RAM and Flash memory of the Yun. Comment out anything you don't need.
  • On Yun there's no need to configure local_ip and mac address as this is automatically
  • configured on the linux-side of Yun.
  • Establishing a connection with the Yun may take several seconds.
    */
    //#include <Bridge.h>
    //#include <YunClient.h>

#if defined ethernet_h || defined UIPETHERNET_H || defined YUN_CLIENT_H
#define NETWORK_FIRMATA

// STEP 2 [REQUIRED for all boards and shields]
// replace with IP of the server you want to connect to, comment out if using 'remote_host'
#define remote_ip IPAddress(192, 168, 178, 1)
// OR replace with hostname of server you want to connect to, comment out if using 'remote_ip'
// #define remote_host "server.local"

// STEP 3 [REQUIRED unless using Arduino Yun]
// Replace with the port that your server is listening on
#define remote_port 3030

// STEP 4 [REQUIRED unless using Arduino Yun OR if not using DHCP]
// Replace with your board or Ethernet shield's IP address
// Comment out if you want to use DHCP
//#define local_ip IPAddress(192, 168, 178, 200)

// STEP 5 [REQUIRED unless using Arduino Yun]
// replace with Ethernet shield mac. Must be unique for your network
const byte mac[] = {0x90, 0xA2, 0xDA, 0x0D, 0x07, 0x02};
#endif
`

WARNUNG: Bibliothek Ethernet behauptet auf esp8266 Architektur(en) ausgeführt werden zu können und ist möglicherweise inkompatibel mit Ihrem derzeitigen Board, welches auf avr Architektur(en) ausgeführt wird.
D:\Users\BKU\TobiasFriedrich\Documents\Arduino\libraries\Ethernet\src\Dns.cpp: In member function 'int DNSClient::getHostByName(const char*, IPAddress&)':

D:\Users\BKU\TobiasFriedrich\Documents\Arduino\libraries\Ethernet\src\Dns.cpp:130:52: error: 'INADDR_ANY' was not declared in this scope

 if (iDNSServer == INADDR_NONE || iDNSServer == INADDR_ANY)

                                                ^~~~~~~~~~

D:\Users\BKU\TobiasFriedrich\Documents\Arduino\libraries\Ethernet\src\Dns.cpp:130:52: note: suggested alternative: 'INADDR_NONE'

 if (iDNSServer == INADDR_NONE || iDNSServer == INADDR_ANY)

                                                ^~~~~~~~~~

                                                INADDR_NONE

Mehrere Bibliotheken wurden für "ConfigurableFirmata.h" gefunden
Benutzt: D:\Users\BKU\TobiasFriedrich\Documents\Arduino\libraries\ConfigurableFirmata
Nicht benutzt: D:\Users\BKU\TobiasFriedrich\Documents\Arduino\libraries\FirmataWithDeviceFeature
Mehrere Bibliotheken wurden für "SPI.h" gefunden
Benutzt: C:\Program
Nicht benutzt: D:\Users\BKU\TobiasFriedrich\Documents\Arduino\libraries\SPI
Mehrere Bibliotheken wurden für "Ethernet.h" gefunden
Benutzt: D:\Users\BKU\TobiasFriedrich\Documents\Arduino\libraries\Ethernet
Nicht benutzt: C:\Program
Mehrere Bibliotheken wurden für "Servo.h" gefunden
Benutzt: C:\Program
Nicht benutzt: D:\Users\BKU\TobiasFriedrich\Documents\Arduino\libraries\Servo
Mehrere Bibliotheken wurden für "Wire.h" gefunden
Benutzt: C:\Program
Nicht benutzt: D:\Users\BKU\TobiasFriedrich\Documents\Arduino\libraries\Wire
Mehrere Bibliotheken wurden für "SoftwareSerial.h" gefunden
Benutzt: C:\Program
exit status 1
Fehler beim Kompilieren für das Board Arduino Nano.
`

@pgrawehr
Copy link
Contributor

It seems that a wrong ethernet library was included in the build. You might have multiple conflicting libraries installed (i.e. for different boards). Try whether a basic ethernet example for the Nano works first.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants