Skip to content

Support Servo library #8

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 · 17 comments
Closed

Support Servo library #8

probonopd opened this issue Mar 29, 2015 · 17 comments

Comments

@probonopd
Copy link
Contributor

So far, the Servo library is not supported. 4b73026#commitcomment-10456654
It would be nice if the library could be expanded to support the esp8266 as well; this is probably dependent on the PWM code being implemented.

@igrr
Copy link
Member

igrr commented Mar 29, 2015

Looking at the code, this library heavily uses AVR timer registers. It doesn't even support Arduino Due (ARM) boards. Supporting esp8266 would require some heavy rework of this library.

@Makuna
Copy link
Collaborator

Makuna commented May 23, 2015

I was looking at this also. The rework is basically abstracting the timers. The SAM version has better timer abstraction due to the existing timer APIs.

@dogrocker
Copy link

Me too.

@Makuna
Copy link
Collaborator

Makuna commented May 29, 2015

pull #358

@igrr
Copy link
Member

igrr commented Jun 2, 2015

Merged

@igrr igrr closed this as completed Jun 2, 2015
@vpr1995
Copy link

vpr1995 commented Jun 18, 2015

screenshot 3
Please help me out,I have installed latest version of Arduino IDE(1.6.5) and also from Board manager(..3697) ,i had the same problem for Arduino IDE(1.6.4).

@Makuna
Copy link
Collaborator

Makuna commented Jun 18, 2015

From the preferences menu turn on verbose compiler output, then build and copy the complete output. From what I see above, it is including the wrong header file as the path is wrong.
It should be like AppData\Roaming\Arduino15\packages\esp8266\hardware\esp8266\1.6.4-816-g1f0673f\libraries\Servo

@vpr1995
Copy link

vpr1995 commented Jun 19, 2015

How to change the path?,and i followed file path you mentioned above but there is no servo folder in libraries folder

@Makuna
Copy link
Collaborator

Makuna commented Jun 19, 2015

What version are you using of the Esp8266/Arduino? If you include the path that is similar to what I had shown above, you can see the version I am running is 1.6.4-816-. The 816 is the important part here.
How did you install the esp8266 Board support? The servo library is in the staging install at the moment waiting for other stuff to stabilize before being put into the normal install.
To use the staging install, you need to use the json path http://arduino.esp8266.com/staging/package_esp8266com_index.json when following the install instructions.

@vpr1995
Copy link

vpr1995 commented Jun 19, 2015

I just followed the instructions given in readme.Now its working thank you for sorting me out.

chadouming pushed a commit to chadouming/Arduino that referenced this issue Jun 22, 2015
@Lizatre
Copy link

Lizatre commented Jun 29, 2015

I am still having this problem even though I followed all README instructions. I also tried adding the staging install but I still get the [avr, sam] architecture error message. Any advice?

@igrr
Copy link
Member

igrr commented Jun 29, 2015

Please see #463 and comment from @Makuna above — you might not be using the version which contains the changes for the Servo library.

@Lizatre
Copy link

Lizatre commented Jun 29, 2015

Yes that link was very helpful. Now I'm just having a problem with the timecallback functions for some reason...

Arduino: 1.6.4 (Windows 7), Board: "NodeMCU (ESP8266 ESP-12 Module), 80 MHz, 115200"

