Skip to content

Support the esp8266 in Firmata Boards.h #9

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

Closed
probonopd opened this issue Mar 29, 2015 · 6 comments
Closed

Support the esp8266 in Firmata Boards.h #9

probonopd opened this issue Mar 29, 2015 · 6 comments

Comments

@probonopd
Copy link
Contributor

probonopd commented Mar 29, 2015

Firmata errors with

libraries/Firmata/src/Boards.h:337:2: error: #error "Please edit Boards.h with a hardware abstraction for this board"
 #error "Please edit Boards.h with a hardware abstraction for this board"
  ^

Possibly https://github.com/esp8266/Arduino/blob/esp8266/libraries/Firmata/src/Boards.h could be changed to support the esp8266?

Want to back this issue? Post a bounty on it! We accept bounties via Bountysource.

@scryb3
Copy link

scryb3 commented Jun 2, 2015

This seems to be an important one, I'm researching adding a definition, but am starting at nothing, please feel free to help!

Edit: I'm running into the same issue trying to get https://github.com/octoblu/microblu_mqtt running on the ESP8266

@scryb3
Copy link

scryb3 commented Jun 2, 2015

I tried this hack around and it seems to have worked for now (IOW I'm getting other errors now):

(in sketch for now)
#define ESP8266

(in boards.h before "// anything else")

// ESP8266
#elif defined(ESP8266)
#define TOTAL_ANALOG_PINS 15
#define TOTAL_PINS 15 // 16 GPIO
#define VERSION_BLINK_PIN 13
#define IS_PIN_DIGITAL(p) ((p) >= 0 && (p) <= 15)
#define IS_PIN_ANALOG(p) ((p) >= 0 && (p) <= 15)
#define IS_PIN_PWM(p) digitalPinHasPWM(p)
#define IS_PIN_SERVO(p) (IS_PIN_DIGITAL(p) && (p) - 2 < MAX_SERVOS)
#define IS_PIN_I2C(p) ((p) >= 0 && (p) <= 15)
#define PIN_TO_DIGITAL(p) (p)
#define PIN_TO_ANALOG(p) ((p) - 14)
#define PIN_TO_PWM(p) PIN_TO_DIGITAL(p)
#define PIN_TO_SERVO(p) ((p) - 2)

@scryb3
Copy link

scryb3 commented Jun 19, 2015

I think that my cavalier copying of the text above, which did fix my compilation errors, is causing me other problems.

If someone more experienced can help me figure out the right config for this board I would appreciate it.

igrr pushed a commit that referenced this issue Jun 26, 2015
igrr pushed a commit that referenced this issue Oct 29, 2015
igrr pushed a commit that referenced this issue Oct 29, 2015
igrr pushed a commit that referenced this issue Oct 29, 2015
@mralexgray
Copy link

is there any update on this? support for firmata is really missed/would be great!

@gmag11
Copy link
Contributor

gmag11 commented Jan 16, 2017

Hello, some time ago I was playing with Firmata and successfully used on it with Snap4Arduino.

The problem in definition is that Serial pins are defined as digital pins. They have to be excluded from definition. I used this one

// ESP8266
// note: boot mode GPIOs 0, 2 and 15 can be used as outputs, GPIOs 6-11 are in use for flash IO
#elif defined(ESP8266)
#define TOTAL_ANALOG_PINS       NUM_ANALOG_INPUTS
#define TOTAL_PINS              A0 + NUM_ANALOG_INPUTS
#define PIN_SERIAL_RX           3
#define PIN_SERIAL_TX           1
#define IS_PIN_DIGITAL(p)       (((p) >= 0 && (p) <= 5) || ((p) >= 12 && (p) < A0))
#define IS_PIN_ANALOG(p)        ((p) >= A0 && (p) < A0 + NUM_ANALOG_INPUTS)
#define IS_PIN_PWM(p)           digitalPinHasPWM(p)
#define IS_PIN_SERVO(p)         (IS_PIN_DIGITAL(p) && (p) < MAX_SERVOS)
#define IS_PIN_I2C(p)           ((p) == SDA || (p) == SCL)
#define IS_PIN_SPI(p)           ((p) == SS || (p) == MOSI || (p) == MISO || (p) == SCK)
#define IS_PIN_INTERRUPT(p)     (digitalPinToInterrupt(p) > NOT_AN_INTERRUPT)
#define IS_PIN_SERIAL(p)        ((p) == PIN_SERIAL_RX || (p) == PIN_SERIAL_TX)
#define PIN_TO_DIGITAL(p)       (p)
#define PIN_TO_ANALOG(p)        ((p) - A0)
#define PIN_TO_PWM(p)           PIN_TO_DIGITAL(p)
#define PIN_TO_SERVO(p)         (p)
#define DEFAULT_PWM_RESOLUTION  10

@devyte
Copy link
Collaborator

devyte commented Oct 20, 2017

3rd party lib. The referenced file above is no longer hosted in this repo.
Closing.

@devyte devyte closed this as completed Oct 20, 2017
ascillato pushed a commit to ascillato/Arduino that referenced this issue Nov 12, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

6 participants