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

Fixes to enable WiFiEsp on Arduino Due and other SAM32 chips. #27

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

gzabusek
Copy link

Fixes issue #26

Problem is SAM32 libs already contain RingBuffer used for the UART. Renamed the class and removed vsnprintf_P usage as its only present on AVRs.

@gzabusek
Copy link
Author

The next commit fixes #23 issue

Copy link

@lenny1972 lenny1972 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi, I'd like to know if in file "src/utility/WifiEspRingBuffer.h" there is a typo or not.
Specifically when you suggest to add:
+#ifndef WifiEspWifiEspRingBuffer_h
+#define WifiEspWifiEspRingBuffer_h

Is it correct or it has to be:
+#ifndef WifiEspRingBuffer_h
+#define WifiEspRingBuffer_h
??
By the other hand I'm trying to modify the library to get working with my Arduino DUE but the current version of some of the library's files have been changed (comparing to the version of this example). Is it possible to update the changes to the current library version or attach the modified library on Github?
Thanks in advance

@srolf
Copy link

srolf commented Jan 4, 2017

With the following changes (on top of release 2.2.1), I was able to get it working on a Due and M0 (no Pro) which where tested against NTP example on Leonardo, Due and M0:

\Arduino\libraries\WiFiEsp\

  • rename all RingBuffer to WiFiEspRingBuffer

\Arduino\libraries\WiFiEsp\src\utility\RingBuffer.h

  • rename RingBuffer.h to WiFiEspRingBuffer.h

\Arduino\libraries\WiFiEsp\src\utility\RingBuffer.cpp

  • rename RingBuffer.cpp to WiFiEspRingBuffer.cpp

\Arduino\libraries\WiFiEsp\src\utility\EspDrv.cpp

  • add below line 20
    #include <stdarg.h>
    #if defined(__SAMD21G18A__) || defined(__SAM3X8E__)
    #define vsnprintf_P vsnprintf
    #endif

\Arduino\libraries\WiFiEsp\src\utility\debug.h

  • add below the line 31
    #if defined(__SAMD21G18A__)
    #define Serial SerialUSB
    #endif

@srolf
Copy link

srolf commented Jan 6, 2017

With the changes above, also a M0 Pro by using the native port is working.

@sticilface sticilface mentioned this pull request Jan 30, 2017
@srolf
Copy link

srolf commented Apr 30, 2017

By changing
#if defined(__SAMD21G18A__) || defined(__SAM3X8E__)
to
#if defined(__SAMD21G18A__) || defined(__SAM3X8E__) || defined(__CPU_ARC__)
it compiles/runs also on an Arduino 101 (tested with a MQTT PubSub example).

@sserena
Copy link

sserena commented Oct 22, 2017

Not working for me. I'm using a Due. Going off the WebClient-example, client.connect(server, 80) does establish a connection, but client.available() is never true, causing it to disconnect instantly. I found that espSerial->available() is always zero, but that's as far as I got.
This said, if I set #define _ESPLOGLEVEL_ 4 in debug.h, the content (asciilogo .txt in this particular case) is actually received and printed.

@EduardoMarquez
Copy link

I work for Feather M0

@ghost
Copy link

ghost commented Aug 7, 2018

Fix above from srolf worked for me with an Arduino MKRFOX1200 and ESP8266 AT module.

Thanks for this.

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

Successfully merging this pull request may close these issues.

5 participants