ChuckBell / MySQL_Connector_Arduino

Database connector library for using MySQL with your Arduino projects.
332 stars 133 forks source link

Incompatibility of connector for ESP32 vs ESP8266 code #70

Closed topdancer closed 5 years ago

topdancer commented 5 years ago

Hi,

As mentioned in issue 47, compiling ESP32 code referring to the connector fails with two errors in the module mySQL_Encrypt_Sha1.cpp in lines 89 and 95. Adding a „Return 0“ statement in both functions solves the compile issue on ESP32.

However, if running some other code containing mySQL code on ESP8266 / ESP8285 devices (using such modified mySQL library as above!) results that the devices can’t connect to mySQL db. Any connection attempt immediately results in connection result FAILED. As soon as I then remove/comment out both „Return 0“ statements in the Sha1 component, the connection is successful (which in turn would result in compile errors for code on my ESP32 system).

Can you verify this behavior?

Certainly can I change the code in Sha1.cpp depending on the device to be compiled, but isn’t there a more elegant solution for this behaviour?

Thanks, Kurt

ChuckBell commented 5 years ago

I cannot verify the behavior. The code works as-is for me - I may not have the “right” ESP board. Which one are you using?

Regardless, I suggest making a conditional compilation to add the return for ESP32 boards. Would that solve your problem? If so, I’ll work on adding that (or you can suggest a patch if you’d like).

On Nov 1, 2018, at 1:10 PM, topdancer notifications@github.com wrote:

Hi,

As mentioned in issue 47, compiling ESP32 code referring to the connector fails with two errors in the module mySQL_Encrypt_Sha1.cpp in lines 89 and 95. Adding a „Return 0“ statement in both functions solves the compile issue on ESP32.

However, if running some other code containing mySQL code on ESP8266 / ESP8285 devices (using such modified mySQL library as above!) results that the devices can’t connect to mySQL db. Any connection attempt immediately results in connection result FAILED. As soon as I then remove/comment out both „Return 0“ statements in the Sha1 component, the connection is successful (which in turn would result in compile errors for code on my ESP32 system).

Can you verify this behavior?

Certainly can I change the code in Sha1.cpp depending on the device to be compiled, but isn’t there a more elegant solution for this behaviour?

Thanks, Kurt

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/ChuckBell/MySQL_Connector_Arduino/issues/70, or mute the thread https://github.com/notifications/unsubscribe-auth/AH0j4KnQnvV1gudQQ-_GBRB2BIPtAb_Kks5uqysfgaJpZM4YHgWh.

topdancer commented 5 years ago

Thanks Chuck. I was using two of the Chinese development boards (ESP32 & ESP8266). With my boards I can reproduce the behaviors. Anyway, I am following your suggestion and and add conditional compile directives, this works.

Thanks, Kurt