In file included from C:\Users\Valued Customer\Documents\Arduino\libraries\Servo\src/Servo.h:67:0,
from sketch_jun27c.ino:1:
C:\Users\Valued Customer\Documents\Arduino\libraries\Servo\src/esp8266/ServoTimers.h:59:24: error: 'timercallback' has not been declared
void InitInterrupt(timercallback handler)
^
C:\Users\Valued Customer\Documents\Arduino\libraries\Servo\src/esp8266/ServoTimers.h: In member function 'void ServoTimer0::InitInterrupt(int)':
C:\Users\Valued Customer\Documents\Arduino\libraries\Servo\src/esp8266/ServoTimers.h:61:25: error: 'timer0_isr_init' was not declared in this scope
timer0_isr_init();
^
C:\Users\Valued Customer\Documents\Arduino\libraries\Servo\src/esp8266/ServoTimers.h:62:39: error: 'timer0_attachInterrupt' was not declared in this scope
timer0_attachInterrupt(handler);
^
C:\Users\Valued Customer\Documents\Arduino\libraries\Servo\src/esp8266/ServoTimers.h: In member function 'void ServoTimer0::StopInterrupt()':
C:\Users\Valued Customer\Documents\Arduino\libraries\Servo\src/esp8266/ServoTimers.h:69:32: error: 'timer0_detachInterrupt' was not declared in this scope
timer0_detachInterrupt();
^
C:\Users\Valued Customer\Documents\Arduino\libraries\Servo\src/esp8266/ServoTimers.h: In member function 'void ServoTimer0::SetPulseCompare(uint32_t)':
C:\Users\Valued Customer\Documents\Arduino\libraries\Servo\src/esp8266/ServoTimers.h:74:49: error: 'timer0_write' was not declared in this scope
timer0_write(ESP.getCycleCount() + value);
^
C:\Users\Valued Customer\Documents\Arduino\libraries\Servo\src/esp8266/ServoTimers.h: In member function 'void ServoTimer0::SetCycleCompare(uint32_t)':
C:\Users\Valued Customer\Documents\Arduino\libraries\Servo\src/esp8266/ServoTimers.h:79:41: error: 'timer0_write' was not declared in this scope
timer0_write(cycleStart + value);
^
C:\Users\Valued Customer\Documents\Arduino\libraries\Servo\src/esp8266/ServoTimers.h: At global scope:
C:\Users\Valued Customer\Documents\Arduino\libraries\Servo\src/esp8266/ServoTimers.h:147:24: error: 'timercallback' has not been declared
void InitInterrupt(timercallback handler)
^
C:\Users\Valued Customer\Documents\Arduino\libraries\Servo\src/esp8266/ServoTimers.h: In member function 'void ServoTimer1::InitInterrupt(int)':
C:\Users\Valued Customer\Documents\Arduino\libraries\Servo\src/esp8266/ServoTimers.h:150:39: error: invalid conversion from 'int' to 'void (
)()' [-fpermissive]
timer1_attachInterrupt(handler);
^
In file included from C:\Users\Valued Customer\Documents\Arduino\libraries\Servo\src/Servo.h:52:0,
from sketch_jun27c.ino:1:
C:\Users\Valued Customer\AppData\Roaming\Arduino15\packages\esp8266\hardware\esp8266\1.6.4-673-g8cd3697\cores\esp8266/Arduino.h:106:6: error: initializing argument 1 of 'void timer1_attachInterrupt(void (_)())' [-fpermissive]
void timer1_attachInterrupt(void (*userFunc)(void));
^

@Makuna
Copy link
Collaborator

Makuna commented Jun 30, 2015

If you examine your output, you will notice that you are running 673 build version (using my instructions above to help identify the build).

build 673 doesn't support Servo as it was included after that. So nothing will work until you get a newer build.

It looks like build 673 was the last "public" build. If you want to use the staging build, it will include the library. You can get the staging build (albeit you will be using a possible unstable build) you can follow the normal instructions, but use the following for the path http://arduino.esp8266.com/staging/package_esp8266com_index.json

@chrisallick
Copy link

Hi,
I know this is closed, but I installed the staging package, and I got the servo working fine on by attaching to "5". However, it will not connect to WiFi. I'm assuming there is a conflict of pins between ESP8266WiFi.h and Servo.h?

Is there is solve for this? Thanks. I'd really love to be able to use the servo/wifi on the ESP8266 rather than relying on another MCU. Here is the error that happens when I have the "attach" command in my sketch. I also tried A0.

ets Jan 8 2013,rst cause:2, boot mode:(3,6)

load 0x4010f000, len 1264, room 16
tail 0
chksum 0x42
csum 0x42
~ld

@chrisallick
Copy link

Just following up on my comment. I moved "myservo.attach(5)" to the end of my setup function and it works! Connected to WiFi then attached my servo and it's good to go. Thanks!

igrr pushed a commit that referenced this issue Oct 28, 2015
igrr pushed a commit that referenced this issue Oct 29, 2015
pull todays OneWire fix
igrr pushed a commit that referenced this issue Oct 29, 2015
igrr pushed a commit that referenced this issue Oct 29, 2015
igrr added a commit that referenced this issue Feb 26, 2016
Changelog:
324c2fd Terminate connection if increase_bm_data_size fails
96fbb39 Update README.md
c18bb56 Add travis CI
9eaeca3 Postpone freeing of X509 context to the first data exchange after handshake
28869ea Use free followed by malloc instead of realloc when increasing raw buffer
43a90bc Merge pull request #8 from slaff/feature/lwipr-compat
66e1a5f Merge pull request #7 from slaff/feature/sni
1154d0a Changed the code to reserve bytes for hostname only if needed.
63da899 Added SNI ( https://en.wikipedia.org/wiki/Server_Name_Indication ) support.
7c38865 Restructured the lwip raw comat code. Added replacements for the time functions on ESP8266.
885ff3e Merge pull request #6 from slaff/feature/lwip-raw
d78e7a0 Initial version of axTLS integration with lwip raw tcp mode (http://lwip.wikia.com/wiki/Raw/TCP).
madpilot pushed a commit to madpilot/Arduino that referenced this issue Jul 15, 2017
Restructured the lwip raw compatability code.
@Gargo
Copy link

Gargo commented Feb 27, 2018

nice. Now nodemcu "supports" servo library. Which means the code is compiled but won't work

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

8 participants